Skip to content

Pre_receive_secret_detection_enabled changed project level audit event

Serena Fang requested to merge audit-events-project-toggle-secret-detection into master

What does this MR do and why?

#457024 (closed)

Create audit event when pre-receive secret detection is enabled/disabled at project level.

Creates project_security_setting_updated.yml so that other project security settings can use the same audit event type.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

(it says 'by Administrator' here because I was impersonating the user) image

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Make sure you have an Ultimate license.

  1. In the rails console:
pry(main)> Gitlab::CurrentSettings.update!(pre_receive_secret_detection_enabled: true) # to ensure feature is enabled instance-wide
pry(main)> Feature.enable(:pre_receive_secret_detection_beta_release)

pry(main)> user = User.first
pry(main)> project = Project.find(PROJECT_ID)
pry(main)> Feature.enable(:pre_receive_secret_detection_push_check, project) 
pry(main)> Security::Configuration::SetPreReceiveSecretDetection.execute(current_user: user, namespace: project, enable: true)
pry(main)> Security::Configuration::SetPreReceiveSecretDetection.execute(current_user: user, namespace: project, enable: false)
  1. Navigate to Secure > Audit Events
  2. Check that the Audit Events appear as in the above screenshot
Edited by Serena Fang

Merge request reports