Compliance & Governance

Learn how to make your GitLab CI/CD pipelines audit-ready. From compliance frameworks and audit events to policy enforcement and separation of duties, build governance that satisfies auditors without slowing down developers.

Compliance Audit GitLab
Why Compliance and Governance Matter

Compliance is not optional for organizations in regulated industries. SOC 2, ISO 27001, HIPAA, PCI DSS, and GDPR all require demonstrable controls over who can change code, how changes are reviewed, and what evidence exists that those controls were followed. An auditor doesn't just want to hear that you have a deployment approval process — they want to see the audit trail proving it was followed for every production deployment over the past year.

GitLab provides compliance features that generate this evidence automatically. Compliance frameworks let you tag projects with the regulations they fall under, and then enforce a consistent set of controls across all of them. Audit events record every significant action — who merged what, who changed a setting, who deployed to production — in an immutable log. Compliance pipelines inject mandatory jobs into every project's pipeline, ensuring that required checks run even if the project's own .gitlab-ci.yml doesn't include them .

Governance is the broader practice: defining who has access to what, enforcing separation of duties (the person who writes code shouldn't be the one who approves it), and ensuring that policies are applied consistently across the organization. GitLab supports governance through protected branches, protected environments, merge request approvals, and security policies. The goal is not to slow down development but to make the safe path the easy path — the default workflow that developers follow is also the compliant one .

Core Principle: Compliance should be automated and invisible. Developers follow their normal workflow, and GitLab generates the evidence auditors need without manual effort.

Compliance Frameworks

Tags projects with regulations (SOC 2, ISO 27001). Enables consistent controls and reporting across all tagged projects.

Audit Events

Immutable log of all significant actions. Who did what, when, and from where. Available at project, group, and instance level.

Compliance Pipelines

Mandatory CI/CD jobs injected into every project's pipeline. Ensures required checks run regardless of project configuration.

Separation of Duties

Authors cannot approve their own merge requests. Enforced through approval rules and branch protection.

Security Policies

Scan execution and result policies enforced across projects. Blocks merges when critical vulnerabilities exist.

Compliance Reports

Pre-built reports showing which projects meet which controls. Evidence for auditors without manual collection.
Compliance Frameworks

A compliance framework is a label that identifies which regulatory standard a project must comply with. GitLab ships with built-in frameworks for common standards — SOC 2, ISO 27001, HIPAA, PCI DSS, GDPR — and allows organizations to create custom frameworks that match their internal policies. When a project is tagged with a framework, GitLab knows to apply the associated controls and to include the project in compliance reports for that framework .

The value of frameworks is consistency. Without them, each project team decides which controls to apply, and auditors must review each project individually. With frameworks, the organization defines the controls once, and every project tagged with that framework automatically inherits them. A SOC 2 audit becomes a matter of generating a report for all projects tagged with the SOC 2 framework, rather than manually inspecting each project's configuration.

Frameworks also enable compliance pipelines and compliance-specific approval rules. A project tagged with the PCI DSS framework can be required to run additional security scans, require approvals from a compliance officer, and prevent force-pushes to protected branches — all driven by the framework tag rather than by per-project configuration. This is essential for organizations with hundreds of projects and a small compliance team.

# Compliance frameworks are configured at the group level # Group > Settings > Compliance > Frameworks # Built-in frameworks: # - SOC 2 # - ISO 27001 # - HIPAA # - PCI DSS # - GDPR # - NIST 800-53 # - Custom frameworks # Tag a project with a framework # Project > Settings > General > Compliance frameworks # Select one or more frameworks # Framework controls (examples): # - Require merge request approvals # - Prevent force push to protected branches # - Require compliance pipeline # - Require security scan results # - Restrict who can deploy to production # Compliance frameworks API # Create a custom framework curl --request POST \ --header "PRIVATE-TOKEN: " \ --url "https://gitlab.example.com/api/v4/groups/:id/compliance_frameworks" \ --form "name=Custom Framework" \ --form "description=Internal security policy" \ --form "color=#FF0000" # Assign framework to project curl --request PUT \ --header "PRIVATE-TOKEN: " \ --url "https://gitlab.example.com/api/v4/projects/:id" \ --form "compliance_framework_ids[]=1" # Compliance framework benefits: # - Consistent controls across projects # - Automated compliance reporting # - Framework-specific approval rules # - Framework-specific compliance pipelines # - Audit-ready evidence
Compliance Framework Best Practices:
  • Start with built-in frameworks (SOC 2, ISO 27001) and customize as needed
  • Tag every project with the frameworks it must comply with
  • Use compliance pipelines to enforce controls across all tagged projects
  • Review framework assignments quarterly as projects evolve
  • Document the controls each framework enforces for auditor clarity
Audit Events

Audit events are GitLab's immutable record of significant actions. Every time someone changes a project setting, merges a merge request, deploys to production, or modifies a CI/CD variable, GitLab records the action: who performed it, when, from what IP address, and what changed. These events cannot be edited or deleted, which is precisely what makes them valuable as audit evidence .

Audit events are available at three levels. Project-level events cover actions within a single project. Group-level events cover actions across all projects in a group, including group-level settings. Instance-level events (Ultimate only) cover all actions across the entire GitLab instance, including user management and system configuration. For most compliance purposes, group-level audit events provide the right balance of scope and manageability.

The events most relevant to CI/CD compliance include: merge request approvals, deployments to protected environments, changes to protected branches, modifications to CI/CD variables (especially protected ones), changes to project members and their roles, and changes to compliance framework assignments. These events form a chain of evidence: you can prove that a production deployment was approved by an authorized user, that the approval happened after the code review, and that no unauthorized user modified the pipeline configuration between approval and deployment .

# View audit events (UI) # Project > Secure > Audit events # Group > Secure > Audit events # Admin > Monitoring > Audit events (instance-level) # Audit events API # List project audit events curl --header "PRIVATE-TOKEN: " \ "https://gitlab.example.com/api/v4/projects/:id/audit_events" # List group audit events curl --header "PRIVATE-TOKEN: " \ "https://gitlab.example.com/api/v4/groups/:id/audit_events" # List instance audit events (Ultimate) curl --header "PRIVATE-TOKEN: " \ "https://gitlab.example.com/api/v4/audit_events" # Filter by entity type curl --header "PRIVATE-TOKEN: " \ "https://gitlab.example.com/api/v4/projects/:id/audit_events?entity_type=Deployment" # Filter by date range curl --header "PRIVATE-TOKEN: " \ "https://gitlab.example.com/api/v4/projects/:id/audit_events?created_after=2025-01-01&created_before=2025-12-31" # Key audit events for CI/CD compliance: # - merge_request.approved # - merge_request.merged # - deployment.created # - deployment.succeeded # - protected_branch.updated # - ci_variable.created / updated / deleted # - project_member.created / updated / deleted # - compliance_framework.assigned # Audit event structure (JSON) # { # "id": 12345, # "author_id": 42, # "author_name": "Jane Developer", # "entity_id": 100, # "entity_type": "Deployment", # "details": { # "custom_message": "Deployed to production", # "target_id": 100, # "target_type": "Deployment", # "target_details": "v1.2.3 to production" # }, # "created_at": "2025-01-15T10:30:00.000Z", # "ip_address": "192.168.1.1" # } # Stream audit events to external systems (Ultimate) # Group > Settings > Audit events > Streaming # - Amazon S3 # - Google Cloud Storage # - External HTTP endpoint # - Webhook
Audit Event Retention: