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 questions
Answer options
A: Users who have the Triage role within the repository
B: Users who have Read permissions within the repository
C: Users who have Write access to the repository Correct answer
D: Users who have the security manager role within the repository
Correct Answer:
C. Users who have Write access to the repository
Explanation

Fixing 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.

Why Incorrect

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. ---

References

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.

Source: https://docs.github.com/en/code-security/code-scanning/managing-code-scanning-alerts/managing-code-scanning-alerts-for-your-repository#fixing-alerts

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.

Source: https://docs.github.com/en/code-security/code-scanning/managing-code-scanning-alerts/managing-code-scanning-alerts-for-your-repository#permissions-for-dismissing-alerts

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.

Source: https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization#about-the-security-manager-role

Scroll to Top