Rename log file for Secret push protection
Related issue: #462289 (closed)
What does this MR do and why?
We are renaming the log events file used for Secret Push Protection feature from secret-detection.log
to secret_push_protection.log
. This is done to better reflect the feature's name.
Context: The feature was recently renamed from Pre-receive Secret Detection to Secret Push Protection.
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.
N/A
How to set up and validate locally
- Enable Secret push protection feature
pry(main)> Gitlab::CurrentSettings.update!(pre_receive_secret_detection_enabled: true) # to ensure feature is enabled instance-wide
pry(main)> project = Project.find(PROJECT_ID)
pry(main)> Feature.enable(:pre_receive_secret_detection_push_check, project)
OR apply this patch to disable checks
diff --git a/ee/lib/gitlab/checks/secrets_check.rb b/ee/lib/gitlab/checks/secrets_check.rb
index 00b6743998d7..810354d7889e 100644
--- a/ee/lib/gitlab/checks/secrets_check.rb
+++ b/ee/lib/gitlab/checks/secrets_check.rb
@@ -93,8 +93,7 @@ def validate!
# GitLab.com projects. For progress, follow
# https://gitlab.com/groups/gitlab-org/-/epics/12729
def run_pre_receive_secret_detection?
- Gitlab::CurrentSettings.current_application_settings.pre_receive_secret_detection_enabled &&
- (enabled_for_gitlabcom_project? || enabled_for_dedicated_project?)
+ true
end
def enabled_for_gitlabcom_project?
- In the GDK setup, locate the new log file name at
gitlab/log/secret_push_protection.log
Edited by Dheeraj Joshi