Join our Newsletter — 33% off our NHI Course
Home› Guides› GitHub Advanced Security Configuration Guide: Rolling Out Security…
Guide Application Security

GitHub Advanced Security Configuration Guide: Rolling Out Security Configurations Across an Organisation

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 18 November 2026 12 min read
On this page

Configuring GitHub Advanced Security at scale means choosing which of the two paid products, Secret Protection and Code Security, each group of repositories gets, expressing that choice as security configurations, and enforcing it so new and existing repositories stay covered. This guide walks through those decisions setting by setting, with a phased rollout that avoids flooding developers with alerts or surprising finance with licence costs.

It is about configuration, not the exam. If you are preparing for the certification, see GitHub Advanced Security Certification. For tokens, Actions and organisation controls beyond the security features, see the GitHub and GitHub Actions Security Guide.

This is an independent guide from NHI Mgmt Group, based on GitHub's public documentation as of November 2026. It is not sponsored or reviewed by GitHub. Product features change, so confirm settings against GitHub's current documentation.

Key takeaways

  • Since 1 April 2025, GitHub Advanced Security has been sold as two standalone products: GitHub Secret Protection and GitHub Code Security. You can license one without the other.
  • Security configurations are the unit of rollout. GitHub defines them as "collections of enablement settings for GitHub's security features" applied to repositories, while global settings control organisation-level behaviour.
  • Start with the GitHub-recommended configuration for broad coverage, then create custom configurations for the repositories that need different settings or no paid features.
  • Set a default configuration for new repositories and enforce it, but remember that transferred repositories must be configured manually.
  • Secret Protection is the faster win for non-human identity risk: push protection stops tokens, keys and connection strings before they reach the repository.
  • Configure who can bypass push protection and dismiss alerts before you enable them, or the controls become advisory.

The product split and what each includes

GitHub announced on 4 March 2025 that, "Starting April 1, 2025, GitHub Advanced Security will be available as two standalone security products". The announcement listed Secret Protection at $19 per month per active committer and Code Security at $30 per month per active committer, and opened both to GitHub Team customers on a metered, pay-as-you-go basis. As of November 2026, the GitHub security plans page still lists Secret Protection at $19 and Code Security at $30 per active committer per month. Check current pricing with GitHub before budgeting.

According to GitHub's product overview, the products contain:

GitHub Secret ProtectionGitHub Code Security
Secret scanning, push protection, AI-detected secrets, custom patterns, delegated bypass for push protection, delegated alert dismissal, security campaigns, security overviewCode scanning, CodeQL CLI, Copilot Autofix, AI Scan, security campaigns, custom auto-triage rules for Dependabot, dependency review, security overview

GitHub states that both products "are available for accounts on GitHub Team and GitHub Enterprise Cloud", and that some features, such as code scanning and secret scanning, are enabled for public repositories by default at no charge. GitHub also notes that some security features are included in all plans, while the rest require a purchased product on Team or Enterprise Cloud.

The practical consequence is that licensing is now a per-repository design decision. A repository that holds infrastructure code and deployment credentials may justify Secret Protection even if it has little application code worth scanning with CodeQL, while a customer-facing service may need both.

How security configurations and global settings fit together

There are two layers, and confusing them is the most common cause of a rollout that looks complete but is not:

  • Security configurations set repository-level enablement: whether secret scanning, push protection, code scanning default setup, Dependabot and private vulnerability reporting are on for the repositories the configuration is attached to. Once applied, a repository "enters a managed relationship with that configuration".
  • Global settings "control security features at the organization level" and are inherited by repositories. This is where you tune behaviour such as custom patterns, alert handling and code scanning options that apply across the organisation.

GitHub recommends applying security configurations together with customising global settings. Plan both in the same change, and record which team owns each.

A repository's relationship with its configuration can change if an administrator overrides a setting on an unenforced configuration, if the configuration is detached, or when enforcement is turned on. Use the security overview to find repositories with no configuration or with drifted settings.

The GitHub-recommended configuration is "created and maintained by subject matter experts at GitHub" and covers both Code Security and Secret Protection features. GitHub recommends applying it to all repositories in an organisation.

