The Complete Guide to Migrating to GitHub Enterprise Managed Users - Part 4: Security & Compliance #189385
jmassardo
started this conversation in
Discover: GitHub Best Practices
Replies: 1 comment
-
|
Updated post to include section on |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The Complete Guide to Migrating to GitHub Enterprise Managed Users - Part 4: Security & Compliance
Phase 4: Security & Compliance
Locking down the new environment before migration begins.
Before you start moving repositories and onboarding users, you need the security guardrails in place. This phase covers audit logging, enterprise policies, CI/CD configuration, and integrations. Get these right so that when code lands in the new environment, it's already protected.
Audit Logging and Compliance
EMU provides detailed audit logging that's essential for compliance and security monitoring.
Compliance Framework Alignment
EMU's controls map well to common compliance frameworks. Here's how EMU features support specific requirements:
Key compliance benefits:
What's Captured
The audit log captures:
Events are retained for 180 days, with Git events retained for 7 days.
Streaming Audit Logs
For long-term retention and SIEM integration, configure audit log streaming:
flowchart LR GH[GitHub Enterprise] -->|Webhook| STREAM[Audit Log Stream] STREAM --> SPLUNK[Splunk] STREAM --> DATADOG[Datadog] STREAM --> SENTINEL[Azure Sentinel] STREAM --> S3[AWS S3] STREAM --> GCS[Google Cloud Storage] STREAM --> BLOB[Azure Blob Storage] style GH fill:#a5d6a7,stroke:#2e7d32,color:#333 style STREAM fill:#b3e5fc,stroke:#0288d1,color:#333 style SPLUNK fill:#ffe0b2,stroke:#e65100,color:#333 style DATADOG fill:#ffe0b2,stroke:#e65100,color:#333 style SENTINEL fill:#ffe0b2,stroke:#e65100,color:#333 style S3 fill:#ffe0b2,stroke:#e65100,color:#333 style GCS fill:#ffe0b2,stroke:#e65100,color:#333 style BLOB fill:#ffe0b2,stroke:#e65100,color:#333See Streaming the audit log for your enterprise for configuration details.
Enable API Request Event Streaming
By default, audit log streams only include web (UI) events. For complete visibility, you should also enable API request events. These capture every REST and GraphQL API call made against your enterprise, which is critical for detecting automated access patterns, identifying misconfigured integrations, and satisfying compliance requirements.
To enable API request event streaming:
See Streaming the audit log for your enterprise - API request events for more details.
Enable Source IP Disclosure
By default, GitHub audit log events do not include the source IP address of the actor. For security monitoring, incident response, and compliance, you'll want to enable IP source disclosure so that every audit event includes the originating IP address.
To enable source IP disclosure:
Once enabled, your audit log events will include the
actor_ipfield, which is invaluable for:See Displaying IP addresses in the audit log for your enterprise for configuration steps.
Audit Log API
For programmatic access, use the Audit Log API:
See Using the audit log API for your enterprise.
Security Hardening Best Practices
Once you've migrated, implementing proper security controls is essential.
Enterprise Policies
Set enterprise-wide policies to enforce security standards:
See Enforcing policies for your enterprise.
Conditional Access Policies (OIDC)
If you use OIDC with Entra ID, you can enforce certian Conditional Access Policies. OIDC cannot enforce device health/compliance conditions.
See About support for your IdP's Conditional Access Policy.
Secret Scanning and Push Protection
If you have GitHub Advanced Security, enable Secrets Scanning and Push Protection the enterprise level:
This catches secrets before they're committed and alerts on any that slip through.
IP Allow Lists
Restrict access to your enterprise from known IP ranges:
CI/CD Implications and GitHub Actions
Your CI/CD pipelines will need attention during the migration. GitHub Actions works with EMU, but there are important differences and considerations.
GitHub Actions Changes
What stays the same:
What changes:
Runner Strategy
For EMU enterprises, plan your runner infrastructure carefully:
flowchart TB subgraph Enterprise["EMU Enterprise"] subgraph Org1["Organization A"] R1["GitHub-Hosted Runners"] SR1["Self-Hosted Runners<br/>(Org Level)"] end subgraph Org2["Organization B"] R2["GitHub-Hosted Runners"] SR2["Self-Hosted Runners<br/>(Org Level)"] end ER["Enterprise Runners<br/>(Shared)"] end ER --> Org1 ER --> Org2 style Enterprise fill:#f0fff4,stroke:#28a745,color:#333 style Org1 fill:#e8f5e9,stroke:#66bb6a,color:#333 style Org2 fill:#e8f5e9,stroke:#66bb6a,color:#333 style R1 fill:#b3e5fc,stroke:#0288d1,color:#333 style SR1 fill:#ffe0b2,stroke:#e65100,color:#333 style R2 fill:#b3e5fc,stroke:#0288d1,color:#333 style SR2 fill:#ffe0b2,stroke:#e65100,color:#333 style ER fill:#ce93d8,stroke:#7b1fa2,color:#333Self-hosted runner considerations:
Secrets and Variables Management
Secrets management changes slightly with EMU:
Best practices:
See About security hardening with OpenID Connect.
Actions Permissions and Policies
Configure enterprise-wide Actions policies:
Recommended settings for secure EMU environments:
Migrating Existing Workflows
When migrating workflows from standard GHEC:
Planning for Integrations
Integrations are often the most complex part of an EMU migration. You'll need to audit, test, and potentially reconfigure every integration.
Types of Integrations to Consider
flowchart LR subgraph GitHub["GitHub EMU Enterprise"] GHA["GitHub Apps"] OA["OAuth Apps"] WH["Webhooks"] API["API Integrations"] end subgraph External["External Systems"] JIRA["Jira/Project Management"] SLACK["Slack/Teams"] CI["External CI/CD"] SEC["Security Tools"] DOCK["Container Registries"] end GHA <--> JIRA GHA <--> SEC OA <--> SLACK WH --> CI API <--> DOCK style GitHub fill:#f0fff4,stroke:#28a745,color:#333 style External fill:#f0f7ff,stroke:#0366d6,color:#333 style GHA fill:#a5d6a7,stroke:#2e7d32,color:#333 style OA fill:#a5d6a7,stroke:#2e7d32,color:#333 style WH fill:#a5d6a7,stroke:#2e7d32,color:#333 style API fill:#a5d6a7,stroke:#2e7d32,color:#333 style JIRA fill:#bbdefb,stroke:#1565c0,color:#333 style SLACK fill:#bbdefb,stroke:#1565c0,color:#333 style CI fill:#bbdefb,stroke:#1565c0,color:#333 style SEC fill:#bbdefb,stroke:#1565c0,color:#333 style DOCK fill:#bbdefb,stroke:#1565c0,color:#333GitHub Apps vs OAuth Apps
GitHub Apps (preferred for EMU):
OAuth Apps (use with caution):
Integration Audit Checklist
Before migration, document each integration:
Common Integration Patterns
Pattern 1: GitHub App Installation
Pattern 2: Machine User (for legacy integrations)
If you have integrations that require a "user" account:
Pattern 3: Webhook to External System
Third-Party Tool Compatibility
Contact vendors to verify EMU compatibility for:
Most modern tools support GitHub Apps and work fine with EMU. Issues typically arise with older tools that rely on user-level OAuth.
Token Migration Strategy
Personal Access Tokens (PATs) are one of the most overlooked aspects of EMU migrations. Every token tied to a personal account in your old environment becomes invalid. This section provides a comprehensive approach to identifying, planning, and migrating tokens.
Understanding the Token Problem
In standard GHEC, PATs are tied to personal accounts. When you migrate to EMU:
flowchart LR subgraph Before["Before Migration"] PA["Personal Account<br/>dev@company.com"] PAT1["PAT: ghp_xxx<br/>(CI/CD)"] PAT2["PAT: ghp_yyy<br/>(Scripts)"] PA --> PAT1 PA --> PAT2 end subgraph After["After Migration"] MA["Managed User<br/>dev_acme"] NPAT["New PAT: ghp_zzz"] GA["GitHub App<br/>(Preferred)"] MA --> NPAT GA -.->|"Installation Token"| API["API Access"] end Before -->|"Migration"| After PAT1 -.->|"❌ Invalid"| X1["Broken"] PAT2 -.->|"❌ Invalid"| X2["Broken"] style Before fill:#fff3e0,stroke:#f57c00,color:#333 style After fill:#e8f5e9,stroke:#388e3c,color:#333 style X1 fill:#ffebee,stroke:#c62828,color:#333 style X2 fill:#ffebee,stroke:#c62828,color:#333 style PA fill:#ffe0b2,stroke:#e65100,color:#333 style PAT1 fill:#ffe0b2,stroke:#e65100,color:#333 style PAT2 fill:#ffe0b2,stroke:#e65100,color:#333 style MA fill:#a5d6a7,stroke:#2e7d32,color:#333 style NPAT fill:#a5d6a7,stroke:#2e7d32,color:#333 style GA fill:#a5d6a7,stroke:#2e7d32,color:#333 style API fill:#a5d6a7,stroke:#2e7d32,color:#333Step 1: Inventory Existing Tokens
Before you can migrate tokens, you need to know what exists. Unfortunately, there's no API to list all PATs across an organization (by design—it's a security feature). You'll need a multi-pronged approach:
Audit Log Analysis
Search your audit logs for token usage patterns:
Survey Your Teams
Create a token inventory form for teams to report:
Check CI/CD Configurations
Scan your repositories for hardcoded or referenced tokens:
Step 2: Classify Tokens by Migration Path
Not all tokens should be migrated the same way. Classify each token:
Step 3: Create GitHub Apps for Automation
For most automation use cases, GitHub Apps are the preferred solution. They offer:
Creating a GitHub App for CI/CD
Generating Installation Tokens
Using Installation Tokens in GitHub Actions
Step 4: Set Up Machine Users for Legacy Integrations
Some integrations simply can't use GitHub Apps—they require a PAT. For these cases, create dedicated "machine users" (managed user accounts specifically for automation):
Provisioning a Machine User
Create an identity in your IdP specifically for the service
svc-github-jenkins,bot-deploy-automationSCIM provisions the account on GitHub
svc-github-jenkins_acmeCreate a PAT for the machine user
Store the token securely
Machine User Best Practices
svc-*orbot-*prefix for clarityStep 5: Fine-Grained vs Classic PATs
EMU supports both token types, but fine-grained PATs are strongly recommended:
Enabling Fine-Grained PAT Controls
Creating a Fine-Grained PAT
Step 6: Update Consumers
With new tokens created, update all consumers:
CI/CD Pipelines
External Systems
Local Development
Communicate to developers:
git credential rejectStep 7: Validate and Revoke
After migration, validate that new tokens work and old tokens are revoked:
Token Migration Checklist
GitHub App Migration
GitHub Apps installed in your old environment don't automatically transfer to EMU. You'll need to reinstall them in your new enterprise. This section covers the full migration process.
Types of GitHub Apps
Understanding the different types helps plan your migration:
Step 1: Inventory Installed Apps
List all GitHub Apps across your organizations:
Create an App Inventory Spreadsheet
Step 2: Check EMU Compatibility
Not all apps work with EMU. Check with vendors or test in a sandbox:
Common Compatibility Issues
Vendor Compatibility Check Template
When contacting vendors, ask:
Step 3: Migrate Marketplace Apps
For apps from the GitHub Marketplace:
Step 4: Recreate Internal/Private Apps
For apps your organization created:
Option A: Create New App in EMU Enterprise
If you have the source code and can recreate the app:
Export current app configuration
Create new app in EMU enterprise
Update app code with new credentials
Install in organizations
Test thoroughly
Option B: Transfer App Ownership (If Supported)
In some cases, you can transfer app ownership:
Step 5: Handle Webhooks
Apps often rely on webhooks. These need reconfiguration:
Webhook Migration Checklist
Step 6: Update App Authentication
After recreating apps, update all places that authenticate:
GitHub Actions Workflows
External Services
Step 7: Validate App Functionality
Create a test plan for each migrated app:
GitHub App Migration Checklist
Artifact Management and GitHub Packages
GitHub Packages works with EMU, but there are important considerations for your artifact management strategy.
Supported Package Types
GitHub Packages in EMU supports:
Authentication Changes
Managed users authenticate to GitHub Packages the same way, but with enterprise-scoped tokens:
Package Visibility and Access
In EMU enterprises:
Migration Considerations
When migrating existing packages:
External Registry Integration
If you use external registries (Artifactory, Nexus, ECR, ACR), they'll continue to work:
Code Security and GitHub Advanced Security
EMU enterprises can take full advantage of GitHub Advanced Security (GHAS) features. Here's how to maximize your security posture.
GitHub Advanced Security Features
Code Scanning
Secret Scanning
Dependabot
Enterprise Security Configuration
Configure security features at scale:
Recommended settings:
Security Overview Dashboard
EMU enterprises get access to the Security Overview dashboard:
See About the security overview.
Private Vulnerability Reporting
Enable private vulnerability reporting to allow security researchers to report issues confidentially:
This creates a secure channel for vulnerability disclosure without public exposure.
Security Policies
Create a
SECURITY.mdfile in your.githubrepository to establish organization-wide security policies:Beta Was this translation helpful? Give feedback.
All reactions