Compliance frameworks

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

You can create a compliance framework that is a label to identify that your project has certain compliance requirements or needs additional oversight.

In the Ultimate tier, the compliance framework can optionally enforce compliance pipeline configuration and security policies to the projects on which it is applied.

Compliance frameworks are created on top-level groups. If a project is moved outside of its existing top-level group, its frameworks are removed.

You can apply up to 20 compliance frameworks to each project.

For a click-through demo, see Compliance frameworks.

Prerequisites

  • To create, edit, and delete compliance frameworks, users must have either:
  • To add or remove a compliance framework to or from a project, the group to which the project belongs must have a compliance framework.

Create, edit, or delete a compliance framework

You can create, edit, or delete a compliance framework by using either a compliance frameworks report or a compliance projects report.

For more information on using a compliance frameworks report, see:

For more information on using a compliance projects report, see:

Apply a compliance framework to a project

History

You can apply multiple compliance frameworks to a project but cannot apply compliance frameworks to projects in personal namespaces.

To apply a compliance framework to a project, apply the compliance framework through the Compliance projects report.

You can use the GraphQL API to apply one or many compliance frameworks to a project.

If you create compliance frameworks on subgroups with GraphQL, the framework is created on the root ancestor if the user has the correct permissions. The GitLab UI presents a read-only view to discourage this behavior.

To apply a compliance framework to a project through a compliance framework:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Projects tab.
  4. Hover over a compliance framework, select the Edit Framework tab.
  5. Select Projects section.
  6. Select projects from the list.
  7. Select Update Framework.

Default compliance frameworks

History

Group owners can set a default compliance framework. The default framework is applied to all the new and imported projects that are created in that group. It does not affect the framework applied to the existing projects. The default framework cannot be deleted.

A compliance framework that is set to default has a default label.

Set and remove a default by using the compliance center

To set as default (or remove the default) from compliance projects report:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Projects tab.
  4. Hover over a compliance framework, select the Edit Framework tab.
  5. Select Set as default.
  6. Select Save changes.

To set as default (or remove the default) from compliance framework report:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Frameworks tab.
  4. Hover over a compliance framework, select the Edit Framework tab.
  5. Select Set as default.
  6. Select Save changes.

Remove a compliance framework from a project

To remove a compliance framework from one or multiple project in a group, remove the compliance framework through the Compliance projects report.

Import and export compliance frameworks

History

Download existing compliance frameworks as JSON files and upload new frameworks from JSON templates.

A library of JSON templates is available from the Compliance Adherence Templates project. Use these templates to quickly adopt predefined compliance frameworks.

Export a compliance framework as a JSON file

With this feature, you can share and back up compliance frameworks.

To export a compliance framework from the compliance center:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Frameworks tab.
  4. Locate the compliance framework you wish to export.
  5. Select the vertical ellipsis ( ellipsis_v ).
  6. Select Export as JSON file.

The JSON file is downloaded to your local system.

Import a compliance framework from a JSON file

With this feature, you can use shared or backed up compliance frameworks. The JSON file must not have the same name as an existing compliance framework.

To import a compliance framework by using a JSON template:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Frameworks tab.
  4. Select New framework.
  5. Select Import framework.
  6. In the dialog that appears, select the JSON file from your local system.

If the import is successful, the new compliance framework appears in the list. Any errors are displayed for correction.

Requirements

  • Tier: Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
History

In GitLab Ultimate, you can define specific requirements for a compliance framework. Requirements are made up of one or more controls, which are checks against the configuration or behavior of projects that are assigned the framework. There is maximum of 5 controls per requirement.

Each control includes logic that GitLab uses during scheduled or triggered scans to evaluate a project’s adherence. For more details on how adherence is tracked, see Compliance status report.

You can use GitLab compliance controls or external controls for framework requirements.

GitLab compliance controls

GitLab compliance controls can be used in GitLab compliance frameworks. Controls are checks against the configuration or behavior of projects that are assigned to a compliance framework.

Combine GitLab compliance controls to help you meet compliance standards.

