Delivering Deploy Jobs to Servers Without Opening a New Inbound Port

The direction a deploy instruction travels and the direction a network connection is opened can differ. How an agent on the production server opens the connection and pulls approved jobs, what belongs in the firewall review sheet, and which steps to record.

John Baek
John Baek
Founder, CollabOps
2 min read

"Do we need to open a port on the production servers?"

When this comes up in a deployment automation kickoff, start by looking at the arrows in the architecture diagram. An arrow drawn as "deploy manager → production server" can mean two things. One is the direction the deploy instruction travels. The other is the direction in which the network connection is first opened. The instruction can flow toward the production server while the production server opens the connection.

The direction of a deploy instruction and the direction of the connection can be separated. If an agent on the production server opens the connection and pulls approved jobs, deployments reach that server without any new inbound port.

If the agent opens the connection, how does a deploy flow?

The agent asks the manager "do I have an approved job?", and the manager answers that request with a job plan. The agent downloads the artifact from a designated repository and submits the result back to the manager. AWS Systems Manager documents the same pattern of the agent initiating the connection, and self-hosted Azure Pipelines agents also wait for work over HTTP requests they start themselves.

Prod server agent         Internal proxy        Deploy manager        Internal artifact repo
      │  ① poll for jobs ──▶ │  ── forward ────▶ │
      │                      │ ◀── job plan ──── │
      │ ◀── poll response ── │
      │  ② request approved version ───────────────────────────────▶ │
      │ ◀───────────────────────────────────────────── artifact ──── │
      │  ③ submit result ──▶ │  ── forward ────▶ │

In this example only the management API goes through the proxy, and the artifact comes from a repository on the same network. The firewall review sheet needs to reflect that difference.

Item to agree onQuestion to answer before go-live
Job polling and result submissionWhich proxy and port does the server connect to, and which manager address does the proxy allow?
Artifact downloadDoes the agent or a relay fetch the file, and which internal repository must it reach?
Certificates and renewalWhich internal CA does the agent trust, and who confirms that polling still works after a certificate rotation?

What should you record during the adoption test?

The record that matters is how far the job got across four steps: last successful connection, approved job received, artifact received, result submitted. The review sheet above doubles as a test scenario. Allow the management API but hold back repository access, and you can reproduce an agent that shows "connected" while never receiving the artifact. If the screen only says "connected", the on-call engineer has to call the network team again just to locate the problem.

What about networks that allow only one-way transfer?

Networks that physically allow only one-way transfer need a separate design. Even an HTTPS connection the agent opens still carries responses back. How these boundaries are defined in closed networks is covered in What Zero Trust means in an air-gapped network. In that environment, draw the approved artifact import procedure and the result retrieval procedure as two separate flows, so security and operations can discuss the same diagram.

  • #deployment
  • #on-prem
  • #security
  • #infrastructure
  • #air-gapped