GH-500 practice question 11 of 15
– [Configure and Use Secret Scanning] What is the first step you should take to fix an alert in secret scanning?
Full set: 75 questionsWhen a secret scanning alert is triggered for a valid secret, the secret must be considered compromised. The immediate and most critical first step is to revoke or rotate the credential to prevent its malicious use. This action invalidates the exposed secret, mitigating the immediate security risk. After the secret has been revoked, you should then proceed to remove it from the repository's commit history and update your code with a new, securely stored secret.
A. Archiving a repository makes it read-only but does not remove the compromised secret from the commit history, leaving it exposed.
B. Updating dependencies is the correct action for Dependabot alerts regarding vulnerable packages, not for secret scanning alerts about exposed credentials.
D. Removing the secret in a new commit is insufficient because the secret remains accessible in the repository's previous commit history.
1. GitHub Docs, "Managing alerts from secret scanning." This official documentation outlines the remediation process. It states, "Once a secret is committed to a repository, you should consider the secret compromised... For all other secrets, first verify that the secret committed to GitHub is valid. If it is, create a new secret, update any services that use the old secret, and then delete the old secret." This process is functionally equivalent to revoking the secret. (Source: GitHub Docs > Code security > Secret scanning > Managing alerts from secret scanning).
Keep practicing
Take the free GH-500 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GH-500 practice questions
- Question 1– [Configure and Use Secret Scanning] Secret scanning will scan:
- Question 2– [Use Code Scanning with CodeQL] Why should you dismiss a code scanning alert?
- Question 3– [Configure and Use Secret Scanning] A secret scanning alert should be closed as "used i…
- Question 4– [Configure and Use Dependency Management] Which of the following formats are used to de…
- Question 5– [Configure GitHub Actions Workflows] As a repository owner, you do not want to run a Gi…
- Question 6– [Describe GitHub Advanced Security Best Practices] Which of the following benefits do c…