To apply it, open the organisation's Settings, go to Advanced Security under Security, then Configurations. In the GitHub recommended row, choose Apply to and select either all repositories or all repositories without configurations. Review the licence impact shown before you confirm. The configuration applies to both active and archived repositories, so check that archived repositories are not consuming licences you did not intend.

The recommended configuration is a sound baseline for most organisations, and GitHub maintains its contents rather than you. Where you need different behaviour, such as push protection bypass rules or a runner label for code scanning, create a custom configuration.

Designing custom configurations

A custom configuration exposes each feature as enabled, disabled or keep existing settings. The custom configuration options are:

SectionSettings
Secret ProtectionSecret scanning alerts, validity checks, extended metadata, generic patterns, scan for AI-detected secrets, push protection, bypass privileges, prevent direct alert dismissals
Code SecurityCode scanning default setup, runner type for custom-labelled runners, prevent direct alert dismissals
Dependency scanningDependency graph, automatic dependency submission, Dependabot alerts, security updates, prevent direct alert dismissals, malware alerts
Private vulnerability reportingEnable, disable or keep existing
PolicyUse as default for new repositories (none, public, private and internal, all), enforce configuration

Most organisations need three to five configurations, not dozens. A pattern that works:

  • Baseline (all repositories): Secret Protection with push protection, validity checks and delegated bypass; dependency graph, Dependabot alerts and malware alerts. This covers credential leaks everywhere at Secret Protection cost.
  • Production code: baseline plus Code Security with code scanning default setup and dependency review, and prevention of direct alert dismissals.
  • Restricted runners: as production code, but with the runner type set to a custom label for repositories that cannot use GitHub-hosted runners.
  • Public repositories: the free features enabled, with push protection on, because public exposure of a key is immediate.
  • Archived and sandbox: minimal or no paid features, documented so the exception is visible.

These tiers are NHI Mgmt Group recommendations. Map them to your own repository classification, for example by using custom properties or naming conventions, so that assignment can be automated.

Secret Protection settings that matter for non-human identities

Most leaked secrets are credentials for non-human identities: API keys, cloud access keys, personal access tokens used by automation, database passwords and webhook secrets. Secret Protection is where configuration decisions directly reduce that exposure.

Push protection and bypass privileges

GitHub describes push protection as a way to "Prevent secret leaks before they happen by blocking commits containing secrets". The control is only as strong as its bypass model. With bypass privileges open to everyone, a developer can mark a detection as a false positive and push. With delegated bypass, a named reviewer team approves each bypass request. For the enablement steps, see How to enable GitHub secret scanning push protection, and for the developer experience when a push is blocked, see What to do when git push is blocked by secret scanning push protection.

Validity checks and extended metadata

Validity checks tell you whether a detected credential is still active, which is the single most useful field for triage. Extended metadata requires validity checks to be enabled. Turn both on so responders can prioritise live secrets and contact the owner of the identity behind them.

Generic patterns, AI-detected secrets and custom patterns

Partner patterns catch well-known token formats. Generic patterns and AI-detected secrets extend coverage to passwords and unstructured secrets, at the price of more noise. Custom patterns, set in global settings, let you detect your organisation's own token formats. Enable the broader detections first on a pilot group and tune before rolling out.

Preventing direct alert dismissals

Preventing direct dismissals routes dismissals through a review, so an alert for a live production key cannot quietly be closed as "used in tests". Pair it with a response runbook such as How to respond to a GitHub secret scanning alert.

Code Security and dependency settings

Code scanning default setup

Default setup chooses languages and query suites automatically and is the right starting point for most repositories. Use advanced setup only where builds need custom steps or you need extra queries. Default setup can also analyse GitHub Actions workflows, which catches workflow injection, covered in the GitHub Actions Script Injection Guide. Depth on queries and tuning is in the CodeQL Guide.

If your organisation restricts GitHub-hosted runners, set the runner type in the configuration to a custom label. Code scanning enforcement can break when GitHub Actions is disabled in a repository or required Actions are unavailable, so check Actions policy before enforcing.

Dependency graph, Dependabot and dependency review