Control nameControl IDDescription
API security runningscanner_api_security_runningEnsures that API security scanning is configured and running in the project’s default branch pipeline.
At least one approvalminimum_approvals_required_1Ensures that merge requests require at least one approvals before merging.
At least two approvalsminimum_approvals_required_2Ensures that merge requests require at least two approvals before merging.
Auth SSO enabledauth_sso_enabledEnsures that Single Sign-On (SSO) authentication is enabled for the project.
Author approved merge request is forbiddenmerge_request_prevent_author_approvalEnsures that the author of a merge request cannot approve their own changes.
Branch deletion disabledbranch_deletion_disabledEnsures that branches can’t be deleted.
CI/CD job token scope enabledcicd_job_token_scope_enabledEnsures that CI/CD job token scope restrictions are enabled.
Code changes requires code ownerscode_changes_requires_code_ownersEnsures that code changes require approval from code owners.
Code owner approval requiredcode_owner_approval_requiredEnsures that code owners file is configured.
Code quality runningscanner_code_quality_runningEnsures that code quality scanning is configured and running in the project’s default branch pipeline.
Committers approved merge request is forbiddenmerge_request_prevent_committers_approvalEnsures that users who have committed to a merge request cannot approve it.
Container scanning runningscanner_container_scanning_runningEnsures that container scanning is configured and running in the project’s default branch pipeline.
DAST runningscanner_dast_runningEnsures that Dynamic Application Security Testing (DAST) is configured and running in the project’s default branch pipeline.
Default branch protecteddefault_branch_protectedEnsures that the default branch has protection rules enabled.
Default branch protected from direct pushdefault_branch_protected_from_direct_pushPrevents direct pushes to the default branch.
Default branch users can mergedefault_branch_users_can_mergeControls whether users can merge changes to the default branch.
Default branch users can pushdefault_branch_users_can_pushControls whether users can push directly to the default branch.
Dependency scanning runningscanner_dep_scanning_runningEnsures that dependency scanning is configured and running in the project’s default branch pipeline.
Ensure two administrators per repositoryensure_2_admins_per_repoEnsures that at least two administrators are assigned to each repository.
Error tracking enablederror_tracking_enabledEnsures that error tracking is enabled for the project.
Force push disabledforce_push_disabledPrevents force pushing to repositories.
Forks exist for the projecthas_forksEnsures that the project has been forked
Fuzz testing runningscanner_fuzz_testing_runningEnsures that fuzz testing is configured and running in the project’s default branch pipeline.
GitLab license level Ultimategitlab_license_level_ultimateEnsures that the GitLab instance is using an Ultimate license.
Has valid CI/CD configurationhas_valid_ci_configEnsures that the project has a valid CI/CD configuration.
IaC scanning runningscanner_iac_runningEnsures Infrastructure as Code (IaC) scanning is configured and running in the project’s default branch pipeline.
Internal visibility is forbiddenproject_visibility_not_internalEnsures that projects are not set to internal visibility.
Issue tracking enabledissue_tracking_enabledEnsures that issue tracking is enabled for the project.
License compliance runningscanner_license_compliance_runningEnsures that license compliance scanning is configured and running in the project’s default branch pipeline.
Merge request commit reset approvalsmerge_request_commit_reset_approvalsEnsures that new commits to merge requests reset approvals.
Merge requests approval rules prevent editingmerge_requests_approval_rules_prevent_editingEnsures that merge request approval rules can’t be edited.
Merge requests require code owner approvalmerge_requests_require_code_owner_approvalEnsures that merge requests require approval from code owners.
More members than adminsmore_members_than_adminsEnsures fewer administrators are assigned to the project than total members.
Package Hunter no findings untriagedpackage_hunter_no_findings_untriagedEnsures that all Package Hunter findings are triaged.
Project not archivedproject_archivedChecks whether the project is archived. Typically false is compliant.
Project not marked for deletionproject_marked_for_deletionChecks whether the project is marked for deletion. false is compliant.
Project pipelines not publicproject_pipelines_not_publicEnsures that project pipelines are not publicly visible.
Project repository existsproject_repo_existsEnsures that a Git repository exists for the project.
Project visibility not publicproject_visibility_not_publicEnsures that projects are not set to public visibility.
Protected branches existprotected_branches_setEnsures that project contains protected branches.
Push protection enabledpush_protection_enabledEnsures that push protection is enabled for sensitive files.
Require branch up to daterequire_branch_up_to_dateEnsures that the source branch is up to date with the target branch before merging.
Require linear historyrequire_linear_historyEnsures a linear commit history by forbidding merge commits.
Require MFA at organization levelrequire_mfa_at_org_levelEnsures that multi-factor authentication is required at the organization level.
Require MFA for contributorsrequire_mfa_for_contributorsEnsures that contributors have multi-factor authentication enabled.
Requires signed commitsrequire_signed_commitsEnsures that signed commits are required.
Reset approvals on pushreset_approvals_on_pushEnsures that approvals are reset when new commits are pushed to the merge request.
Resolve discussions requiredresolve_discussions_requiredEnsures that all discussions must be resolved before merging is allowed.
Restrict push/merge accessrestrict_push_merge_accessRestricts who can push to or merge into protected branches.
Restricted build accessrestricted_build_accessEnsures restricted access to build artifacts and pipeline outputs.
Review and archive stale repositoriesreview_and_archive_stale_reposEnsures that stale repositories are reviewed and archived.
Review and remove inactive usersreview_and_remove_inactive_usersEnsures that inactive users are reviewed and removed.
SAST runningscanner_sast_runningEnsures that Static Application Security Testing (SAST) is configured and running in the project’s default branch pipeline.
Secret detection runningscanner_secret_detection_runningEnsures that secret detection scanning is configured and running in the project’s default branch pipeline.
Secure webhookssecure_webhooksEnsures that webhooks are securely configured.
Stale branch cleanup enabledstale_branch_cleanup_enabledEnsures that automatic cleanup of stale branches is enabled.
Status checks requiredstatus_checks_requiredEnsures that status checks must pass before merging is allowed.
Status page configuredstatus_page_configuredEnsures that a status page is configured for the project.
Strict Permission for Repositorystrict_permissions_for_repoEnsures that strict permissions are set for repository access.
Terraform enabledterraform_enabledEnsures that the Terraform integration is enabled for the project.
User-defined CI/CD variables restricted to maintainersproject_user_defined_variables_restricted_to_maintainersEnsures that only users with the maintainer role or higher can pass user-defined variables when triggering pipelines.
Vulnerabilities SLO days over thresholdvulnerabilities_slo_days_over_thresholdEnsures that vulnerabilities are addressed inside SLO thresholds (180 days).

