这是indexloc提供的服务,不要输入任何密码
Skip to content

Hide on-demand scan edit without push permission

What does this MR do and why?

Hide on-demand scan edit without push permission

Don't show edit action for site profiles, scanner profiles, and
on-demand scans when user doesn't have permission to edit them
Render 403 instead of 404 if they navigate to the page anyway

References

Screenshots or screen recordings

Before After

How to set up and validate locally

reproduce the bug 🐛

  1. git checkout master
  2. go to a project, create some-branch
  3. in Settings => Repository => Branch rules, configure a rule for some-branch that doesn't allow you to push to it
  4. go to a project => Secure => On-demand scans => New scan
  5. create an on-demand scan with Scan configuration => Branch set to some-branch
  6. (you'll also need to name your scan, create a scanner profile, and create a site profile to save the scan)
  7. clicking any of these actions will lead to a 404: 🐛
    • project => Secure => On-demand scans => Scan library tab => next to the scan you created => Edit
    • project => Secure => Security configuration => Dynamic Application Security Testing (DAST) => Manage profiles
      • Site profiles tab => next to the site profile you created => Edit
      • Scanner profiles tab => next to the scanner profile you created => Edit

test the fix 🛠️

  1. git checkout 513374-fix-404-for-dast-paths
  2. these actions should be hidden for the items you don't have permission to edit:
    • project => Secure => On-demand scans => Scan library tab => next to the scan you created => Edit
    • project => Secure => Security configuration => Dynamic Application Security Testing (DAST) => Manage profiles
      • Site profiles tab => next to the site profile you created => Edit
      • Scanner profiles tab => next to the scanner profile you created => Edit

MR acceptance checklist

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

Edited by Miranda Fluharty

Merge request reports

Loading