Enable the dependency graph and automatic dependency submission so that ecosystems resolved at build time are visible. Turn on Dependabot alerts and malware alerts everywhere. Security updates open pull requests automatically; enable them where teams have the review capacity, and use custom auto-triage rules, part of Code Security, to suppress low-value alerts. Dependency review in pull requests stops new vulnerable or malicious packages from merging.

Defaults, enforcement and their limits

In each configuration's policy section you can make it the default for new public, private and internal, or all repositories. GitHub notes that defaults are "only automatically applied to new repositories created in your organization". Repositories transferred in, for example after an acquisition, must have a configuration applied manually. Add that step to your repository transfer procedure.

Enforcement will "Block repository owners from changing features that are enabled or disabled by the configuration". Two caveats apply:

  • Features left unset are not enforced. If you want a feature locked off, set it to disabled explicitly.
  • Under an enforced configuration, a REST API call that changes a feature's enablement appears to succeed, but no statuses change. Automation that toggles features should read state back rather than trusting the response.

A phased rollout plan

  1. Inventory. Use the security overview to list repositories, their visibility, activity and current feature state. Identify active committers per repository to estimate cost.
  2. Run the free secret risk assessment. GitHub described it as "free for GitHub Team and Enterprise organizations". Use the result to size the Secret Protection case.
  3. Pilot. Apply your baseline and production configurations to a few repositories per team. Measure alert volume, false positives and bypass requests for two to four weeks.
  4. Prepare owners. Name bypass reviewers and alert owners for each business unit before broad enablement.
  5. Roll out Secret Protection broadly. Apply the baseline to all repositories without configurations, and set it as default for new repositories.
  6. Roll out Code Security by tier. Start with production code, then expand as triage capacity allows.
  7. Enforce. Once teams are stable, enforce configurations so settings cannot drift.
  8. Measure. Track coverage, mean time to remediate secret alerts, bypass rates and open critical code scanning alerts. Security campaigns help burn down backlogs.

Ownership and operating model

Configuration is the easy part. The programme succeeds or fails on who acts on alerts. Agree these roles before enforcement:

RoleResponsibility
Platform or security engineeringOwns security configurations, global settings, custom patterns and licence reporting
Bypass reviewersApprove or reject push protection bypass requests within an agreed time, per business unit
Repository ownersFix code scanning and Dependabot alerts, and rotate secrets flagged in their repositories
Identity or secrets teamTraces leaked credentials to the owning non-human identity, confirms rotation and retires unused credentials

Feed secret alerts into the same queue that handles other credential exposures, so a leaked cloud key found by push protection, by a scanner elsewhere, or by a third party is triaged the same way. The Developer Secret Scanning Triage guide covers that workflow.

Common failure patterns

  • Enabling secret scanning without push protection, so leaks are detected after the fact instead of blocked.
  • Leaving push protection bypass open to all contributors, which turns blocking into a warning.
  • Applying configurations once and forgetting that transferred repositories arrive unconfigured.
  • Leaving features unset in an enforced configuration and assuming they are locked.
  • Enforcing code scanning in organisations where Actions is disabled for some repositories, then reporting coverage that does not exist.
  • Licensing Code Security everywhere, including archived and sandbox repositories, and having the programme cut at budget review.
  • Closing secret alerts without rotating the credential or identifying the non-human identity that owns it.

Practitioner checklist

  • Decide which repository tiers get Secret Protection, Code Security, both or neither, and document the rationale.
  • Apply the GitHub-recommended configuration or a custom baseline to all repositories without configurations.
  • Enable push protection with delegated bypass and named reviewers.
  • Turn on validity checks and extended metadata for secret alerts.
  • Set a default configuration for new repositories and add configuration to the repository transfer procedure.
  • Set every feature explicitly before enforcing a configuration.
  • Enable code scanning default setup for production code, including Actions workflows.
  • Enable the dependency graph, Dependabot alerts, malware alerts and dependency review.
  • Prevent direct alert dismissals for secrets and code scanning in production tiers.
  • Review licence consumption and coverage in the security overview each month.

Standards and references

Related NHI Mgmt Group resources: GitHub and GitHub Actions Security Guide · GitHub Advanced Security Certification · Git Secret Scanning Guide · CodeQL Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.