doc/user/project/integrations/git_guardian.md
{{< details >}}
{{< /details >}}
{{< history >}}
git_guardian_integration. Enabled by default. Disabled on GitLab.com.git_guardian_integration removed.{{< /history >}}
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.
To set up the GitGuardian integration:
Prerequisites:
To create an API token:
GitLab integration token.Now you have successfully created a GitGuardian API token that you can use to for our integration.
Prerequisites:
After you have created and copied your API token, configure GitLab to reject commits:
To enable the integration for your project:
GitLab is now ready to reject commits based on GitGuardian policies.
{{< history >}}
{{< /history >}}
You can skip GitGuardian secret detection, if needed. The options to skip secret detection for all commits in a push are identical to the options for native secret detection. Either:
[skip secret push protection] to one of the commit messages.secret_push_protection.skip_all push option.Troubleshooting steps below show how to mitigate some of these problems.
When working with the GitGuardian integration, you might encounter the following issues.
500 HTTP errorsYou might get an HTTP 500 error.
This issue occurs for when requests time out for commits with a lot of changed files.
If this issue happens when you change more than 50 files in a commit:
Filename: ensure this value has at most 256 charactersYou might get an HTTP 400 error that states Filename: ensure this value has at most 256 characters.
This issue occurs when some of the changed files you are pushing in that commit have the filename (not the path) longer then 256 characters.
The workaround is to shorten the filename if possible. For example, if the filename cannot be shortened because it was automatically generated by a framework, disable the integration and try to push again. Don't forget to re-enable the integration afterwards if needed.