Configure egress filtering to control which external services your GitHub Actions runners can connect to by blocking or allowing connections at the network level. Egress filtering helps prevent data exfiltration and reduces the attack surface of your CI infrastructure.
Configure egress rules on your organization's settings page, in the GitHub Actions Runners section under Egress Rules.
By default, Depot runners allow outbound connections to any external service. You can set the default rule (target *) to either Deny or Allow. You can add more rules to allow or deny connections to specific IPs, CIDRs, or hostnames.
The following example shows a set of rules to get a Docker build with Golang working:
This example first applies a blanket deny rule, which blocks all outbound connections by default. Then, it allows connections to the following:
auth.docker.io and docker.io for Docker Hub authentication and registry accesssum.golang.org and proxy.golang.org for Go modules and proxy accessstorage.googleapis.com for Google Cloud Storage accessThe runner applies the filtering rules in the following order:
When you specify a hostname in your rules, it's resolved to IP addresses and pinned in /etc/hosts to ensure consistent filtering.
To ensure that runners can still connect to necessary services, we automatically add certain IPs and hosts to the allowlist:
Container builds with depot build also work with egress filtering enabled. Depot dynamically adds BuildKit machine IPs to the allowlist as they're allocated.
Keep the following limitations in mind when you use egress filtering: