GH-500 domain - 18% of the exam

Configure and use Secret Protection

Configure and use Secret Protection is 18% of the GH-500 exam. These are the objectives it covers, each with practice questions, with every answer explained.

The domain in numbers

52
Practice questions
5
Objectives
31
Medium
21
Hard

Where people go wrong

  • Treating a dry run as live detection

    The wrong answers have a dry run opening alerts, blocking pushes, or creating pre-resolved alerts, or have push protection switch on while the dry run is in progress. A dry run only returns a sample of matches to the pattern's author and raises no alerts, so developers see nothing. The pattern stays unpublished until the author publishes it, and only then can push protection be enabled for that pattern so that matching pushes are blocked.

    See it in a sample question
  • Limiting push protection to the latest commit or the default branch

    The wrong answers shrink what push protection inspects: only the tip commit, only the default branch, or only command-line pushes. It evaluates every commit in the pushed set on any branch, so a key added in the third commit still blocks the push after a later commit deletes it, and that commit must be rewritten. It also intercepts commits made in the web editor. Secret scanning alerting separately covers content already in the repository.

    See it in a sample question
  • Treating alert resolution or deletion as remediation

    The wrong answers tidy the record and leave the credential live: deleting the key in a new commit, resolving the alert, rewriting history first, or disabling detection. None of these stops the exposed value authenticating. Revoking or rotating the credential at the provider comes first, because a copy may already exist. Resolving the alert as revoked only records the status, and the old value stays in commit history unless history is rewritten, which is an optional later step.

    See it in a sample question
  • Treating the bypass list as general alert access

    The wrong answers read delegated bypass as wider or stricter than it is. It does not remove bypass outright: a contributor who is not on the bypass list can no longer self-approve and must send a request that a list member approves or denies. Repository administrator status does not place anyone on the list or override it. Membership only decides those requests, so it grants no right to view or dismiss secret scanning alerts, which needs a role with alert management permission.

    See it in a sample question
  • Assuming a setting reaches repositories it was not applied to

    The wrong answers stretch a setting past the scope it was defined at. Turning secret scanning on in one repository changes only that repository and never becomes the organisation default, and the audit log has no toggle that enables it. A repository-level custom pattern stays in its repository, a template repository passes no patterns on, and an organisation-scoped pattern does not reach sibling organisations. An enterprise-scoped pattern is the single definition that reaches every organisation in the enterprise.

    See it in a sample question

Objectives in this domain

What to study

The official documents this domain's practice questions cite most.

Sample questions from this domain

Free sampleConfigure and use Secret Protectionhard

A security manager has just authored a new custom secret scanning pattern at the organisation level and wants to understand the impact before any developer sees an alert. They run the pattern as a dry run across the selected repositories. What does the dry run produce, and what state is the pattern in afterwards?

  • AIt scans the default branch only and immediately opens alerts there, while leaving non-default branches untouched until the pattern is formally published.
  • BIt returns a sample of matches for the author to review without creating alerts, and the pattern remains unpublished until the author explicitly publishes it. Correct
  • CIt publishes the pattern in a monitor-only mode that records matches silently for thirty days before alerts and push protection switch on automatically.
  • DIt creates alerts but marks every one as resolved as a false positive, so the author can reopen the genuine matches and discard the noise.
Explain that a custom pattern dry run surfaces matches for review without raising alerts and leaves the pattern unpublished until the author publishes it. Dry runs exist so that an author can measure a pattern's precision against real repository content before it affects developers. By design they produce a reviewable result set rather than alerts, and the pattern stays in draft so the regular expression can be tuned and re-tested until publishing turns it into a live detector.

Why A is wrong: A dry run deliberately creates no alerts at all, so describing it as opening alerts on the default branch contradicts its purpose. The default-versus-other-branch detail is a plausible distraction but the premise that alerts appear is wrong.

Why B is correct: A dry run evaluates the pattern against repository contents and shows the author a set of results so they can judge precision, but it raises no alerts and notifies no one. The pattern stays in a draft, unpublished state, letting the author refine the expression before publishing creates real alerts.

Why C is wrong: There is no timed monitor-only mode that auto-promotes a custom pattern after a fixed window. This invents a lifecycle that does not exist; publishing and any push protection are explicit author decisions, not scheduled transitions.

Why D is wrong: A dry run does not create alerts in any state, resolved or otherwise, so there is nothing to reopen. The idea of pre-resolved alerts sounds like a tidy review workflow but misrepresents what a dry run does.

Free sampleConfigure and use Secret Protectionhard

A repository has push protection enabled. Instead of using git from the command line, a developer edits a configuration file directly in the GitHub web editor, pastes in a recognised cloud provider key, and clicks the button to commit the change to a new branch. They expect the commit to save and an alert to appear later, the same as a command-line push that completes. What behaviour should they expect in the web editor?

  • AThe commit saves immediately and a secret scanning alert is raised afterwards, because push protection applies only to pushes made over git and cannot intercept edits made in the web editor.
  • BThe web editor strips the recognised key from the file automatically and commits the remaining content, leaving the developer to re-add the value through a secrets store.
  • CGitHub blocks the commit in the editor and shows a dialog identifying the secret and its location, so the developer must remove the secret or, if permitted, choose to bypass before the commit can be saved. Correct
  • DThe commit is queued and the developer receives an email asking them to confirm the secret before the change is applied to the new branch.
Recognise that push protection blocks secrets committed through the GitHub web editor, file uploads, and the REST API, not only command-line pushes. Push protection operates at the point a commit is created across multiple entry points including the web editor; when a supported secret is detected it blocks the commit and surfaces a dialog locating the secret, requiring removal or a permitted bypass before the change can be saved.

Why A is wrong: Tempting because push protection is often described in terms of git pushes, but it also intercepts commits created through the web interface, file uploads, and the REST API, so the web editor commit is not exempt.

Why B is wrong: Tempting because automatic redaction sounds protective, but push protection does not silently alter the developer's file; it blocks the commit and shows the location of the secret so the developer can decide how to proceed.

Why C is correct: Correct because push protection intercepts commits created in the web UI just as it does command-line pushes; the editor presents a dialog with the secret's location and underlines it, and the developer must remove it or, where bypass is allowed, supply a bypass reason before committing.

Why D is wrong: Tempting because an out-of-band confirmation step resembles other approval flows, but push protection blocks the commit synchronously in the editor rather than queuing it and sending an email confirmation request.

Free sampleConfigure and use Secret Protectionmedium

A secret scanning alert fired for a live database password committed to a private repository two months ago. The security team rotates the credential with the database administrator so the leaked value can no longer authenticate, and they resolve the alert as revoked. A developer asks whether rotating and resolving the alert has also removed the old password from the repository's git history. What is the accurate position?

  • ARotation neutralises the leaked credential, but the old value remains in the commit history until the team rewrites history or accepts that the now-useless value stays recorded. Correct
  • BResolving the alert as revoked removes the secret from the affected commits automatically, because resolution triggers a history rewrite of every blob containing the value.
  • CRotation is unnecessary once the alert is resolved as revoked, because marking the alert closed signals secret scanning to stop treating the committed value as sensitive everywhere it appears.
  • DThe old value is purged from history as soon as the credential is rotated, because the provider notifies GitHub to scrub every commit that contained the previous secret.
Understand that rotating a leaked credential neutralises the risk while the exposed value remains in git history unless history is rewritten. Rotation invalidates the credential at the provider so the leaked value cannot authenticate, but the alert status and the immutable commit history are separate concerns; closing an alert never edits commits, so the old string persists in history until the team rewrites it.

Why A is correct: Rotation is the action that actually removes the risk by making the exposed value worthless; the alert status and the contents of historic commits are independent, so the old string persists in history unless deliberately purged.

Why B is wrong: This is tempting because resolution feels like a clean-up action, but resolving an alert only changes the alert's status in the Security tab; GitHub never rewrites repository history on the team's behalf.

