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.

Preparing for an interview?

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

← All Security & DevSecOps questions