Domain 8/8.2 Identify and apply security controls in software development ecosystems
1. An attacker opens a pull request from a fork that modifies the CI workflow to exfiltrate secrets during the automated build. Teodulfo, the open-source maintainer, responds. Which control MOST directly prevents this?
- ARotate secrets every 90 days
- BPin all actions to commit hashes
- CNo secrets for fork runs
- DRun SAST on the PR
Show the answer
Correct answer: C. Treat fork pull requests as untrusted code.
- A. Incorrect. Rotation shortens how long a stolen secret works, but the malicious workflow still exfiltrates the current secrets on its first run.
- B. Incorrect. Pinning protects against tampered third-party actions, but here the attacker edits the workflow itself in the pull request.
- C. Correct. Withhold secrets from untrusted fork workflows and require maintainer approval.
- D. Incorrect. SAST looks for flaws in application code; it does not stop a modified workflow from running with access to repository secrets.