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

Severity in vulnerability report does not comply with OpenAPI spec #20

Open
mleegwt opened this issue Aug 15, 2024 · 0 comments
Open

Severity in vulnerability report does not comply with OpenAPI spec #20

mleegwt opened this issue Aug 15, 2024 · 0 comments

Comments

@mleegwt
Copy link

mleegwt commented Aug 15, 2024

Expected behavior and actual behavior:
When retrieving the vulnerabilities report I expect a valid report when there are no vulnerabilities.
Currently the report is:

{
  "application/vnd.security.vulnerability.report; version=1.1": {
    "generated_at": "2024-08-14T00:01:24.636385855Z",
    "scanner": {
      "name": "Trivy",
      "vendor": "Aqua Security",
      "version": "v0.51.2"
    },
    "severity": "",
    "vulnerabilities": []
  }
}

That is invalid in the severity field: This is an enum field. "" is not a valid value for that enum.
I suggest modifying the OpenAPI specification for by either making severity optional in the HarborVulnerabilityReport field or choose a value to report as the severity, e.g. Negligible. This issue applies to all current scanner-adapter-openapi-*.yaml files.

Steps to reproduce the problem:
In Harbor: Search for a container image without vulnerabilities. Navigate to that image, in the background the retrieval of
https://<host>/api/v2.0/projects/<project>/repositories/<container>/artifacts/<sha>/additions/vulnerabilities is performed. This results in the JSON posted above.

Versions:

  • harbor version: v2.11.0-70255684
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

No branches or pull requests

1 participant