Refactor vulnerability policy to move SAST check
What does this MR do and why?
This MR refactors the Vulnerability policy to move the AI_ALLOWED_REPORT_TYPES
check out of the policy and into the Finding, so it will work in the same way the ai_resolution_available?
/ aiResolutionAvailable
checks work. This will make it possible to use the ability checks on both the individual and list views.
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.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Manual Checks
Since this change applies to the access policy I'm adding the manual checks from #478761
Pick one of this demo project to clone:
- https://staging.gitlab.com/govern-team-test/oxeye-rulez (recommended)
- https://gitlab.com/gitlab-examples/security/security-reports
- https://gitlab.com/gitlab-org/govern/threat-insights-demos/webgoat.net
A. Vulnerability Explanation
- Click on a SAST vulnerability
- Click on "Explain with AI"
- It triggers the duo chat drawer calling the
/vulnerability_explain
command - It successfully display the AI response
-
Verified
B. Vulnerability Resolution
- Enable the FF
vulnerability_resolution_ga
(should already be on by default) - Click on a SAST vulnerability
For high confidence CWE:
- It displays the button "Resolve with AI"
- When clicked, it creates the AI generated MR
-
Verified
For all other SAST:
- It displays the button "Resolve with AI"
- It is in a disabled state and has a "Learn more" link
-
Verified
C. Vulnerability Resolution (Experiment)
- Disable the FF
vulnerability_resolution_ga
- Click on a SAST vulnerability
- It displays the experiment button "Resolve with merge request (experiment)"
- When clicked, it creates the AI generated MR
-
Verified