GH-500 practice question 2 of 15
– [Use Code Scanning with CodeQL] Why should you dismiss a code scanning alert?
Full set: 75 questionsYou should dismiss a code scanning alert when you determine that the finding does not represent a security risk that needs to be fixed. A common and valid reason for dismissal is when the identified vulnerability exists in code that is exclusively used for testing purposes and is not part of the production application. Dismissing the alert in this context correctly triages the finding as a non-actionable item, allowing the team to focus on genuine threats in production code.
A. If you fix the code, the alert will be automatically closed on the next scan of the branch. Manual dismissal is not the correct procedure.
B. Dismissing an existing alert is a reactive measure for a specific finding; it does not proactively prevent developers from introducing new problems.
D. An alert corresponding to a production error signifies a real risk. This type of alert should be prioritized and fixed, not dismissed.
1. GitHub Docs, "Managing code scanning alerts for your repository." This official documentation states, "You can dismiss an alert if you don't think it's a problem... Common reasons for dismissing an alert are that the code is not used in production, or that the alert is a false positive result." This directly supports dismissing alerts for code used only in testing.
2. Microsoft Learn, "Configure and manage code scanning in your repository," Unit: "Manage code scanning alerts." This module, relevant to GitHub administration, explains the process of triaging alerts. It notes that when dismissing an alert, you can select a reason, such as "Used in tests," which confirms this is an intended use case for the dismissal feature.
3. GitHub Docs, "About code scanning alerts." This document clarifies the lifecycle of an alert, explaining that when code is fixed, "the alert is closed" automatically after the branch is rescanned. This confirms that manual dismissal is incorrect for fixed code.
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 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…
- Question 7– [Configure and Use Dependency Management] Which security feature shows a vulnerable dep…
