The Simplest Way to Make CircleCI and Fortigate Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing circleci and fortigate lets your build jobs deploy code into private networks. CircleCI runs your tests and builds, while Fortigate checks traffic at the firewall border. Teams use this pair to ship updates to private servers with strict firewall rules. When you set it up well, builds pass through the firewall without exposing your network. How circleci and fortigate handle logins and traffic CircleCI runs jobs on cloud runners or self-hosted machines inside your own network. When a

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 circleci and fortigate lets your build jobs deploy code into private networks. CircleCI runs your tests and builds, while Fortigate checks traffic at the firewall border.

Teams use this pair to ship updates to private servers with strict firewall rules. When you set it up well, builds pass through the firewall without exposing your network.

How circleci and fortigate handle logins and traffic

CircleCI runs jobs on cloud runners or self-hosted machines inside your own network. When a cloud job needs to reach a private server, it hits the Fortigate firewall.

The firewall blocks unknown traffic by default to keep your internal systems safe. To let the build job through, the job must prove its identity first.

Some teams set up IP allowlists on the firewall for cloud runners. Cloud runners change their IP addresses often, so static firewall rules break or grow too broad.

Other teams use a self-hosted runner placed behind the Fortigate appliance. The runner pulls job steps from CircleCI and talks to local servers on the inside.

If the job updates firewall rules, it sends requests to the Fortigate management interface. That request needs an admin token or key stored in the CircleCI project settings.

Data flows from the build job through the firewall and on to the target host. Fortigate logs the packet source, while CircleCI logs the build output.

Common failure modes and how to scope roles

Shared service accounts cause the biggest risks in this setup. Many teams create one full admin key on the firewall and paste it into CircleCI.

If that broad token leaks in a build log, anyone can change your firewall rules. A single bad script could open ports to the public internet by mistake.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Shared keys also ruin your audit logs during a security review. The firewall log shows the shared bot name instead of the person who pushed code.

Broad network paths create another major risk for your internal apps. Opening a wide subnet to a build runner lets a job reach databases it should not touch.

You can fix this by scoping roles down to the bare minimum. Create a separate Fortigate role for each pipeline and grant write permissions only where needed.

Do not give a deployment job permission to edit system-wide firewall settings. Limit network paths so the runner only reaches the exact port on the target server.

Rotate your pipeline keys on a strict schedule to limit the life of stolen secrets. Store those keys in narrow contexts so only approved branches can read them during a run.

Auditing and data safety in build pipelines

Build jobs often run database scripts or check app health through the firewall. These tasks can pull customer data back into the build output log.

If a script prints a user table, sensitive fields might sit in plain text. Data masking helps by rewriting matched fields like emails, phone numbers, or card numbers in results.

Teams should also link build logs with firewall traffic logs by time and job ID. Clear logs help you trace every change back to a single commit and developer.

When you check both logs together, you spot rogue queries or odd network calls fast. Keep your runner machines patched and locked down to stop lateral movement inside your network.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Should I use IP allowlists or self-hosted runners with Fortigate?

Self-hosted runners work better for private networks behind a Fortigate firewall. They make outbound calls to CircleCI, so you do not need wide inbound firewall rules.

How do I stop build jobs from having too much firewall power?

Give each pipeline a narrow role on the firewall with limited read or write rights. Never share a root admin token across multiple projects or teams.

How can I track which developer triggered a network call from a build?

Pass the CircleCI job ID and user name into your script headers or log tags. You can then match the build run against your internal traffic logs.

The query runs. The emails stay hidden.