Skip to content

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?

  1. ASet both detections to Enabled in the security configuration applied to them
  2. BTurn them on in the Advanced Security global settings under "Additional settings"
  3. CAsk an enterprise owner to set the enterprise's "AI detection in secret scanning" policy to Allowed
  4. 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.

Question 2 · choose 1

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?

  1. AExtended metadata is collected for every alert, independently of validity checks
  2. BExtended metadata can't be enabled while validity checks are disabled
  3. CExtended metadata is collected only for secrets in public repositories
  4. 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.

Question 3 · choose 2

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

  1. AThey are limited to 5,000 alerts per repository, open and closed together
  2. BThey are blocked by push protection by default
  3. CThey don't appear in security overview's summary views, only in its Secret scanning view
  4. DThey are validated with the secret's provider automatically
  5. 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).

Question 4 · choose 1

Where does a repository administrator enable Secret Protection for one repository?

  1. AIn the organization's billing and licensing page
  2. BIn the repository's Insights tab
  3. CIn the repository's Settings, under Advanced Security
  4. 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.

Question 5 · choose 1

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?

  1. AThe full Git history of every branch in the repository
  2. BOnly commits pushed after Secret Protection was enabled
  3. COnly the most recent commit on the default branch
  4. 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.

Question 6 · choose 1

What must happen before secret scanning reports generic secrets such as private keys?

  1. ANothing; generic secrets are always scanned for
  2. BA custom pattern must be written for each key type
  3. CPush protection must be turned off
  4. 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.

Question 7 · choose 1

Can an owner turn off secret scanning for partner patterns on a public repository?

  1. AYes, in the repository's Advanced Security settings
  2. BNo; it can't be changed on public repositories
  3. CYes, by disabling push protection for users
  4. 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.

Practise domain 2 →Practise all domains →