Interview › Security & DevSecOps
How do you secure pipeline credentials and avoid long-lived secrets? [Intermediate]
Answer
I secure pipeline credentials by avoiding long-lived secrets, using OIDC or workload identity, scoping credentials to repository and environment, storing unavoidable secrets in a managed secret store, masking logs, rotating regularly, and auditing access.
Technical explanation
Static cloud keys in CI are high risk because they can be leaked from logs, forks, compromised runners, or repository settings.
OIDC allows the CI system to exchange a short-lived identity token for cloud credentials with policy conditions.
Self-hosted runners need additional hardening: isolation, patching, ephemeral runners for untrusted code, and restricted network access.
Hands-on example
Hands-on: configure GitHub Actions OIDC to assume an AWS IAM role only when repo=org/app, branch=main, workflow=deploy.yml, and environment=prod. Remove stored AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from repository secrets.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Security & DevSecOps interview questions
- What is workload identity, and how does it remove static credentials? [Intermediate]
- What is OPA, and what is the Rego language used for? [Intermediate]
- How do you apply least privilege to service-to-service communication (e.g., with Istio mTLS)? [Intermediate]
- What is secrets management, and how does HashiCorp Vault work at a high level? [Intermediate]
- What is vulnerability management as a lifecycle (discover, prioritise, remediate, verify)? [Intermediate]
- What is encryption at rest versus in transit, and how do you ensure both? [Advanced]
- How do you reduce the noise of thousands of vulnerability findings? [Intermediate]
- What is the difference between symmetric and asymmetric encryption? [Advanced]