Interview Prep/Jenkins/Credentials & security

A security review finds AWS access keys stored as Jenkins credentials used by 60 pipelines. The goal is no long-lived keys. Plan it.

AdvancedScenarioCredentials & security
Answer

Situation read → Replace static keys with workload identity or short-lived tokens.

What I'd do →

  1. For Kubernetes agents on EKS, use IRSA or EKS Pod Identity: deploy pod templates with a service account mapped to an IAM role; the AWS SDK picks up credentials automatically.
  2. For agents outside AWS, use OIDC federation (e.g. the controller issues tokens via a plugin) or Vault's AWS secrets engine issuing 15-minute credentials per build.
  3. Migrate pipelines folder by folder, then delete the keys and deactivate them in IAM.
  4. Scope roles per environment; prod role only usable by the prod deploy template.

Why → Short-lived credentials limit blast radius when a build or log leaks them.

Interview tip → Name IRSA/Pod Identity explicitly; it is the expected answer for EKS.

All Jenkins questions Roadmap: Jenkins

More on Credentials & security