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 →
- 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.
- 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.
- Migrate pipelines folder by folder, then delete the keys and deactivate them in IAM.
- 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.
More on Credentials & security
What credential types does Jenkins support out of the box?BeginnerWhat is the difference between Global and System credential scope?IntermediateHow do folder-scoped credentials help multi-team controllers?IntermediateHow does Jenkins mask secrets in logs and what are its limits?AdvancedWhat authorization strategies are available?IntermediateWhat are the key permissions to understand in matrix auth?Intermediate