The Simplest Way to Make GitLab CI and Ubiquiti Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing gitlab ci and ubiquiti lets teams push network changes through code pipelines. Your build jobs can update firewall rules, DNS records, and port rules in seconds. Manual edits in a local network panel often cause outages and hidden drift. Automation turns those clicks into reviewed code commits with a clear history. When a developer merges a branch, the runner talks to the network controller. This workflow keeps office and server networks in sync with your code. How gitlab ci and ubiqu

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Pairing gitlab ci and ubiquiti lets teams push network changes through code pipelines. Your build jobs can update firewall rules, DNS records, and port rules in seconds.

Manual edits in a local network panel often cause outages and hidden drift. Automation turns those clicks into reviewed code commits with a clear history. When a developer merges a branch, the runner talks to the network controller. This workflow keeps office and server networks in sync with your code.

How gitlab ci and ubiquiti share login keys and data

The build runner needs a network path to reach the local controller API. Most teams place a self-hosted runner inside the local network zone. This runner sits on a protected subnet that can reach the management port. Cloud runners cannot reach private controllers without opening risky inbound ports.

First, the pipeline job reads a stored secret from the build variables. Next, the job sends a login request to the controller API endpoint. The controller checks the account details and returns a session cookie or token. Then, the job sends JSON payloads to read or write network rules.

Data flows both ways during a normal pipeline run. The job first reads the current state of the switches and routers. It compares that live state against the desired settings in your git repo. Finally, the job sends updates for only the rules that changed.

Common failure modes and how to scope roles

Many teams use a single admin account for all their build jobs. This shared account often has full rights to wipe the whole site. If a pipeline script has a bug, it can lock out the team. If an attacker steals that key, they own the entire local network.

Long-lived tokens stored in build variables create another big risk for teams. Any developer who can edit the pipeline file can print those secrets. Unlogged API calls also make it hard to see who broke a rule. The controller log only shows the shared bot name, not the human author.

GitLab CI Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, create a separate local account just for pipeline runs. Give this role the minimum rights needed for its specific network task. Keep a read-only account for check jobs that run on open merge requests. Use a write account only on protected branches after a peer review.

Lock down the network path between the build runner and the controller. Place the runner in a dedicated VLAN with strict firewall rules. Allow traffic from the runner IP only to the controller API port. Block the runner from talking to other user devices on the network.

Testing network changes before they hit production

Bad network rules can drop active calls or block server traffic right away. Always run a syntax check on your config files during the first stage. Make sure every IP address, subnet mask, and port number is valid.

Run a dry-run step on every merge request before anyone approves it. This step logs in with a read-only role and fetches live state. It prints a plain text summary of what rules will change next. Reviewers read this output to catch mistakes before they merge the branch.

Keep a backup of the controller state before the write job starts. Trigger a snapshot through the API or save the current JSON state. Store that backup file as a protected build artifact for thirty days. If a new firewall rule breaks traffic, you can restore the old state.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should we use a cloud runner or a local runner for network jobs?

Use a local runner inside your private network for these pipeline jobs. This avoids opening your network controller management port to the public internet.

How do we stop merge requests from changing live firewall rules?

Give merge request pipelines a read-only account that can only check state. Restrict the write account variables to protected branches like your main branch.

The job will time out and leave the network in a half-updated state. Test rule changes in small batches and keep console access ready for recovery.

The query runs. The emails stay hidden.