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

Credentials are stored in Jenkins; the security team wants no long-lived cloud keys at all.

AdvancedScenarioJenkins Shared Libraries, Credentials and Security
Answer

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

What I'd do →

  1. Run agents on EC2/EKS with an IAM role (instance profile or IRSA / Pod Identity); the AWS SDK then uses temporary credentials.
  2. For cross-account access use sts assume-role with a limited session duration.
  3. Remove access-key credentials from the credentials store and rotate the old keys out.
  4. Where a secret must exist, source it from Vault or AWS Secrets Manager at runtime.

Why → No stored keys means nothing to leak, and permissions are scoped to the agent identity.

Interview tip → Say "workload identity" and mention least privilege per pipeline type.

All CI/CD questions

More on Jenkins Shared Libraries, Credentials and Security