Interview Prep/CI/CD/Jenkins Pipelines and Agents

Developers keep adding ad-hoc `sh 'curl ... | bash'` steps to the pipeline. How do you govern this?

IntermediateScenarioJenkins Pipelines and Agents
Answer

Situation read → Unreviewed code runs with CI privileges.

What I'd do →

  1. Require PR review with CODEOWNERS on Jenkinsfile and the shared library.
  2. Expose approved capabilities as shared-library steps and pre-built agent images.
  3. Block outbound internet from agents except through the artifact proxy.
  4. Scan scripts in CI with shellcheck and a policy check on forbidden patterns.

Why → The pipeline is a privileged execution environment, so it needs the same controls as production code.

Interview tip → Network egress control is the control that actually holds.

All CI/CD questions

More on Jenkins Pipelines and Agents