Why C is wrong: This inverts the priority: resolving an alert is bookkeeping, whereas rotation is the substantive remediation; closing the alert does nothing to the credential's validity at the provider.

Why D is wrong: Providers may invalidate the credential on their side, but neither the provider nor GitHub edits the repository's commit history; the exposed string stays in the blobs that recorded it.

Free sampleConfigure and use Secret Protectionmedium

A security architect distinguishes two separate access surfaces in secret scanning: who may grant a push protection bypass, and who may dismiss an already-created secret scanning alert. A repository administrator assumes that being on the delegated bypass list automatically lets a person dismiss alerts as well. How should the architect correct this understanding?

  • ABoth actions are controlled by the same bypass list, so adding someone as a bypasser also grants them the ability to dismiss any secret scanning alert in the repository.
  • BBeing on the bypass list only authorises approving push protection bypass requests; dismissing existing alerts requires a role with alert management permission, such as security manager or write access to the repository. Correct
  • CNeither action can be delegated; only organisation owners may approve a bypass or dismiss a secret scanning alert, so both surfaces are reserved for owners and cannot be assigned to a team.
  • DDismissing an alert is open to anyone with read access, while approving a bypass is the restricted action, so the administrator has the two surfaces reversed.
Separate the delegated bypass approval surface from the alert dismissal surface, recognising each requires its own permission rather than one implying the other. Push protection bypass approval is governed by the delegated bypass list, whereas dismissing a created secret scanning alert is an alert management action tied to roles like security manager or repository write, so membership in one does not grant the other.

Why A is wrong: Tempting because both concern secret protection, but the bypass list governs only push protection approvals and does not confer alert dismissal rights.

Why B is correct: Correct: the two surfaces are independent, so bypass-list membership governs push protection approvals while alert dismissal needs a role that confers alert management on that repository.

Why C is wrong: Tempting because owners can do both, but delegated bypass and the security manager role exist precisely so these actions can be delegated to non-owners.

Why D is wrong: Tempting because it inverts the claim, but read access alone cannot dismiss alerts; dismissal needs alert management permission, so the correction is not simply a reversal.

Free sampleConfigure and use Secret Protectionmedium

An organisation owner has purchased "Secret Protection" and wants every repository created in the organisation from now on to have secret scanning switched on automatically, without an administrator visiting each new repository to enable it. Which organisation-level configuration achieves this for future repositories?

  • AManually enabling secret scanning in each repository's settings, which GitHub then propagates as the organisation default for any later repository.
  • BAdding secret scanning to a branch protection rule on the default branch, which forces the feature on for every repository that adopts the rule.
  • CApplying a security configuration that enables secret scanning and setting it to automatically apply to newly created repositories in the organisation. Correct
  • DEnabling the "automatically enable for new repositories" toggle in the organisation audit log so each creation event activates the feature.
Use a security configuration set to apply to new repositories so that secret scanning is enabled automatically across the organisation. Security configurations let an organisation define a reusable set of security feature settings, including "secret scanning", and choose to apply them automatically to repositories created later. This is why a configuration, rather than a per-repository toggle, a branch protection rule, or the audit log, is the correct way to default the feature on for future repositories.

Why A is wrong: Enabling a feature in one repository changes only that repository; GitHub does not promote a single repository's toggle into an organisation-wide default. This option confuses a per-repository action with an organisation policy.

Why B is wrong: Branch protection rules govern merges, reviews, and status checks on branches, not whether a security feature such as secret scanning is enabled. This conflates branch-level merge controls with feature enablement.

Why C is correct: A security configuration bundles feature settings such as secret scanning and can be set to apply automatically to new repositories, so each future repository inherits the enabled state without manual work. This is the intended organisation-level mechanism.

Why D is wrong: The audit log only records events and offers no toggle to enable features on creation. It is tempting because it is an organisation-wide surface, but it cannot apply security settings to repositories.

Other domains in this exam

See also the GH-500 cert hub, the study guide, and the cheat sheet.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.