Replies: 1 comment
-
After some tests, here's an update: erDiagram
Sbom {
int sbom_id PK "inherited"
string id "inherited"
string name "inherited"
string namespace "inherited"
uuid sha256
}
Package {
int sbom_uid FK "inherited"
string id "inherited"
string name "inherited"
string namespace "inherited"
}
Node {
int sbom_id
string id
string namespace
}
Edge {
int sbom_id
string left_id
option~string~ left_namespace
enum~relationship~ type
string right_id
option~string~ right_namespace
}
Sbom 1 to 0+ Package : contains
BasePurl {
uuid id
string type
string name
option~string~ namespace
}
VersionedPurl {
string version
}
QualifiedPurl {
jsonb qualifiers
}
QualifiedPurl 0+ to 1 VersionedPurl: refines
VersionedPurl 0+ to 1 BasePurl: refines
CPE
Package 1 optionally to 0+ QualifiedPurl: references
Package 1 optionally to 0+ CPE: references
Node 1 to zero or one Package: inherits
Node 1 to zero or one Sbom: inherits
Edge 1 to zero or one Node: left
Edge 1 to zero or one Node: right
Most notable changes:
Unresolved issues:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now (only considering SPDX SBOMs) we take an SBOM and extract the contained packages, if they declare a PURL. We store each PURL as "package" in a hierarchical data structure like this: qualified -> versioned -> base.
We also record the fact that packages (qualified) are present in an SBOM and that there are relationships between packages in the context of an SBOM.
There is also a bit of special handling our what "describes" the SBOM. For that we do extract the "document describes" information from the document's metadata . We do this for CPEs and PURLs.
This roughly gives the following structure:
Thinking of this as a graph, in the context of an SBOM this would give us:
Outside an SBOM, we know nothing because no relationships exist outside an SBOM.
Problem 1
We don't handle the "describes" thing correctly. There's a "document describes" field, which lists IDs (packages inside a SBOM), which the SBOM declares as "defining packages". First of all, that field may be missing. Second, that information could also come in from a relationship of the type
DESCRIBES
to theSPDXRef-DOCUMENT
element. Currently, we do ignore this.Problem 2
Inside a SPDX SBOM there are "packages" and "relationships". However, packages are not necessarily PURLs. They could also be CPEs, or file hashes. Also, could a relationship exist between a package and the document itself (
SPDXRef-DOCUMENT
).Even more complex, a reference to an external document could exist.
Declared by (where
DocumentRef-SPDXA
would beDocumentRef-spdx-tool-1.2
here):We are completely ignoring this at the moment.
Also see: https://spdx.github.io/spdx-spec/v2.3/relationships-between-SPDX-elements/#1111-description
and https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#66-external-document-references-field
Ideas
Assuming we keep the tree of qualified/versioned/base for PURL-based packages. We might convert this
into a graph, supporting the following nodes/edges:
Where
Package
is a package of the SBOM, andPURL
is a "qualified package" without an SBOM context.So we might have something like this (where
->
denotes a reference rather than ownership):Now what?
I don't have concrete proposals. I only think that we don't fully understand the problem yet. This is all based on SPDX, and I think that CycloneDX will be similar, bit with subtle differences.
Also, I did not check into SPDX 3.0, which indeed might be different. It looks like they go even more in that direction with RDF.
Beta Was this translation helpful? Give feedback.
All reactions