Enable security_policy_approval_warn_mode by default

What does this MR do and why?

This releasees the security policy warn mode feature as beta

References

Related epic: &15552 (closed)

Screenshots or screen recordings

How to set up and validate locally

  1. Enable the feature flag echo "Feature.enable(:security_policy_approval_warn_mode)" | rails c
  2. Create a new project.
  3. On the left sidebar, select Secure and Policies.
  4. Select New policy.
  5. Select Scan execution policy.
  6. Enter a name and select Create new project with the new policy.
  7. Merge the MR
  8. Go back to the first project
  9. On the left sidebar, select Secure and Policies again.
  10. Select New policy.
  11. Select Merge request approval policy
  12. Switch to .yaml mode
  13. Paste the following config:
    approval_policy:
      - name: MR - Security Scan
        description: Security Scan
        enabled: true
        enforcement_type: warn
        rules:
          - type: scan_finding
            scanners:
              - secret_detection
            vulnerabilities_allowed: 0
            severity_levels: []
            vulnerability_states: []
            branch_type: protected
        actions:
          - type: require_approval
            approvals_required: 1
            role_approvers:
              - developer
              - maintainer
              - owner
          - type: send_bot_message
            enabled: true
        approval_settings:
          block_branch_modification: false
          prevent_pushing_and_force_pushing: false
          prevent_approval_by_author: false
          prevent_approval_by_commit_author: false
          remove_approvals_with_new_commit: false
          require_password_to_approve: false
        fallback_behavior:
          fail: open
    
  14. Select Configure with a merge request
  15. Merge the MR
  16. Back to the first project. Create an MR introducing a vulnerability. Add a file .env with the following content:
    AWS_TOKEN='AKIAZYONPI3G4JNCCWGA'
  17. Wait for the merge request pipeline to complete
  18. The MR should be blocked by the new policies
  19. Select Bypass next to the violated policy in the MR widget
  20. Select your policy, enter a reason and comment and select Bypass again
  21. Reload the page to refresh the MR widget
  22. Merge the MR
  23. Wait for the default branch pipeline to complete
  24. On the left sidebar, select Secure and Vulnerability report.
  25. Select the AWS access token vulnerability
  26. The dismissed policy should show up on the page.

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.

Related to #505352 (closed)

Merge request reports

Loading
Loading