External controls

History

External controls are API calls to external systems that request the status of an external control or requirement.

You can create a external control that sends data to third-party tools.

When the compliance scans are run, GitLab sends a notification. The users or automated workflows can then update the status of control from outside of GitLab.

With this integration, you can integrate with third-party workflow tools, like ServiceNow, or the custom tool of your choice. The third-party tool responds with an associated status. This status is then displayed in the Compliance status report.

You can configure external controls for each individual project. External controls are not shared between projects. Status checks fail if an external control stays in the pending state for more than six hours.

Add external controls

To add an external control when creating or editing a framework:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Frameworks tab.
  4. Select New framework or edit an existing one.
  5. In the Requirements section, select New requirement.
  6. Select Add an external control.
  7. In the fields edit External Control Name, External URL and HMAC shared secret.
  8. Select Save changes to the framework to save the requirement.

External control lifecycle

External controls have an asynchronous workflow. Compliance scans emit a payload to an external service whenever.

sequenceDiagram
    GitLab->>+External service: Requirement payload
    External service-->>-GitLab: Control response
    Note over External service,GitLab: Response includes SHA at HEAD

After the payload is received, the external service can run any required processes. The external service can then post its response back to the merge request by using the REST API.

External controls can have one of three statuses.

StatusDescription
pendingDefault status. No response received from the external service.
passResponse received from the external service and the external control was approved by the external service.
failResponse received from the external service and the external control was denied by the external service.

If something changes outside of GitLab, you can set the status of an external control by using the API. You don’t need to wait for a payload to be sent first.

Add requirements

To add a requirement when creating or editing a framework:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Frameworks tab.
  4. Select New framework or edit an existing one.
  5. In the Requirements section, select New requirement.
  6. In the dialog add Name and Description.
  7. Select Add a GitLab control to add more controls.
  8. In the control dropdown list search and select a control.
  9. Select Save changes to the framework to save the requirement.

Edit requirements

To edit a requirement when creating or editing a framework:

  1. On the left sidebar, select Search or go to and find your group.
  2. Select Secure > Compliance center.
  3. On the page, select the Frameworks tab.
  4. Select New framework or edit an existing one.
  5. In the Requirements section, select Action > Edit.
  6. In the dialog edit Name and Description.
  7. Select Add a GitLab control to add more controls.
  8. In the control dropdown list search and select a control.
  9. Select remove to remove a control.
  10. Select Save changes to the framework to save the requirement.

Troubleshooting

When working with compliance frameworks, you might encounter the following issues.

Error: Unable to determine the correct upload URL

You will encounter this error during a compliance framework import if a compliance framework already exists with the same name as the JSON template.