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

Simplify v6 distribution material #2277

Merged
merged 6 commits into from
Nov 26, 2024
Merged

Simplify v6 distribution material #2277

merged 6 commits into from
Nov 26, 2024

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Nov 21, 2024

This PR makes adjustments to the v6 schema + supporting code from previous PRs, specifically:

  • adjusts DB import to function with both today's and v6 schema automatically
  • add application config support to create v6 distribution client and installation curator config objects
  • removes the metadata.json file; now there is only the DB file in the distributed tarball
  • removes checksum from db.Distribution struct
  • makes the latest.json file flat (no nested objects)
  • adjusts the vulnerability blob such that "assigner" is plural (matches the type)
  • adds CHML severity scheme (will be used by the github provider)

This PR also introduces the ability to import both v6 and v5 schemas at once (since import now functions in both contexts) which requires disabling the static analysis check for cross-import of schemas.

@wagoodman wagoodman marked this pull request as ready for review November 21, 2024 18:11
Signed-off-by: Alex Goodman <[email protected]>
@wagoodman wagoodman added the changelog-ignore Don't include this issue in the release changelog label Nov 25, 2024
@wagoodman wagoodman self-assigned this Nov 25, 2024
@wagoodman wagoodman requested review from a team and removed request for kzantow November 25, 2024 19:10
@@ -57,6 +60,11 @@ const (
NotAffectedFixStatus FixStatus = "not-affected"
)

const (
// AdvisoryReferenceTag is a reference to a vulnerability advisory
AdvisoryReferenceTag string = "advisory"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be more of these?

Copy link
Contributor

Choose a reason for hiding this comment

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

A reference tag is a string we expect to be used often to tag a reference in https://github.com/anchore/grype/blob/main/grype/db/v6/blobs.go#L51.

What's an Advisory exactly? For example, a Red Hat Security Advisory (RHSA) is a list of patches, but a GitHub Security Advisory is a vulnerability description. Is advisory the right tag name? What kind of links or going to be tagged with this tag name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'll add these in another PR, but agree with the overall question

@willmurphyscode
Copy link
Contributor

FYI, I re-ran the acceptance tests because they failed after a small commit with 502: bad gateway, so I assumed a transient network fault. We'll see if they pass on retry.

@wagoodman wagoodman enabled auto-merge (squash) November 26, 2024 20:04
}
}
// override the checksum validation setting to ensure the checksum is always validated
digest, validateErr := c.validate(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this makes it so grype db status always validates the checksum, so that it can report if the db has been edited since it was fetched. Is that right?

If so, minor nit, the comment should say something like "grype db status should always validate"; right now the comment doesn't tell me why we're not passing the config setting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

righto -- I'll incorporate into another followup PR (this was automerged)

@wagoodman wagoodman merged commit cbcf174 into main Nov 26, 2024
10 checks passed
@wagoodman wagoodman deleted the v6-adjustments branch November 26, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-ignore Don't include this issue in the release changelog
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants