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

Added additional compositions and identity #212

Merged
merged 6 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions schema/bom-1.5.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message Bom {
repeated ExternalReference external_references = 7;
// Provides the ability to document dependency relationships.
repeated Dependency dependencies = 8;
// Provides the ability to document aggregate completeness
// Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness. Other inventory types such as vulnerabilities may also be described for completeness.
repeated Composition compositions = 9;
// Vulnerabilities identified in components or services.
repeated Vulnerability vulnerabilities = 10;
Expand Down Expand Up @@ -545,27 +545,37 @@ message Property {
}

enum Aggregate {
// Default, no statement about the aggregate completeness is being made
// The relationship completeness is not specified.
AGGREGATE_NOT_SPECIFIED = 0;
// The aggregate composition is complete
// The relationship is complete. No further relationships including constituent components, services, or dependencies are known to exist.
AGGREGATE_COMPLETE = 1;
// The aggregate composition is incomplete
// The relationship is incomplete. Additional relationships exist and may include constituent components, services, or dependencies.
AGGREGATE_INCOMPLETE = 2;
// The aggregate composition is incomplete for first party components, complete for third party components
// The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented.
AGGREGATE_INCOMPLETE_FIRST_PARTY_ONLY = 3;
// The aggregate composition is incomplete for third party components, complete for first party components
// The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented.
AGGREGATE_INCOMPLETE_THIRD_PARTY_ONLY = 4;
// The aggregate composition completeness is unknown
// The relationship may be complete or incomplete. This usually signifies a 'best-effort' to obtain constituent components, services, or dependencies but the completeness is inconclusive.
AGGREGATE_UNKNOWN = 5;
// The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.
AGGREGATE_INCOMPLETE_FIRST_PARTY_PROPRIETARY_ONLY = 6;
// The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented, limited specifically to those that are opensource.
AGGREGATE_INCOMPLETE_FIRST_PARTY_OPENSOURCE_ONLY = 7;
// The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.
AGGREGATE_INCOMPLETE_THIRD_PARTY_PROPRIETARY_ONLY = 8;
// The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are opensource.
AGGREGATE_INCOMPLETE_THIRD_PARTY_OPENSOURCE_ONLY = 9;
}

message Composition {
// Indicates the aggregate completeness
// Specifies an aggregate type that describe how complete a relationship is.
Aggregate aggregate = 1;
// The assemblies the aggregate completeness applies to
// The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only. Other inventory types such as vulnerabilities may also be described.
repeated string assemblies = 2;
// The dependencies the aggregate completeness applies to
// The bom-ref identifiers of the components or services being described. Dependencies refer to a relationship whereby an independent constituent part requires another independent constituent part. References do not cascade to transitive dependencies. References are explicit for the specified dependency only.
repeated string dependencies = 3;
// An optional identifier which can be used to reference the composition elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.
optional string bom_ref = 4;
}

message EvidenceCopyright {
Expand Down
15 changes: 12 additions & 3 deletions schema/bom-1.5.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"items": {"$ref": "#/definitions/compositions"},
"uniqueItems": true,
"title": "Compositions",
"description": "Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness."
"description": "Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness. Other inventory types such as vulnerabilities may also be described for completeness."
},
"vulnerabilities": {
"type": "array",
Expand Down Expand Up @@ -1511,10 +1511,15 @@
],
"additionalProperties": false,
"properties": {
"bom-ref": {
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the composition elsewhere in the BOM. Every bom-ref MUST be unique within the BOM."
},
"aggregate": {
"$ref": "#/definitions/aggregateType",
"title": "Aggregate",
"description": "Specifies an aggregate type that describe how complete a relationship is."
"description": "Specifies an aggregate type that describe how complete a relationship is.\n\n* __complete__ = The relationship is complete. No further relationships including constituent components, services, or dependencies are known to exist.\n* __incomplete__ = The relationship is incomplete. Additional relationships exist and may include constituent components, services, or dependencies.\n* __incomplete_first_party_only__ = The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented.\n* __incomplete_first_party_proprietary_only__ = The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.\n* __incomplete_first_party_opensource_only__ = The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented, limited specifically to those that are opensource.\n* __incomplete_third_party_only__ = The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented.\n* __incomplete_third_party_proprietary_only__ = The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.\n* __incomplete_third_party_opensource_only__ = The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are opensource.\n* __unknown__ = The relationship may be complete or incomplete. This usually signifies a 'best-effort' to obtain constituent components, services, or dependencies but the completeness is inconclusive.\n* __not_specified__ = The relationship completeness is not specified.\n"
},
"assemblies": {
"type": "array",
Expand All @@ -1523,7 +1528,7 @@
"type": "string"
},
"title": "BOM references",
"description": "The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only."
"description": "The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only. Other inventory types such as vulnerabilities may also be described."
},
"dependencies": {
"type": "array",
Expand All @@ -1548,7 +1553,11 @@
"complete",
"incomplete",
"incomplete_first_party_only",
"incomplete_first_party_proprietary_only",
"incomplete_first_party_opensource_only",
"incomplete_third_party_only",
"incomplete_third_party_proprietary_only",
"incomplete_third_party_opensource_only",
"unknown",
"not_specified"
]
Expand Down
33 changes: 31 additions & 2 deletions schema/bom-1.5.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,7 @@ limitations under the License.
The bom-ref identifiers of the components or services being described. Assemblies refer to
nested relationships whereby a constituent part may include other constituent parts. References
do not cascade to child parts. References are explicit for the specified constituent part only.
Other inventory types such as vulnerabilities may also be described.
</xs:documentation>
</xs:annotation>
<xs:complexType>
Expand Down Expand Up @@ -2142,13 +2143,21 @@ limitations under the License.
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the composition elsewhere in the BOM.
Uniqueness is enforced within all elements and children of the root-level bom element.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

<xs:simpleType name="aggregateType">
<xs:restriction base="xs:string">
<xs:enumeration value="complete">
<xs:annotation>
<xs:documentation>The relationship is complete. No further relationships including constituent components, services, or dependencies exist.</xs:documentation>
<xs:documentation>The relationship is complete. No further relationships including constituent components, services, or dependencies are known to exist.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="incomplete">
Expand All @@ -2161,11 +2170,31 @@ limitations under the License.
<xs:documentation>The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="incomplete_first_party_proprietary_only">
<xs:annotation>
<xs:documentation>The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="incomplete_first_party_opensource_only">
<xs:annotation>
<xs:documentation>The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are opensource.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="incomplete_third_party_only">
<xs:annotation>
<xs:documentation>The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="incomplete_third_party_proprietary_only">
<xs:annotation>
<xs:documentation>The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="incomplete_third_party_opensource_only">
<xs:annotation>
<xs:documentation>The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are opensource.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="unknown">
<xs:annotation>
<xs:documentation>The relationship may be complete or incomplete. This usually signifies a 'best-effort' to obtain constituent components, services, or dependencies but the completeness is inconclusive.</xs:documentation>
Expand Down Expand Up @@ -3185,7 +3214,7 @@ limitations under the License.
</xs:element>
<xs:element name="compositions" type="bom:compositionsType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness.</xs:documentation>
<xs:documentation>Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness. Other inventory types such as vulnerabilities may also be described for completeness.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
Expand Down
1 change: 1 addition & 0 deletions tools/src/test/resources/1.5/valid-compositions-1.5.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
],
"compositions": [
{
"bom-ref": "composition-1",
"aggregate": "complete",
"assemblies": [
"pkg:maven/partner/[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
}
}
compositions {
bom_ref: "composition-1"
aggregate: AGGREGATE_COMPLETE
assemblies: "pkg:maven/partner/[email protected]"
dependencies: "acme-application-1.0"
Expand Down
2 changes: 1 addition & 1 deletion tools/src/test/resources/1.5/valid-compositions-1.5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dependency>
</dependencies>
<compositions>
<composition>
<composition bom-ref="composition-1">
<aggregate>complete</aggregate>
<assemblies>
<assembly ref="pkg:maven/partner/[email protected]"/>
Expand Down