Interview Prep/CI/CD/Jenkins Shared Libraries, Credentials and Security

A Jenkins agent connects to the controller over JNLP/inbound; security flags the open TCP port.

IntermediateScenarioJenkins Shared Libraries, Credentials and Security
Answer

Situation read → Inbound agent port exposed too broadly.

What I'd do →

  1. Use WebSocket agents (-webSocket) so agents connect over the same HTTPS port as the UI, removing a separate TCP port.
  2. Restrict network paths with security groups and require TLS at the ingress.
  3. Use per-agent secrets and rotate them; prefer ephemeral Kubernetes agents that receive secrets automatically.

Why → Fewer open ports and encrypted transport reduce attack surface.

Interview tip → WebSocket mode needs a recent agent and controller; check versions.

All CI/CD questions

More on Jenkins Shared Libraries, Credentials and Security