GH-500 · Domain 2: Configure and use Secret Protection (formerly secret scanning) · 19% of the exam
Task 2.1: Enable and configure Secret Protection
Turning on Secret Protection for a repository or an organization, the optional detections it brings, and how coverage differs for public, private and enterprise repositories.
Study it
Enabling Secret Protection and its optional detections
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the GitHub documentation page that proves it.
Question 1 · choose 1
An organization owner wants scanning for generic patterns and AI-detected secrets turned on in all 400 repositories that already have GitHub Secret Protection, without editing each repository's settings. Which approach does GitHub support?
ASet both detections to Enabled in the security configuration applied to them
BTurn them on in the Advanced Security global settings under "Additional settings"
CAsk an enterprise owner to set the enterprise's "AI detection in secret scanning" policy to Allowed
DAdd both detections to the push protection pattern configuration page
Show the answer and why
ASet both detections to Enabled in the security configuration applied to them
Correct
Organization-level enablement of these detections is done through a custom security configuration applied to the repositories.
BTurn them on in the Advanced Security global settings under "Additional settings"
Incorrect
Global settings don't hold switches for these detections.
CAsk an enterprise owner to set the enterprise's "AI detection in secret scanning" policy to Allowed
Incorrect
That policy decides whether repository admins may configure AI detection; it doesn't turn anything on.
DAdd both detections to the push protection pattern configuration page
Incorrect
That page decides which patterns push protection blocks; it doesn't enable detection.
Both detections are enabled in a repository's Advanced Security settings or, for many repositories, through a custom security configuration with Secret Protection enabled and "Generic patterns" and "Scan for AI-detected secrets" set to Enabled, applied to the repositories. Global settings and enterprise policies control other things.
A security engineer tries to turn on extended metadata checks for a repository, so that alerts show who owns each leaked token. Validity checks are disabled for the same repository because of a past privacy review. What happens?
AExtended metadata is collected for every alert, independently of validity checks
BExtended metadata can't be enabled while validity checks are disabled
CExtended metadata is collected only for secrets in public repositories
DExtended metadata replaces validity checks, so the privacy review no longer applies
Show the answer and why
AExtended metadata is collected for every alert, independently of validity checks
Incorrect
Extended metadata depends on validity checks being enabled.
BExtended metadata can't be enabled while validity checks are disabled
Correct
You can enable extended metadata checks only if validity checks are enabled.
CExtended metadata is collected only for secrets in public repositories
Incorrect
Repository visibility isn't the condition.
DExtended metadata replaces validity checks, so the privacy review no longer applies
Incorrect
It adds information on top of validity checks; it doesn't replace them.
Extended metadata checks add context such as the owner of a detected secret, and they can only be enabled when validity checks are enabled, at repository level or in a security configuration. With validity checks enabled, GitHub may contact the issuing service to check whether a credential is active.
A team turns on generic patterns and AI-detected secrets for a large monorepo. Which two statements describe how these alerts differ from alerts in the default list? (Choose TWO.)
AThey are limited to 5,000 alerts per repository, open and closed together
BThey are blocked by push protection by default
CThey don't appear in security overview's summary views, only in its Secret scanning view
DThey are validated with the secret's provider automatically
EThey show every location where the secret was detected
Show the answer and why
AThey are limited to 5,000 alerts per repository, open and closed together
Correct
The generic list is capped at 5,000 alerts per repository.
BThey are blocked by push protection by default
Incorrect
These detections raise alerts; they aren't part of push protection's default blocking.
CThey don't appear in security overview's summary views, only in its Secret scanning view
Correct
Generic alerts are left out of the summary views.
DThey are validated with the secret's provider automatically
Incorrect
Validity checks apply to supported provider patterns, not to generic finds.
EThey show every location where the secret was detected
Incorrect
Only the first five locations are shown for generic patterns, and only the first for AI-detected secrets.
Alerts for generic patterns and AI-detected secrets can have more false positives. They are limited to 5,000 alerts per repository, are not shown in security overview's summary views, and only the first five detected locations are shown for generic patterns (the first one for AI-detected secrets).
Where does a repository administrator enable Secret Protection for one repository?
AIn the organization's billing and licensing page
BIn the repository's Insights tab
CIn the repository's Settings, under Advanced Security
DIn the .github/dependabot.yml file
Show the answer and why
AIn the organization's billing and licensing page
Incorrect
Billing manages licenses, not repository settings.
BIn the repository's Insights tab
Incorrect
Insights shows graphs such as the dependency graph.
CIn the repository's Settings, under Advanced Security
Correct
The Secret Protection Enable control is on the Advanced Security settings page.
DIn the .github/dependabot.yml file
Incorrect
That file is for Dependabot, not Secret Protection.
In a repository's Settings, in the Security and quality section of the sidebar, click Advanced Security, then click Enable to the right of Secret Protection and confirm.
An administrator enables Secret Protection on a private repository that has ten years of history and many branches. What does secret scanning scan for hardcoded credentials?
AThe full Git history of every branch in the repository
BOnly commits pushed after Secret Protection was enabled
COnly the most recent commit on the default branch
DOnly the files that open pull requests change
Show the answer and why
AThe full Git history of every branch in the repository
Correct
Secret scanning scans the entire Git history on all branches.
BOnly commits pushed after Secret Protection was enabled
Incorrect
Secret scanning also covers what was committed before.
COnly the most recent commit on the default branch
Incorrect
It isn't limited to one branch or one commit.
DOnly the files that open pull requests change
Incorrect
It isn't limited to pull requests.
Secret scanning scans the entire Git history on all branches of a repository for hardcoded credentials such as API keys, passwords and tokens, and GitHub periodically rescans repositories when new secret types are added.
What must happen before secret scanning reports generic secrets such as private keys?
ANothing; generic secrets are always scanned for
BA custom pattern must be written for each key type
CPush protection must be turned off
DScanning for generic patterns must be enabled
Show the answer and why
ANothing; generic secrets are always scanned for
Incorrect
Generic patterns must be enabled first.
BA custom pattern must be written for each key type
Incorrect
Generic patterns are built in.
CPush protection must be turned off
Incorrect
Push protection is unrelated.
DScanning for generic patterns must be enabled
Correct
Generic patterns are an optional detection.
Generic patterns correspond to secrets such as private keys. Scanning for them is an optional detection that must be enabled, for example in a repository's Secret Protection settings.
Can an owner turn off secret scanning for partner patterns on a public repository?
AYes, in the repository's Advanced Security settings
BNo; it can't be changed on public repositories
CYes, by disabling push protection for users
DYes, by adding a secret_scanning.yml file
Show the answer and why
AYes, in the repository's Advanced Security settings
Incorrect
The partner configuration on public repositories can't be changed.
BNo; it can't be changed on public repositories
Correct
GitHub scans public repositories for partner secrets regardless.
CYes, by disabling push protection for users
Incorrect
That is a personal account setting for pushes.
DYes, by adding a secret_scanning.yml file
Incorrect
No repository file changes partner scanning on public repositories.
GitHub scans public repositories and public npm packages for secrets issued by partner providers. You cannot change the configuration of secret scanning for partner patterns on public repositories.