Skip to content

GitGuardian

DETAILS: Tier: Premium, Ultimate Offering: SaaS, self-managed Status: Beta

FLAG: On self-managed GitLab, by default this feature is not available. To make it available, an administrator can enable the feature flag named git_guardian_integration. On GitLab.com, this feature is not available. This feature is not ready for production use.

GitGuardian is a cybersecurity service that detects sensitive data such as API keys and passwords in source code repositories. It scans Git repositories, alerts on policy violations, and helps organizations fix security issues before hackers can exploit them.

You can configure GitLab to reject commits based on GitGuardian policies.

This feature is in Beta and subject to change without notice.

To set up the GitGuardian integration:

  1. Create a GitGuardian API token.
  2. Set up the GitGuardian integration for your project.

Create a GitGuardian API token

Prerequisites:

  • You must have a GitGuardian account.

To create an API token:

  1. Sign in to your GitGuardian account.
  2. Go to the API section in the sidebar.
  3. In the API section sidebar go to Personal access tokens page.
  4. Select Create token. The token creation dialog opens.
  5. Provide your token information:
    • Give your API token a meaningful name to identify its purpose. For example, GitLab integration token.
    • Select an appropriate expiration.
    • Select the scan scope checkbox. It is the only one needed for the integration.
  6. Select Create token.
  7. After you've generated a token, copy it to your clipboard. This token is sensitive information, so keep it secure.

Now you have successfully created a GitGuardian API token that you can use to for our integration.

Set up the GitGuardian integration for your project

Prerequisites:

  • You must have at least the Maintainer role for the project.

After you have created and copied your API token, configure GitLab to reject commits:

To enable the integration for your project:

  1. On the left sidebar, select Search or go to and find your project or group.
  2. Select Settings > Integrations.
  3. Select GitGuardian.
  4. In Enable integration, select the Active checkbox.
  5. In API token, paste the token value from GitGuardian.
  6. Optional. Select Test settings.
  7. Select Save changes.

GitLab is now ready to reject commits based on GitGuardian policies.