GitHub Enterprise Cloud is the most widely adopted platform for source code hosting, collaboration, and DevOps automation. Organizations use it to manage repositories, CI/CD pipelines (GitHub Actions), package registries, code review workflows, and developer access across thousands of contributors.
Misconfigurations at the organization or enterprise level — unenforced SSO, missing two-factor authentication requirements, overly permissive member base permissions, unprotected default branches, disabled security scanning, unrestricted Actions workflows, or unmonitored OAuth/GitHub App integrations — can expose source code, enable supply chain attacks, leak secrets, and undermine the software development lifecycle. Because GitHub is the central nervous system of modern software delivery, its security posture directly determines an organization's exposure to code tampering, credential theft, and insider threats.
github-sec-inspector is an automated compliance inspection tool that connects to a GitHub organization (or enterprise) via the REST API v3 and GraphQL API v4, collects security-relevant configuration data across organization settings, repositories, branch protection, code security features, and access controls, evaluates the configuration against hardened baselines derived from multiple compliance frameworks, and produces actionable reports with framework-specific control mappings.
GitHub Apps provide the highest rate limits and finest-grained permissions. The app must be installed on the organization with the following permissions:
Organization: Administration (read), Members (read), Plan (read)
For interactive use or CI/CD systems using OAuth flow. Not recommended for automated inspection; prefer PAT or GitHub App.
3.5 SAML SSO Authorization
In organizations with SAML SSO enabled, tokens must be explicitly authorized for the organization. Classic PATs must be SSO-authorized via GitHub Settings > Developer settings > Personal access tokens > Authorize.
3.6 Environment Variables (github-sec-inspector)
Variable
Required
Description
GITHUB_TOKEN
Yes*
Personal access token (classic or fine-grained)
GITHUB_ORG
Yes
Target organization slug
GITHUB_ENTERPRISE
Optional
Enterprise slug (for enterprise-level checks)
GITHUB_APP_ID
Alt*
GitHub App ID
GITHUB_APP_PRIVATE_KEY_PATH
Alt*
Path to GitHub App private key PEM file
GITHUB_APP_INSTALLATION_ID
Alt*
GitHub App installation ID
GITHUB_API_URL
Optional
API base URL (default: https://api.github.com; set for GHES)
*Either GITHUB_TOKEN or all three GITHUB_APP_* variables are required.
4. Security Controls
Identity & Authentication
#
Control
Severity
What Is Checked
1
SAML SSO Enforcement
Critical
Verify SAML SSO is configured and enforced for the organization via GraphQL samlIdentityProvider; check that all members have active SAML identity bindings
2
Two-Factor Authentication Requirement
Critical
Verify two_factor_requirement_enabled is true on the organization; enumerate members without 2FA via /orgs/{org}/members?filter=2fa_disabled
3
Enterprise Managed Users (EMU)
High
Detect whether the organization uses EMU (managed by enterprise IdP); check enterprise user account bindings via GraphQL
4
IP Allow List
High
Via GraphQL, verify ipAllowListEnabledSetting is ENABLED; enumerate allow list entries; check ipAllowListForInstalledAppsEnabledSetting
Organization Permissions & Policies
#
Control
Severity
What Is Checked
5
Member Base Permissions
High
Check default_repository_permission on the org object; flag if set to write or admin (should be read or none)
6
Repository Visibility Defaults
Medium
Check members_can_create_public_repositories; verify members_can_create_private_repositories and members_can_create_internal_repositories policies
7
Fork Policy
Medium
Check members_can_fork_private_repositories; flag if private repo forking is unrestricted
8
Outside Collaborator Policy
High
Enumerate outside collaborators via /orgs/{org}/outside_collaborators; flag excessive external access; check if admin approval is required
9
OAuth App Restrictions
High
Verify OAuth application access policy is set to restricted; check /orgs/{org}/credential-authorizations for unauthorized OAuth apps
Repository & Code Protection
#
Control
Severity
What Is Checked
10
Branch Protection Rules
Critical
For every repo's default branch, verify protection is enabled; check requiresApprovingReviews, isAdminEnforced, allowsForcePushes=false, allowsDeletions=false
Verify requiresStatusChecks=true with specific required contexts; flag repos with no CI checks
13
Signed Commit Requirement
Medium
Check requiresCommitSignatures on branch protection; flag repos where unsigned commits are allowed on protected branches
14
Repository Rulesets
Medium
Enumerate org-level and repo-level rulesets; verify they enforce branch protection, tag protection, and push restrictions
Code Security Features (GHAS)
#
Control
Severity
What Is Checked
15
Code Scanning Enabled
High
Verify code scanning (CodeQL or third-party) is configured on all repositories; count open critical/high alerts via /orgs/{org}/code-scanning/alerts
16
Secret Scanning Enabled
Critical
Verify secret scanning is enabled on all repositories; check push protection is enabled; count open alerts via /orgs/{org}/secret-scanning/alerts
17
Dependabot Enabled
High
Verify Dependabot alerts and security updates are enabled; count open critical/high alerts via /orgs/{org}/dependabot/alerts
18
Security Policy
Low
Check each repo has a SECURITY.md or securityPolicyUrl configured
Audit & Monitoring
#
Control
Severity
What Is Checked
19
Audit Log Streaming
High
Verify audit log streaming is configured to an external SIEM; check via enterprise settings or audit log API
20
Webhook Security
High
Audit all organization webhooks; flag webhooks without secret configured, webhooks with insecure_ssl=1, webhooks sending to non-HTTPS URLs
Actions & CI/CD Security
#
Control
Severity
What Is Checked
21
Actions Permissions
High
Check org-level Actions permissions; flag if allowed_actions is all (should be selected or local_only); verify default_workflow_permissions is read not write
22
Runner Group Restrictions
Medium
Audit self-hosted runner groups; flag runners accessible to all repos; verify runner group repository access restrictions
23
Deploy Key Management
Medium
Enumerate deploy keys across all repos; flag keys with write access; flag keys older than 365 days without rotation
24
GitHub App Permissions Audit
High
Enumerate all GitHub App installations; flag apps with excessive permissions (admin access, write to all repos); check for inactive/unused apps
25
Package Registry Access
Medium
Audit package visibility settings; flag packages with public visibility in private organizations; check package access inheritance
5. Compliance Framework Mappings
#
Control
FedRAMP (800-53 r5)
CMMC 2.0
SOC 2 (TSC)
CIS GitHub Benchmark
PCI-DSS 4.0
DISA STIG
IRAP (ISM)
ISMAP
1
SAML SSO Enforcement
IA-2, IA-8
AC.L2-3.1.1
CC6.1
1.1.1
8.3.1
SRG-APP-000148
ISM-1557
5.1.1
2
Two-Factor Authentication
IA-2(1), IA-2(2)
IA.L2-3.5.3
CC6.1
1.1.2
8.4.2
SRG-APP-000149
ISM-1401
5.1.2
3
Enterprise Managed Users
IA-2, IA-5
IA.L2-3.5.1
CC6.1
1.1.3
8.2.1
SRG-APP-000163
ISM-1558
5.1.3
4
IP Allow List
SC-7, AC-17
SC.L2-3.13.1
CC6.1, CC6.6
1.2.1
1.3.1
SRG-APP-000142
ISM-1416
5.1.4
5
Member Base Permissions
AC-3, AC-6
AC.L2-3.1.5
CC6.3
1.3.1
7.2.1
SRG-APP-000033
ISM-1508
5.2.1
6
Repository Visibility Defaults
AC-3, AC-22
AC.L2-3.1.22
CC6.1
1.3.2
7.2.2
SRG-APP-000211
ISM-0264
5.2.2
7
Fork Policy
AC-3, AC-4
AC.L2-3.1.3
CC6.1
1.3.3
7.2.3
SRG-APP-000033
ISM-0405
5.2.3
8
Outside Collaborator Policy
AC-2, AC-6(5)
AC.L2-3.1.6
CC6.2, CC6.3
1.3.4
7.2.4
SRG-APP-000340
ISM-1509
5.2.4
9
OAuth App Restrictions
AC-3, AC-6
AC.L2-3.1.5
CC6.6, CC6.8
1.4.1
6.3.2
SRG-APP-000386
ISM-1490
5.2.5
10
Branch Protection Rules
CM-3, SI-7
CM.L2-3.4.5
CC8.1
2.1.1
6.5.1
SRG-APP-000133
ISM-1072
5.3.1
11
Required Pull Request Reviews
CM-3, CM-5
CM.L2-3.4.5
CC8.1
2.1.2
6.5.2
SRG-APP-000381
ISM-1525
5.3.2
12
Required Status Checks
SI-7, SA-11
SA.L2-3.13.10
CC8.1
2.1.3
6.5.3
SRG-APP-000456
ISM-1525
5.3.3
13
Signed Commit Requirement
SI-7(6)
SI.L2-3.14.1
CC8.1
2.1.4
6.5.4
SRG-APP-000411
ISM-1072
5.3.4
14
Repository Rulesets
CM-3, CM-5
CM.L2-3.4.5
CC8.1
2.1.5
6.5.5
SRG-APP-000133
ISM-1072
5.3.5
15
Code Scanning Enabled
RA-5, SA-11
RA.L2-3.11.2
CC7.1
3.1.1
6.5.6
SRG-APP-000456
ISM-1163
5.4.1
16
Secret Scanning Enabled
IA-5(7), SC-12
SC.L2-3.13.10
CC6.1, CC7.1
3.1.2
6.5.7
SRG-APP-000175
ISM-1590
5.4.2
17
Dependabot Enabled
RA-5, SI-2
RA.L2-3.11.2
CC7.1
3.1.3
6.3.3
SRG-APP-000456
ISM-1163
5.4.3
18
Security Policy
PL-2, IR-8
IR.L2-3.6.1
CC2.2
3.1.4
12.10.1
SRG-APP-000516
ISM-0043
5.4.4
19
Audit Log Streaming
AU-2, AU-6, SI-4
AU.L2-3.3.1
CC7.2, CC7.3
4.1.1
10.2.1
SRG-APP-000095
ISM-0580
5.5.1
20
Webhook Security
SC-8, SI-4
SC.L2-3.13.8
CC6.7
4.1.2
4.2.1
SRG-APP-000439
ISM-1139
5.5.2
21
Actions Permissions
CM-7, AC-3
CM.L2-3.4.7
CC6.8, CC8.1
5.1.1
6.3.2
SRG-APP-000386
ISM-1490
5.6.1
22
Runner Group Restrictions
AC-3, CM-7
AC.L2-3.1.3
CC6.3
5.1.2
7.2.5
SRG-APP-000033
ISM-0405
5.6.2
23
Deploy Key Management
IA-5, SC-12
IA.L2-3.5.10
CC6.1, CC6.6
5.2.1
8.6.3
SRG-APP-000175
ISM-1590
5.6.3
24
GitHub App Permissions Audit
AC-6(10), CM-11
AC.L2-3.1.7
CC6.3, CC6.8
5.2.2
6.3.2
SRG-APP-000342
ISM-1490
5.6.4
25
Package Registry Access
AC-3, AC-22
AC.L2-3.1.22
CC6.1
5.3.1
7.2.6
SRG-APP-000211
ISM-0264
5.6.5
6. Existing Tools
Tool
Type
Relevance
github/safe-settings
GitHub App
Declarative repo/org settings management via YAML; enforces branch protection, collaborators, labels, and org settings; apply-and-drift-detect model
ossf/allstar
GitHub App
OpenSSF project for continuous security policy enforcement; checks branch protection, binary artifacts, CI tests, pinned dependencies, SECURITY.md, admin access