doc/api/compliance_policy_settings.md
{{< details >}}
{{< /details >}}
{{< history >}}
security_policies_csp. Disabled by default.security_policies_csp removed.{{< /history >}}
Use this API to interact with the security policy settings for your GitLab instance.
Prerequisites:
Retrieves the current security policy settings for this GitLab instance.
GET /admin/security/compliance_policy_settings
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/admin/security/compliance_policy_settings"
Example response:
{
"csp_namespace_id": 42
}
When no CSP namespace is configured:
{
"csp_namespace_id": null
}
Updates the security policy settings for this GitLab instance.
PUT /admin/security/compliance_policy_settings
| Attribute | Type | Required | Description |
|---|---|---|---|
csp_namespace_id | integer | yes | ID of the group designated to centrally manage security policies. Must be a top-level group. Set to null to clear the setting. |
curl --request PUT \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-Type: application/json" \
--data '{"csp_namespace_id": 42}' \
--url "https://gitlab.example.com/api/v4/admin/security/compliance_policy_settings"
Example response:
{
"csp_namespace_id": 42
}