Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve vuln report verifier report messages #1238

Merged

Conversation

akashsinghal
Copy link
Collaborator

@akashsinghal akashsinghal commented Dec 27, 2023

Description

What this PR does / why we need it:

  • Updates vuln report verifier report message to be more user friendly

Sample Deny List CVE message:

{
      "subject": "artifactstest.azurecr.io/vuln/alpine:3.18.2",
      "isSuccess": false,
      "name": "vulnerabilityreport",
      "message": "Validation failed: found denied CVEs. See extensions field for details.",
      "extensions": {
        "createdAt": "2023-10-13T22:22:50Z",
        "denylistCVEs": [
          "CVE-2022-48174-busybox"
        ],
        "scanner": "grype",
        "cveViolations": [
          "cve-2022-48174-busybox"
        ]
      },
      "artifactType": "application/sarif+json"
}

Sample disallowed severity message:

{
      "subject": "artifactstest.azurecr.io/vuln/alpine:3.18.2",
      "isSuccess": false,
      "name": "vulnerabilityreport",
      "message": "Validation failed: found disallowed severities. See extensions field for details.",
      "extensions": {
        "createdAt": "2023-10-13T21:16:58Z",
        "disallowedSeverities": [
          "critical"
        ],
        "scanner": "trivy",
        "severityViolations": {
          "CVE-2022-48174": "critical"
        }
      },
      "artifactType": "application/sarif+json"
}

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):

Fixes #

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Helm Chart Change (any edit/addition/update that is necessary for changes merged to the main branch)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • Does the affected code have corresponding tests?
  • Are the changes documented, not just with inline documentation, but also with conceptual documentation such as an overview of a new feature, or task-based documentation like a tutorial? Consider if this change should be announced on your project blog.
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have appropriate license header?

Post Merge Requirements

  • MAINTAINERS: manually trigger the "Publish Package" workflow after merging any PR that indicates Helm Chart Change

@akashsinghal akashsinghal changed the title Akashsinghal/improvevulnerrors fix: improve vuln report verifier report messages Dec 27, 2023
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (23b143d) 61.43% compared to head (c7a8739) 61.44%.

Files Patch % Lines
...rifier/vulnerabilityreport/vulnerability_report.go 89.28% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1238      +/-   ##
==========================================
+ Coverage   61.43%   61.44%   +0.01%     
==========================================
  Files          97       97              
  Lines        6179     6181       +2     
==========================================
+ Hits         3796     3798       +2     
  Misses       2051     2051              
  Partials      332      332              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yizha1
Copy link
Collaborator

yizha1 commented Jan 3, 2024

@akashsinghal

My proposals for the message:

  1. Validation failed: found denied CVEs. See extensions field for details.
  2. Validation failed: found disallowed severities. See extensions field for details.

One more comment about the name of the field

Maybe we can also align the name between violatingCVEs and severityViolations. Either name both of them as violations or separately cveViolations and severityViolations

@akashsinghal akashsinghal marked this pull request as ready for review January 4, 2024 19:22
@akashsinghal
Copy link
Collaborator Author

@yizha1 thanks for the suggestions. I have incorporated the message exactly as you had suggested. I've updated the sample outputs in the description of the PR. Please take a look when you have a chance. Thanks.

Copy link
Collaborator

@susanshi susanshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. thanks

@akashsinghal akashsinghal enabled auto-merge (squash) January 4, 2024 23:56
@akashsinghal akashsinghal merged commit b2bf323 into ratify-project:main Jan 5, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants