Skip to content
Tech Interview Prep
Technical interview guide

Secrets Management in Pipelines

Keeping credentials and keys out of source control and pipeline logs, while still letting automation use them.

Read
30 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: GitHub Actions, AWS IAM, Google Cloud IAM, HashiCorp Vault, OWASP, and NIST guidance current 2026-08-31.

Curated: · Written: · Reviewed:

25 questions

MCQ-4A CI job is issued a cloud credential with a 15-minute TTL at 10:00:00. The build log containing that credential is exfiltrated at 10:07:00. The attacker first uses the credential at 10:12:00, and the security team revokes it at 10:50:00. How many minutes after the exfiltration did the credential remain valid?
MCQ-12A service reads a database password at startup. CI builds the image, pushes it to a registry that every engineer and every CI job can pull from, and Kubernetes runs it. Which arrangement should deliver the password?
MCQ-8A batch job on a shared build host pulls a database password from Vault, uses it, and exits. A different, unprivileged user on the same host runs `ps aux` while the job is running and reads the password in plaintext. Which injection route produced that exposure?
MCQ-9A payments service writes JSON request bodies to a log store. Before each line is written, a regex replaces any run of 13–19 digits with `[REDACTED]`; it runs on every write path and its unit tests pass. A review of that store still finds live PANs. Which property of the masker explains why it cannot be the confidentiality boundary for cardholder data?
MCQ-1A GitHub Actions workflow in `acme/api` assumes `arn:aws:iam::111122223333:role/gha-deploy` through the repository's OIDC provider. The role's trust policy has a single condition: `StringEquals` on `token.actions.githubusercontent.com:sub` = `repo:acme/api:ref:refs/heads/main`. A release engineer triggers the workflow with `workflow_dispatch` while `release/2.1` is checked out, and the `configure-aws-credentials` step fails with `AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity`. What is the cause?
MCQ-23Deploys from GitHub Actions to AWS assume `arn:aws:iam::111122223333:role/deploy-prod` through OIDC. The role's trust policy allows `token.actions.githubusercontent.com:sub` equal to `repo:acme/web:ref:refs/heads/main`. After the deploy job was moved under a GitHub Environment named `production`, still triggered by pushes to `main`, every run fails with `AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity`. What explains the failure?
MCQ-2A GitHub Actions workflow in `acme/payments` assumes an AWS role through OIDC. The role's trust policy has `StringEquals` on `token.actions.githubusercontent.com:aud` = `sts.amazonaws.com` and `StringLike` on `token.actions.githubusercontent.com:sub` = `repo:acme/payments:*`. The role can delete objects in the production bucket, and CloudTrail shows 9 of the last 11 `AssumeRoleWithWebIdentity` calls came from `refs/heads/feature/*` branches. The deploy job runs only on pushes to `main`. Which change to the trust policy closes this exposure?
MCQ-3A platform team's AWS role `deploy-prod` trusts GitHub's OIDC provider with the condition `token.actions.githubusercontent.com:sub` `StringLike` `repo:acme/*:*`. The org has 340 repositories; only `acme/deploy-service` deploys to production, and only from `main`. In `deploy-service` any contributor can push a branch, but `main` is protected. CloudTrail shows `AssumeRoleWithWebIdentity` succeeding for `acme/docs-site`, where any engineer can merge to `main` unreviewed. Which change leaves only the `main`-branch deploy of `deploy-service` able to assume the role?
MCQ-11A repo labels fork PRs with a bot. `label.yml` triggers on `pull_request_target`, checks out `github.event.pull_request.head.sha`, runs `npm ci && npm test`, then calls the labels API with `secrets.BOT_TOKEN`. A fork PR added a `postinstall` script that POSTed `process.env` to an external host, and `BOT_TOKEN` showed up in the attacker's logs. Which change removes the exposure while the bot still labels fork PRs?
MCQ-22A nightly GitHub Actions workflow runs a third-party action pinned to a commit SHA: `uses: acme/deploy@a1b2c3d`. The team reviewed that commit. Its `action.yml` runs `curl -sSL https://acme.example/install.sh | bash`, and the job sets `DEPLOY_TOKEN` in the environment. On Tuesday the maintainer edits `install.sh` on acme.example to also POST `$DEPLOY_TOKEN` to an external host. The workflow's next run still uses `acme/deploy@a1b2c3d`. What happens on that run?
MCQ-24A release pipeline runs `build` (PR branches, no secrets) and `publish` (holds the npm token and signing key) on the same self-hosted runner. `publish` does `cd $WORKSPACE && npm publish`. A PR branch added a `prepublishOnly` script that read the signing key and posted it to an external host; in the last 50 releases, 3 published tarballs also differed from the ones the PR job tested. The team cannot add runners. Which change actually closes the untrusted-to-trusted boundary?
MCQ-13A self-hosted pool of 8 long-lived VMs runs privileged deploy jobs. Every job runs as the same `ci` user with a persistent `$HOME` and a shared build-cache directory. A fork PR's job wrote a `~/.ssh/config` entry and a poisoned cache object; the next job on that VM used both. Which change removes the mechanism that carried the residue into the next job?
MCQ-14A self-hosted CI runner executes untrusted fork PRs in a container started with `--read-only --network=none`, and the host's `/var/run/docker.sock` is bind-mounted into that container. The runner's registry push token exists only in `/home/runner/.docker/config.json` on the host (mode 0600, owned by uid 1001). A fork PR's build script runs `docker run --rm -v /:/host alpine cat /host/home/runner/.docker/config.json`. What does the job obtain?
MCQ-5A pipeline runs a build job on runner `build-01` with token `build-tok` (policy: `registry:push` on repo `app`, TTL 15 min) and a deploy job on runner `deploy-01` with token `deploy-tok` (policy: `k8s:set-image` on namespace `prod`, TTL 15 min). The deploy job deploys `app@sha256:9f2c...`. A malicious transitive dependency in the build job reads `build-tok` from the environment at t=0 and, at t=30 s, pushes a new tag `app:evil` to the registry. What does the attacker's push at t=30 s achieve?
MCQ-7A CI orchestrator fetches a dynamic database credential from Vault and must hand it to a build job on a shared runner. The credential must not be retrievable a second time, and the window in which a leaked token still works must be as short as possible. What should the orchestrator do?
MCQ-6A payments service reads from PostgreSQL. Its database password is a static Kubernetes Secret rotated by hand every 90 days. The team enables Vault's database secrets engine with default_ttl=1h and max_ttl=24h, and changes the app to fetch credentials once at process start and hold them in memory. Pods run for days without restarting. What happens to the service's database access?
MCQ-20During an incident review, an engineer notes that the team rotated every database password in Vault, yet the attacker still read production data for three weeks. The Vault token each pod used was mounted from a Kubernetes Secret that was never rotated. Which statement names the gap?
MCQ-21A service runs 200 pods, each holding a database credential from the secret store. Credentials have a 30-minute TTL and each pod renews at 20 minutes. The store goes down at 08:45 and returns at 09:50. Every pod's current credential was issued at 08:30. At 08:50 a deployment adds 20 pods; their init container fetches a credential from the store and exits non-zero if it cannot. Which pods can authenticate to the database at 09:20?
MCQ-18A service authenticates with workload tokens that have a 60-second TTL. A background goroutine starts a refresh 45 seconds after each token is issued. The refresh call used to take 2 seconds; under a new load profile it takes 20 seconds. Request handlers use the current token to call an API that returns 401 for expired tokens. Monitoring shows a burst of 401s roughly every minute. Which explanation fits the 401 bursts?
MCQ-17An API runs 12 pods, each with a 20-connection pool (minimumIdle = 20, maxLifetime = 30 min). Every pod reads secret/pg/app (fields username and password) once at startup, builds the DSN, and reuses that DSN for every connection it opens afterwards. Rotation creates a new login role with the same grants and writes its username and password to the same path: app_g7 replaces app_g6, which was created 9 days ago and keeps its old password. Pods are replaced only by an ad-hoc deploy or a node recycle; no pod survives a node recycle, which happens every 14 days, and no deploy is scheduled. When is app_g6 safe to drop?
MCQ-19A CI runner is compromised partway through a job. Each job in this pipeline receives a short-lived OIDC token, and the pipeline sets the cloud role session name to a value that includes the workflow and job name. The cloud audit log holds 12,400 calls from the last 24 hours, each stamped with the full caller principal ARN and a timestamp. Six workflows in the org assume the same cloud role. Which correlation isolates the calls made with the compromised job's token?
MCQ-25A CI job uses a cloud deploy token with a 15-minute TTL, issued at 10:00 and expiring at 10:15. The job runs from 10:00 to 10:04. The cloud provider's audit log records every API call made with the token's identity, has no ingestion delay, and is retained for 90 days. At 10:30 the log shows 9 calls, all between 10:00 and 10:04, all from the runner's IP, and no others. What does this evidence establish about the token?
MCQ-10A GitHub Actions job on a private repo runs the AWS CLI with `--debug`. The debug output prints the temporary credentials returned by `sts:AssumeRole` (AccessKeyId, SecretAccessKey and SessionToken) into the job log. The role was assumed with an IAM user's long-lived keys stored as a CI secret. The credentials were issued at 09:02 UTC with `DurationSeconds=3600`; the job ended at 09:04. The org has 340 members, all with read access to Actions logs, and logs are retained for 90 days. It is now 15:00 UTC the same day. What is the correct next action?
MCQ-15A live AWS access key used by 12 services was pushed to a public repo 25 minutes ago; the repo has 8 forks. A replacement key takes about 2 hours to roll out, and the 12 services will fail until it reaches them if the old key stops working. CloudTrail shows no calls from the key yet. What should the team do first?
MCQ-16A developer commits a live AWS access key to `main` at 09:00. At 10:30 the team runs `git filter-repo`, force-pushes `main`, and confirms the key is absent from `git log -p main`. The repository has 60 forks, the leaked commit's SHA was quoted in a public issue, and the CI runner's workspace is retained for 30 days. The key has not been rotated. Where does the key still exist?