Configuring secret push protection

Problem to solve

I want to enable de setting “Allow secret push protection” but not use the GUI for this. Is it possible to use Gitlab Rails or the API

Steps to reproduce

Configuration

Versions

Please add an x whether options apply, and add the version information.

  • [X ] Self-managed 17.9

Thanks in advance.

According to the GitLab documentation:

On GitLab Self-Managed instances, you must:

  1. Allow secret push protection on the entire instance.

  2. Enable secret push protection per project.

I’m not sure of a way we can enable it on the entire instance without using GUI.

But to enable it per project using the API, you can use the following:

Update secret_push_protection_enabled setting

Update secret_push_protection_enabled setting

Hope it helps!

Thanks for the feedback. That’s what I also found in the documentation. I’m looking for a way to enable this setting in a more programmatic way so that this configuration can be stored in git when deploying a new instance.