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

Add support for Package URLs #397

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

alilleybrinker
Copy link

@alilleybrinker alilleybrinker commented Apr 1, 2025

(Depends on #391; will need to be rebased on develop if/when that is merged, before this can be merged)

Introduce support for Package URLs in the CVE record format.

For more background on the topic of software identification, review CISA's "Software Identification Ecosystem Option Analysis" paper.

Warning

When reviewing, focus on the last commit. This is a "Stacked PR," on top of #391, but GitHub shows both the commit making the cpeApplicability structure generic (from #391) and the commit adding purls (the part we care about here), when you click "Files changed" at the top of the PR, making review harder.

alilleybrinker and others added 2 commits April 1, 2025 15:30
This "renames" (not actually a rename, see below) the existing
"cpeApplicability" structure and its children from CPE-specific names
to generic names. For example, "cpeApplicability" becomes "applicability."

This is intended to permit future record format updates to add support for
additional kinds of software identifiers. This change itself does not add
any new kinds of software identifiers.

The prior "cpeApplicability" structure remains entirely supported, though
CNAs and any future ADPs enriching with software ID information should be
encouraged to use the more expressive new "applicability" structure instead,
and use of both at the same time should be treated as an error to avoid
ambiguity.

Signed-off-by: Andrew Lilley Brinker <[email protected]>
Signed-off-by: Andrew Lilley Brinker <[email protected]>
@pombredanne
Copy link

@alilleybrinker re:

Introduce support for OmniBOR Artifact IDs in the CVE record format.
You meant PURL here, right?

@pombredanne
Copy link

Also questions originally posted by @alilleybrinker in #391 (comment)_

Feedback from QWG meeting:

  • Constrain the purl schema to explicitly disallow version information.
    • Would this demand vendoring the purl spec?

What do you mean?

  • How to handle the purl generic type?

There is nothing super special about it. What's at issue?

  • Also a complexity with the go type, where the purl spec doesn't match Go's expressiveness (purl is case-insensitive while Go is case-sensitive)

This is a bug in the spec. It will be fixed.

  • How does this relate to the affected block, which also encodes version information?

Not sure if this is relevant, but we have a version range spec in PURL: The namespace and name must be lowercased.

{
"anyOf": [
{ "required": ["cpeMatch"] },
{ "required": ["purlMatch"] }

Choose a reason for hiding this comment

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

Why not use purl_match?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, this appears to be a naming error. Will correct it.

"type": "boolean"
},
"criteria": {
"description": "Placeholder until we find a formal purl schema",

Choose a reason for hiding this comment

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

Can you elaborate?

]
},
"purl_match": {
"description": "purl match string or range",

Choose a reason for hiding this comment

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

What do you mean by purl_match?

Copy link
Author

Choose a reason for hiding this comment

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

purl_match is the internal name of the object type as it exists in the schema, it is not a user-facing name, and is named thus to stylistically match the equivalent existing cpe_match structure.

"matchCriteriaId": {
"$ref": "#/definitions/uuidType"
},
"versionStartExcluding": {

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Yes, our plan is to not use the vers spec, but instead to reuse the existing mechanism for expressing version constraints used for CPE. We expect this will both be easier to existing consumers of CVE data and will mitigate concerns around the vers spec's readiness for production use.

@alilleybrinker
Copy link
Author

@alilleybrinker re:

Introduce support for OmniBOR Artifact IDs in the CVE record format.
You meant PURL here, right?

Yes, this was an editing error made when I split the prior single PR into three. It's now fixed.

@alilleybrinker
Copy link
Author

Also questions originally posted by @alilleybrinker in #391 (comment)_

Feedback from QWG meeting:

  • Constrain the purl schema to explicitly disallow version information.

    • Would this demand vendoring the purl spec?

What do you mean?

  • How to handle the purl generic type?

There is nothing super special about it. What's at issue?

  • Also a complexity with the go type, where the purl spec doesn't match Go's expressiveness (purl is case-insensitive while Go is case-sensitive)

This is a bug in the spec. It will be fixed.

  • How does this relate to the affected block, which also encodes version information?

Not sure if this is relevant, but we have a version range spec in PURL: The namespace and name must be lowercased.

  1. Regarding vendoring purl, at issue is that the QWG doesn't want to generically incorporate "purl" without being rigorous about what version of purl is intended. Referencing main on the purl specification repository is not sufficient. The solutions would be to either maintain a copy of the purl spec from a specific commit hash to refer to a fixed version, or to wait until purl has been standardized by ECMA and refer to the ECMA-specified version.
  2. On the generic type: members of the QWG raised questions about whether the generic type (and the swid type) would be usable for downstream consumers of purl data from CVE records, and whether it would make sense to disallow the generic or swid types so that the only usable types would be those referring to concrete platforms.
  3. Regarding the go issue: if this is something to be fixed, that's great.

I'll add that the list above was intended just to capture issues raised during the meeting, and are not arguments from me, I'm just relaying them as best I can.

Copy link
Author

@alilleybrinker alilleybrinker left a comment

Choose a reason for hiding this comment

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

I do want to add a regular expression constraint to ensure that purls submitted are actually syntactically valid. We haven't yet reached a consensus on whether versions should be permissible in the purl itself, so that would need to be resolved to determine the exact contents of the regex.

The regex could also help protect against accidental submission of purls which are not URL encoded (and thus not valid).


purls should also probably be pulled out as their own type, both for current clarity and for possible reuse elsewhere in the schema where purls may become usable in the future.

@alilleybrinker
Copy link
Author

After discussion with the QWG, a Request for Discussion-style document is in the works to more completely address the design considerations in this proposal.

@alilleybrinker alilleybrinker changed the title Add support for Package URLs. Add support for Package URLs Apr 9, 2025
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.

2 participants