Question 110
While investigating a reproducible simulation for fictional Windward Maritime, the team reports: A CI experiment stages a temporary secret-test file but needs to keep it locally while excluding it from the next commit. Which control best prevents this particular failure from recurring?
Explanation
Correct Answer
Add secret scanning and explicit staged-diff review before committing automation changes. This prevents the recurrence because the Git index is the staging area and can be changed independently of the working tree by suitable reset modes. A matching immediate correction is: Unstage the unintended file with an index-only reset or equivalent restore-staged operation, leaving the worktree intact.
Incorrect Answers
The suggested review tracks a different technical risk: cI runners start from controlled environments; undeclared local dependencies cannot be assumed present remotely. Here the sustained control must address: the Git index is the staging area and can be changed independently of the working tree by suitable reset modes. Choose “Add secret scanning and explicit staged-diff review before committing automation changes”.
This routine guards against another mechanism: a deployment stage should enforce release scope and approval, not merely execute a command with unrestricted infrastructure access. The recurring exposure in the current case is: the Git index is the staging area and can be changed independently of the working tree by suitable reset modes. The matching preventive check is “Add secret scanning and explicit staged-diff review before committing automation changes”.
The suggested review tracks a different technical risk: deployment command success is not the same as verified service success; operational checks must follow state changes. Here the sustained control must address: the Git index is the staging area and can be changed independently of the working tree by suitable reset modes. Choose “Add secret scanning and explicit staged-diff review before committing automation changes”.