Skip to content
Fixedmark

Platforms · 10 min read

Updated

GitHub Actions Deploys to IP-Allowlisted Servers

GitHub-hosted runners have no fixed IP, so a server that checks source addresses will refuse them. Open the firewall to the runner's IP for one job and close it after, run the job on a runner with a fixed IP (larger runners with static IPs on Enterprise Cloud, or self-hosted), or keep standard runners and send only the deploy step through a tunnel or fixed-IP proxy.

On this page

Why the deploy step gets refused

Every job on a GitHub-hosted runner starts on a fresh virtual machine. Its public IP comes from a pool that GitHub shares across every workflow on the platform. The next job, even a rerun of the same one, can leave from a different address. A server that only accepts SSH from known IPs, a database with an access list, or a partner's SFTP drop sees a stranger each time.

GitHub publishes the pool under the actions key of its meta API. On 10 November 2026 that key held 8,350 ranges, 5,622 of them IPv4, covering about 28.6 million IPv4 addresses. The hosted runner reference says the list is updated once a week and that GitHub does not recommend using it as an allowlist for internal resources. It also notes that outbound addresses are not limited to Azure datacenter ranges, and that macOS runners run in GitHub's own macOS cloud.

Allowlisting that list means trusting anyone who can push a workflow to any repository. Cloud IP ranges are not an allowlist covers that failure in detail. This post is about the alternatives that give a deploy job an address you can defend.

Counts come from curl -s https://api.github.com/meta | jq '.actions | length' and change weekly. Run it yourself before you quote a number to a security team.

Five ways to get a fixed source address

The options differ in who owns the firewall, which GitHub plan you need, and what the other side has to allowlist. Pick by those three facts first, then by effort.

Fixed source addresses for GitHub Actions deploys
ApproachGitHub planWhat the server allowlistsFits when
Temporary rule per jobAnyThe runner's IP, for a few minutesYou own the firewall and it has an API
Larger runners with static IPsEnterprise CloudTwo CIDR ranges GitHub assignsMost of your CI needs a fixed address
Azure private networkingTeam or Enterprise CloudWhatever egress your Azure VNet usesYou already run in Azure
Self-hosted runnerAnyThe runner machine's IPYou can patch and isolate a machine
Tunnel or fixed-IP proxy for one stepAnyThe bastion's or proxy's IPsOne deploy or sync step needs it

A quick way to choose. If a partner owns the firewall, rule out the temporary rule, because you cannot edit their allowlist from CI. If the partner accepts only one or two single IPs, rule out the CIDR ranges of larger runners. If you have no Enterprise Cloud contract, you are choosing between a self-hosted runner and routing the one step that needs it.

Open the firewall for one job, then close it

When the firewall is yours, the cheapest route is to add the runner's current IP at the start of the job and remove it at the end. On AWS that is one authorize-security-group-ingress call and one revoke. Use OIDC through configure-aws-credentials so the job holds short-lived credentials instead of a stored key.

.github/workflows/deploy.yml
name: deploy
on:
  push:
    branches: [main]

permissions:
  id-token: write
  contents: read

