packit-service icon indicating copy to clipboard operation
packit-service copied to clipboard

Add configurations for CI to fail on OSH scan failures and new findings

Open siteshwar opened this issue 1 year ago • 6 comments

This is a follow up on https://github.com/packit/packit/discussions/2371#discussioncomment-10474198

We should add two separate configuration options to cause CI to fail on scan failures and new findings:

  • fail_ci_on_scan_failure should cause CI to become red if OSH scan fails.
  • fail_ci_on_new_findings should cause CI to become red on new findings.

Both of these options should be kept false by default. Because there may be issues with buildroot that can cause a scan to fail, or there may be large amount of false positives for certain projects.

siteshwar avatar Sep 05 '24 09:09 siteshwar

Thanks @siteshwar for writing this down.

As a first thing, we need to resolve the reporting in general: https://github.com/packit/packit-service/issues/2516

lachmanfrantisek avatar Sep 05 '24 10:09 lachmanfrantisek

I would probably prefer blocking attribute… On GitHub we could set non-blocking to neutral status, if it fails (that doesn't block merging)

mfocko avatar Sep 05 '24 11:09 mfocko

  • fail_ci_on_new_findings should cause CI to become red on new findings.

On a second thought, the status should not be "fail", it should be "action_required" on new findings. Also, it should be "neutral" if there is a new finding, but the CI is not configured to fail.

siteshwar avatar Sep 10 '24 09:09 siteshwar

This may be more complicated then it looked initially, as we plan to upload SARIF to CodeQL and it has its own checks for severity of the findings that determines the status of the CI.

siteshwar avatar Sep 24 '24 15:09 siteshwar

Can't the CodeQL replace the checks? :thinking:

mfocko avatar Sep 24 '24 20:09 mfocko

Can't the CodeQL replace the checks? 🤔

It seems configurable, but the default setting hides results from the user.

We can only keep the osh-diff-scan check and avoid uploading to CodeQL. Check should directly reference the final html report from OpenScanHub.

siteshwar avatar Sep 25 '24 09:09 siteshwar

On a second thought, the status should not be "fail", it should be "action_required" on new findings. Also, it should be "neutral" if there is a new finding, but the CI is not configured to fail.

It should be probably renamed to "action_required_on_new_findings".

siteshwar avatar Nov 12 '24 08:11 siteshwar

A note from today's meeting, we might want to consider having this for all the jobs.

lachmanfrantisek avatar Nov 14 '24 11:11 lachmanfrantisek