[New Audit Event]: Audit event missing when renaming CI/CD variable
Summary
When adding and deleting a CI/CD variable, an audit event is created, which is great.
Yet if one modifies the name of the variable, no audit event is tracking this, so the audit log is confusing.
This can even be abused by creating a variable with name A, then rename it to the target name, run some pipelines, and then rename the variable back before deleting it, which leaves no trace of the use of the variable, I think.
Steps to reproduce
- go to Settings, then CI/CD variables
- create a new variable
- go to Audit, see the event "variable created"
- back to CI/CD variables, edit the variable, change its name
- go to Audit, no event "variable renamed" :-(
- back to CI/CD variables, delete the variable
- go to Audit, event "variable deleted" with the new name :-/, confusing, as deleted but never created
Example Project
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs and/or screenshots
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
Edited by Sam Kerr