GITHUB-ADVANCED-SECURITY practice question 7 of 15
– [Configure and Use Code Scanning] Who can fix a code scanning alert on a private repository?
Full set: 75 questionsFixing a code scanning alert requires modifying the source code and committing the changes to the repository. This action is fundamentally tied to the ability to write to the repository. According to GitHub's permission model, only users with 'write' permissions (or higher, such as 'maintain' or 'admin') can push commits to a repository's branches. While other roles can manage the alert itself (e.g., view or dismiss it), they lack the necessary permissions to alter the code and resolve the underlying vulnerability.
A. Users who have the Triage role within the repository: The Triage role allows users to manage alerts (e.g., dismiss them) but does not grant permission to write code, which is necessary for a fix.
B. Users who have Read permissions within the repository: Read permissions only allow for viewing code and alerts. Users with this role cannot modify code, push commits, or manage alerts in any way.
D. Users who have the security manager role within the repository: The security manager role grants permissions to manage security settings and alerts (view, dismiss, reopen), but it does not inherently include write access to the code. ---
1. GitHub Docs, "Managing code scanning alerts for your repository." Under the section "Fixing alerts," the documentation explicitly states: "Anyone with write permissions for a repository can fix a code scanning alert in that repository." This directly supports the correct answer.
2. GitHub Docs, "Repository roles for an organization." This document details the abilities associated with each permission level. It confirms that the 'Write' role is the minimum level required to "Push to the repository's unprotected branches," the essential action for fixing code.
Source: https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization (See the "Permissions for repository roles" table).
3. GitHub Docs, "Permissions for dismissing alerts." This page clarifies that dismissing an alert requires write, maintain, or admin permissions. While the Triage role can also be granted this ability, it is distinct from fixing the code.
4. GitHub Docs, "Managing security managers in your organization." This source defines the scope of the security manager role, highlighting its focus on managing security policies and alerts, not on direct code contribution.
Keep practicing
Take the free GITHUB-ADVANCED-SECURITY practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GITHUB-ADVANCED-SECURITY practice questions
- Question 1– [Use Code Scanning with CodeQL] When using CodeQL, what extension stores query suite de…
- Question 2– [Configure and Use Secret Scanning] What happens when you enable secret scanning on a p…
- Question 3– [Configure and Use Dependency Management] A dependency has a known vulnerability. What …
- Question 4– [Configure and Use Secret Scanning] What is a prerequisite to define a custom pattern f…
- Question 5– [Describe the GHAS Security Features and Functionality] What is a security policy?
- Question 6– [Configure GitHub Advanced Security Tools in GitHub Enterprise] What role is required t…
