Managing security for a few repositories is relatively simple. Managing it across hundreds or thousands of repositories is a different problem.
Large organizations often have multiple teams, programming languages, repository types, and security requirements. If every repository configures GitHub security features independently, security coverage can quickly become inconsistent.
One repository may have code scanning enabled, another may rely only on Dependabot, and another may have secret scanning configured differently.
GitHub provides security configurations, enterprise policies, and organization-level controls to help administrators standardize security settings across repositories. GitHub's current documentation describes security configurations as collections of security enablement settings that can be applied across organizations and enterprises.
This article explains how these controls fit together and how administrators can approach enterprise-wide GitHub Advanced Security management without creating unnecessary configuration complexity.
Why Enterprise Security Policies Matter
A large GitHub environment can contain repositories with very different characteristics.
For example:
Enterprise
|
+-- Organization A
| +-- 120 repositories
|
+-- Organization B
| +-- 75 repositories
|
+-- Organization C
+-- 300 repositories
If security settings are managed individually, administrators have to track hundreds of configurations.
That creates several risks:
Security features may be missing from new repositories.
Different teams may use different configurations.
Security settings can drift over time.
Administrators may not know which repositories are protected.
Updating a security requirement becomes difficult.
Centralized policies help reduce this configuration drift.
What Is GitHub Advanced Security?
GitHub Advanced Security brings together security capabilities designed to help organizations identify and prevent vulnerabilities in their source code and development workflow.
Depending on the GitHub plan and configuration, organizations can use capabilities such as:
Code scanning
Secret scanning
Push protection
Dependency-related security features
Dependabot security capabilities
Security configurations
AI-assisted security features
The exact features available depend on the organization's GitHub plan and configuration.
For enterprise environments, GitHub provides controls for managing security features across organizations and repositories.
Security Configuration vs Enterprise Policy
These two concepts are easy to confuse.
A security configuration defines a collection of security settings that can be applied to repositories.
An enterprise policy controls how organizations and repository administrators can use certain security capabilities.
A simplified model is:
Enterprise Policy
|
v
Who can use or change security features?
|
v
Security Configuration
|
v
Which security settings are enabled?
|
v
Repositories
They solve different problems.
Enterprise Policy
Policies control availability and administrative behavior.
For example, an enterprise can control whether organizations are allowed to use certain security products or whether repository administrators can change particular security settings.
Security Configuration
A configuration defines the actual collection of security settings applied to repositories.
GitHub allows security configurations to be created at enterprise and organization levels and attached to repositories.
What Can an Enterprise Policy Control?
GitHub provides enterprise policies for areas such as:
Availability of Advanced Security features
Dependency insights
Dependabot alerts
Advanced Security features in repositories
AI detection for secret scanning
Copilot Autofix
AI Scan
GitHub documents these as enterprise-level policies that can control security capabilities across organizations owned by an enterprise.
This is particularly useful when an enterprise wants consistent governance.
For example:
Enterprise
|
+-- Security Policy
| |
| +-- Approved organizations
| +-- Approved security features
|
+-- Organization
|
+-- Security Configuration
|
+-- Code scanning
+-- Secret scanning
+-- Dependency features
Creating a Security Configuration
A security configuration is a reusable collection of security settings.
For example, an organization might create:
Configuration: Standard Engineering
Code Security: Enabled
Secret Scanning: Enabled
Push Protection: Enabled
Dependency Graph: Enabled
Dependabot Alerts: Enabled
Another configuration could be designed for repositories with stricter requirements:
Configuration: High Security
Code Security: Enabled
Secret Scanning: Enabled
Push Protection: Enabled
Dependency Graph: Enabled
Dependabot Alerts: Enabled
Additional protections: Enabled
The actual options available depend on the GitHub security products enabled for the enterprise.
GitHub's documentation provides support for creating custom configurations at enterprise and organization levels.
Why Use Multiple Configurations?
One configuration does not necessarily fit every repository.
Consider an enterprise with:
Public open-source repositories
Internal applications
Customer-facing APIs
Financial systems
Experimental projects
Archived repositories
Applying exactly the same security settings to every repository may not be practical.
A better approach is to define a small number of meaningful security profiles.
For example:
Configuration | Intended repositories |
|---|---|
Standard | General engineering repositories |
High Security | Sensitive production applications |
Open Source | Public repositories |
Legacy | Repositories requiring transitional settings |
The objective should be consistency without creating dozens of nearly identical configurations.
Applying a Configuration to Repositories
GitHub allows enterprise security configurations to be attached to repositories through the REST API.
For example, an enterprise configuration can be attached to repositories using an endpoint similar to:
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/code-security/configurations/CONFIGURATION_ID/attach \
-d '{"scope":"all"}'
GitHub documents this enterprise configuration attachment operation and returns an accepted response when the request is processed.
The exact token type and permissions required depend on the operation.
Never place a real access token directly in source code or a committed workflow.
Setting Defaults for New Repositories
One of the most useful enterprise controls is setting a security configuration as a default.
This helps address a common problem:
Existing repositories
|
+-- Protected
New repository
|
+-- Security settings forgotten
An enterprise-level default can apply a selected configuration to new repositories matching a specified repository visibility.
GitHub supports default configuration values such as:
All
Public
Private and internal
None
The exact precedence rules matter when both enterprise and organization defaults are configured.
Why New Repository Coverage Matters
Security teams often focus on existing repositories and forget repository creation.
Suppose an enterprise has 500 protected repositories.
A new team creates repository number 501.
If security configuration is entirely manual, repository 501 may temporarily have different security coverage.
This creates a gap:
Repository Created
|
v
Security Configuration
|
+-- Automatically applied
|
v
Protected Repository
Default configurations reduce this manual step.
Enterprise Enforcement
A security configuration can be configured as enforced.
When a configuration is enforced, repository owners cannot change the enablement status of features controlled by that configuration. GitHub documents enforcement as a mechanism for preventing repository-level changes to enforced security settings.
This is useful when security requirements are mandatory.
For example:
Enterprise Requirement
|
v
Secret Scanning Must Be Enabled
|
v
Enforced Configuration
|
v
Repository Administrators
|
X
Cannot disable controlled setting
Without enforcement, repository administrators may have more freedom to modify their security settings.
Enforcement Requires Careful Planning
Enforcement should not be treated as simply switching everything on.
GitHub documents situations that can affect enforcement, including cases involving GitHub Actions availability and code scanning requirements.
For example, code scanning configurations may depend on GitHub Actions.
If Actions are unavailable or disabled for a repository, the expected code scanning configuration may not operate as intended.
Before enforcing a configuration, verify:
Required Actions are available.
Repositories meet the configuration requirements.
Required permissions exist.
Repository visibility is covered.
The configuration has been tested.
Exceptions are understood.
Enterprise Policy Precedence Matters
Large GitHub environments can have controls at multiple levels.
A simplified model is:
Enterprise
|
+-- Enterprise policy
|
+-- Enterprise security configuration
|
v
Organization
|
+-- Organization policy
|
+-- Organization configuration
|
v
Repository
The actual precedence depends on the specific setting.
GitHub documents cases where an enterprise-enforced configuration takes precedence over an organization-level default for the same repository visibility.
Join the conversation! Your thoughts help the community grow.