# One deploy at a time, so two runs never fight over rules.
concurrency:
  group: deploy-production
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production
    timeout-minutes: 20
    env:
      SG_ID: sg-0123456789abcdef0
    steps:
      - uses: actions/checkout@v5

      - uses: aws-actions/configure-aws-credentials@v6
        with:
          role-to-assume: arn:aws:iam::123456789012:role/gha-deploy
          aws-region: ap-south-1

      - name: Allow this runner on port 22
        id: open
        run: |
          IP=$(curl -fsS https://checkip.amazonaws.com)
          RULE=$(aws ec2 authorize-security-group-ingress \
            --group-id "$SG_ID" \
            --ip-permissions "IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges=[{CidrIp=$IP/32,Description=gha-$GITHUB_RUN_ID-$(date -u +%s)}]" \
            --query 'SecurityGroupRules[0].SecurityGroupRuleId' --output text)
          echo "rule=$RULE" >> "$GITHUB_OUTPUT"

      - name: Deploy
        run: ./scripts/deploy.sh

      - name: Remove the rule
        if: always() && steps.open.outputs.rule != ''
        run: |
          aws ec2 revoke-security-group-ingress \
            --group-id "$SG_ID" \
            --security-group-rule-ids "${{ steps.open.outputs.rule }}"

The cleanup step uses always(), which GitHub's expressions reference says runs even when the job is canceled. It cannot run if the runner itself is lost. Plan for a rule that outlives its job, because that IP goes back to the shared pool and the next tenant inherits your opening. The timestamp in the description lets a scheduled sweeper remove stale rules.

Scheduled sweeper (runs every 15 minutes)
NOW=$(date -u +%s)
aws ec2 describe-security-group-rules \
  --filters "Name=group-id,Values=$SG_ID" \
  --query "SecurityGroupRules[?Description && starts_with(Description, 'gha-')].[SecurityGroupRuleId,Description]" \
  --output text |
while read -r ID DESC; do
  TS=${DESC##*-}
  if [ $((NOW - TS)) -gt 3600 ]; then
    aws ec2 revoke-security-group-ingress --group-id "$SG_ID" --security-group-rule-ids "$ID"
  fi
done

Know the limits before you adopt this.

  • The IAM role can now edit a security group. Anyone who can change a workflow that assumes it can open that port to any address. Scope the role's trust policy to the main branch and the production environment, and its permissions to one group.
  • Security groups hold 60 inbound IPv4 rules by default, per the VPC quotas page. Leaked rules from failed sweeps add up.
  • Other systems have the same shape. The MongoDB Atlas CLI can add the current host with atlas accessLists create --currentIp --deleteAfter <ISO date>, per the Atlas CLI reference, so Atlas expires the entry itself. See closing an open Atlas access list.
  • It does nothing for a partner's firewall. A bank or a client will not give your CI write access to their allowlist.

Larger runners with static IP ranges

GitHub's own answer is a larger runner with static IPs. The larger runners reference says the option is for GitHub Enterprise Cloud customers. Without it, larger runners get a dynamic IP that changes with each job. The facts that matter for an allowlist are these.

  • Linux and Windows only. macOS larger runners do not support static IPs, per Manage larger runners.
  • You get ranges, not single addresses. Since a 2023 change, each static-IP runner receives two ranges in separate regions. GitHub's docs do not state the size of each range, so read them from the runner's settings before you promise anything to a partner.
  • Up to 10 static-IP runner pools at the organization level and 10 at the enterprise level by default. More needs GitHub Support.
  • If a runner goes unused for more than 90 days, its ranges are removed and cannot be recovered. A quarterly release job can lose its allowlisted addresses between releases.
  • Billing is per minute at larger-runner rates. GitHub's runner pricing lists Linux 4-core at $0.012 a minute against $0.006 for the standard 2-core runner.

This fits an organization that is already on Enterprise Cloud and wants most CI traffic to come from known ranges. It fits poorly when a partner's form has two boxes for single IPv4 addresses, which is common with Indian banks and brokers. Why brokers ask for a primary and secondary IP shows that shape.

Azure private networking

GitHub can also place hosted runners inside your own Azure virtual network. GitHub's private networking overview says organization owners on the Team plan can configure it, and that it gives you full control over runner networking policies. Egress then follows your VNet's own setup, such as a NAT gateway with a public IP you own. That is a good answer if your servers already live in Azure, and a large project if they do not.

Self-hosted runners on a machine with a fixed IP

A self-hosted runner on a VM with a reserved public IP gives you one address, on any plan. Run the runner service on that VM, give it a label such as deploy, and target only the deploy job at it with runs-on: [self-hosted, deploy]. Tests and builds stay on hosted runners. On Kubernetes, Actions Runner Controller can scale ephemeral runners, and their egress is whatever your cluster's NAT gives them. Static egress IPs from Kubernetes covers that part.

The cost is security and upkeep, not money. GitHub's secure use reference says self-hosted runners should almost never be used for public repositories, because anyone can open a pull request and compromise the environment. It also warns that self-hosted runners can be persistently compromised by untrusted code, and that you cannot guarantee one runner only ever runs one job. The self-hosted runners overview adds that you patch the operating system and every tool on it.

  • Register the deploy runner on the deploy repository itself, or in a runner group limited to your deploy repositories.
  • Prefer just-in-time or ephemeral runners, which take at most one job before they are removed.
  • Keep long-lived secrets off the disk. Pull them per job from GitHub environment secrets or your cloud's secret manager.
  • The machine's fixed IP is now a trusted address on someone else's firewall. Anything else that runs on it borrows that trust.

Tunnel or proxy only the deploy step

The last family keeps standard hosted runners and changes the path of one step. The server allowlists a fixed address that sits outside GitHub, either a bastion you run or a static IP proxy. Everything else in the job, such as checkout, caches, and artifact uploads, goes direct.

WireGuard to a bastion you own

GitHub documents WireGuard as an overlay between a runner and a private service. The bastion's UDP port has to accept packets from any runner IP. That is a smaller exposure than an open SSH port, because the WireGuard protocol does not respond at all to a client that cannot authenticate. The target server then allowlists only the bastion, or listens only on the overlay address.

Workflow step
      - name: Join the deploy overlay
        env:
          WG_PRIVATE_KEY: ${{ secrets.WG_PRIVATE_KEY }}
          WG_SERVER_PUBKEY: ${{ secrets.WG_SERVER_PUBKEY }}
        run: |
          sudo apt-get update -q && sudo apt-get install -y wireguard-tools
          umask 077
          cat > wg0.conf <<EOF
          [Interface]
          PrivateKey = $WG_PRIVATE_KEY
          Address = 10.8.0.2/32

          [Peer]
          PublicKey = $WG_SERVER_PUBKEY
          Endpoint = bastion.example.com:51820
          AllowedIPs = 10.8.0.1/32
          PersistentKeepalive = 25
          EOF
          sudo install -m 600 wg0.conf /etc/wireguard/wg0.conf
          sudo wg-quick up wg0

      - name: Deploy over the overlay
        run: ssh deploy@10.8.0.1 './deploy.sh'

Each runner peer needs its own key and overlay address, so two concurrent jobs with the same key will knock each other off. A concurrency group on the deploy job avoids that. You also run, patch, and monitor the bastion, and it is a single point of failure unless you build a second one.

A static IP proxy

A proxy service gives you fixed IPs without running a bastion. HTTP clients follow HTTPS_PROXY set on the step, which the GitHub Actions integration guide walks through for curl, Python, Go, and Node. SSH does not read HTTPS_PROXY. It needs a ProxyCommand that speaks SOCKS5. Ncat can send SOCKS5 credentials with --proxy-auth, per the Ncat proxy guide. OpenBSD nc cannot.

Workflow step (any SOCKS5 provider)
      - name: Deploy over SSH through the proxy
        env:
          PROXY_USER: ${{ secrets.PROXY_USER }}
          PROXY_PASS: ${{ secrets.PROXY_PASS }}
          SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
          KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
        run: |
          sudo apt-get update -q && sudo apt-get install -y ncat
          install -m 700 -d ~/.ssh
          printf '%s\n' "$SSH_KEY" > ~/.ssh/deploy && chmod 600 ~/.ssh/deploy
          printf '%s\n' "$KNOWN_HOSTS" > ~/.ssh/known_hosts
          ssh -i ~/.ssh/deploy -o StrictHostKeyChecking=yes \
            -o ProxyCommand='ncat --proxy proxy.example.net:1080 --proxy-type socks5 --proxy-auth "$PROXY_USER:$PROXY_PASS" %h %p' \
            deploy@server.example.com './deploy.sh'

Pin the server's host key from a secret and set StrictHostKeyChecking=yes. A fresh runner has an empty known_hosts, and accepting whatever key appears defeats SSH's own protection. With a ProxyCommand, SSH checks the key against the real hostname, so no alias is needed. SSH stays encrypted end to end, and the proxy sees only the destination and byte counts. TLS passthrough and zero-knowledge proxies explains what such a proxy can observe.

Lock down who can use the fixed address

Every option above turns some address into a trusted one. Whoever can run a workflow that reaches that address can now talk to your server. Treat the route as a credential.

  • Put the deploy job in a GitHub environment with required reviewers and a deployment branch rule. Per Managing environments, a job cannot read environment secrets until those rules pass. On private repositories, environments need a paid plan such as GitHub Team or Pro.
  • Keep proxy, WireGuard, and SSH secrets as environment secrets, not repository secrets. Workflows from forks do not receive secrets other than GITHUB_TOKEN, per Using secrets. Never undo that with pull_request_target and a checkout of the fork's code.
  • Restrict the route itself where you can. A WireGuard peer's AllowedIPs on the bastion, a firewall rule that permits only port 22, or a proxy token limited to one host all shrink what a stolen secret buys.
  • Log at the server. Record source IP, key fingerprint, and time for each deploy, so you can tell a CI deploy from anything else using the same address.

Doing this with Fixedmark

Fixedmark is a static IP proxy, so it fits the last family. It is in early access, and the prices here are planned launch prices from pricing. On Pro and higher, your app gets a dedicated pair of IPv4 addresses that no other customer uses. The server, database, or partner allowlists both once. Standard hosted runners stay as they are, on any GitHub plan.

  • HTTP deploys and API calls use the https:// proxy URL on port 443, set as HTTPS_PROXY on the step that needs it. The integration guide has the YAML.
  • SSH, SFTP, and databases go through the fm tunnel CLI. It reads credentials from FIXEDMARK_SOCKS_URL and always connects over TLS on port 1443, so the token is never sent in cleartext. See the CLI reference.
  • A credential can carry a destination allowlist, such as deploy.example.com on port 22 only, on plans that include allowlists. A leaked CI token then reaches nothing else.
  • Connection logs record the destination, bytes, result, and which IP of the pair each connection used. Payloads are never stored.
SSH deploy through fm tunnel
      - name: Deploy over SSH from the Fixedmark pair
        env:
          FIXEDMARK_SOCKS_URL: ${{ secrets.FIXEDMARK_SOCKS_URL }}
        run: |
          # Write the SSH key and known_hosts as in the step above.
          fm tunnel 2222:server.example.com:22 &
          for i in $(seq 1 20); do
            (echo > /dev/tcp/127.0.0.1/2222) 2>/dev/null && break
            sleep 0.5
          done
          ssh -p 2222 -o HostKeyAlias=server.example.com \
            -o StrictHostKeyChecking=yes \
            deploy@127.0.0.1 './deploy.sh'

HostKeyAlias makes SSH check the key it has pinned for server.example.com, even though it dials 127.0.0.1. To confirm the egress address, run curl against https://fixedmark.com/api/ip through the proxy in the same step, as verifying your egress IP shows. Why one fixed address is not enough on its own is covered in static IP pairs and failover.

Sources

Checked November 2026. Confirm current details on the vendor's site before you decide. Prices and limits change.

Blog

Frequently asked questions

Do GitHub Actions runners have a static IP?

Standard GitHub-hosted runners do not. Each job gets an address from large shared ranges that change weekly. Larger runners can get static IP ranges, but only for organizations on GitHub Enterprise Cloud, and only on Linux and Windows.

Can I allowlist the GitHub Actions IP ranges from the meta API?

GitHub recommends against it. The `actions` key lists thousands of ranges used by every workflow on GitHub, so anyone who can run a workflow could reach your server. Use a temporary rule, a fixed-IP runner, or a tunnel or proxy for the deploy step.

Is it safe to add the runner's IP to my firewall during the job?

It can be, if the rule is scoped to one port and one /32, removed in an `always()` step, and swept by a scheduled job in case cleanup never runs. The role that edits the firewall becomes sensitive, so restrict who can trigger the workflow.

What happens to larger runner static IPs if I stop using them?

GitHub removes the ranges of a runner that is unused for more than 90 days, and they cannot be recovered. Any allowlist built on them would need new ranges.

Why does my SSH deploy ignore HTTPS_PROXY?

OpenSSH does not read proxy environment variables. Use a `ProxyCommand` with a SOCKS5-capable tool such as Ncat, or forward a local port through a tunnel and connect to it with `HostKeyAlias` set to the real hostname.

Make it fixed.

Fixedmark is in early access. Join the list to get dedicated static IPs when your region opens.