Integrations leaking emails in WebHook Logs detail page
Summary
While testing integrations' WebHook (DroneCi
), I came across that some logs contain multiple commits data (author's email included and not redacted).
Steps to reproduce
- Go to the Integrations page of a project
- Select an integration with a WebHook (e.g. DroneCi) and test the configuration
- Click on
View details
of the webhook created - Scroll down to the request part and validate that emails are visible
What is the current bug behavior?
Committers' emails are visible
What is the expected correct behavior?
The emails should be redacted
Relevant logs and/or screenshots
[Image redacted]
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Update the redact_author_email
method with the code bellow
def redact_author_email
self.request_data.deep_transform_values! do |value|
value =~ URI::MailTo::EMAIL_REGEXP ? _('[REDACTED]') : value
end
end
/cc @arturoherrero as the EM
Edited by Nick Malcolm