Group security settings API

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

Every API call to group security settings must be authenticated.

If a user isn’t a member of a private group, requests to the private group return a 404 Not Found status code.

Update the secret_push_protection_enabled setting

Updates the secret_push_protection_enabled setting for all projects in a specified group.

Prerequisites:

  • You must have at least the Maintainer role for the group.
PUT /groups/:id/security_settings
AttributeTypeRequiredDescription
idinteger or stringYesID or URL-encoded path of a group.
secret_push_protection_enabledbooleanYesEnables secret push protection for projects in the group.
projects_to_excludearray of integersNoIDs of projects to exclude from secret push protection.
curl --request PUT \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/groups/7/security_settings?secret_push_protection_enabled=true&projects_to_exclude[]=1&projects_to_exclude[]=2"

Example response:

{
  "secret_push_protection_enabled": true,
  "errors": []
}