GH-100 practice question 11 of 15
You discover that a secret (e.g., a token or password) was accidentally committed to a GitHub repository. What is the first step you should take to mitigate the risk?
Full set: 65 questionsThe immediate priority upon discovering an exposed secret is to invalidate it, thereby preventing any potential misuse. Revoking the token or rotating the password renders the compromised credential useless, which is the most critical first step in mitigating the security risk. Once the immediate threat is neutralized by invalidating the secret, you can then proceed with the secondary, but still important, task of removing the sensitive data from the repository's history. This two-step approach ensures that even if someone has already accessed the secret, it can no longer be used for unauthorized access.
A. Contacting GitHub Support is not the first action; you must first invalidate the secret yourself to immediately cut off access.
C. Rewriting history is a cleanup step. It does not invalidate the secret, which could have already been copied from clones or forks.
D. Deleting the repository is an extreme and disruptive measure that does not remove the secret from existing forks or local clones.
1. GitHub Docs, "Removing sensitive data from a repository." This official documentation explicitly states the first step after a secret is committed: "As soon as you commit a secret to a repository, you should consider the secret compromised. You should invalidate the secret...". The document then lists subsequent steps, including removing the file from history. This confirms that invalidation is the primary and initial action. (See the section: "Preventing unauthorized access").
2. GitHub Docs, "About secret scanning." This document outlines how GitHub helps detect secrets and emphasizes the importance of remediation. It states: "If a secret is detected... GitHub notifies the service provider who issued the secret. The service provider validates the credential and then decides whether they should revoke the secret, issue a new secret, or contact you directly." This process underscores that the first action is always to invalidate the credential. (See the section: "What happens when a new secret is detected?").
Keep practicing
Take the free GH-100 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GH-100 practice questions
- Question 1Your organization is implementing team synchronization. Which of the following should you…
- Question 2Why would someone choose to configure a security policy?
- Question 3Which events from the audit log are exposed by the GraphQL API? Each answer presents a co…
- Question 4You are using GitHub-hosted runners and need to securely deploy to an internal system. Th…
- Question 5You have subscribed to GitHub Premium Support, and you need to submit a support ticket. G…
- Question 6What distinguishes Enterprise Managed Users (EMUs) from standard GitHub accounts?
