Interview Prep/Jenkins/Credentials & security

The security team wants all build agents to have no internet access except to approved registries. How do you implement it?

AdvancedScenarioCredentials & security
Answer

Situation read → Egress control for CI.

What I'd do →

  1. Kubernetes NetworkPolicy in the agents namespace: default-deny egress, allow DNS, the Jenkins service, Nexus/Artifactory, the container registry and SonarQube.
  2. Route all dependency downloads through the repository manager (which has internet access and scans packages).
  3. For cloud APIs, use VPC endpoints.
  4. Monitor denied flows to find breakage.

Why → Blocks exfiltration and dependency confusion attacks while keeping builds working.

Interview tip → Mention that this also improves reproducibility because everything is proxied.

All Jenkins questions Roadmap: Jenkins

More on Credentials & security