Skip to content

Commit 04f739e

Browse files
authored
feat(sbom): support for CycloneDX 1.7 (aquasecurity#10715)
1 parent f9ed425 commit 04f739e

10 files changed

Lines changed: 40 additions & 40 deletions

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
88
github.com/Azure/azure-sdk-for-go/sdk/containers/azcontainerregistry v0.2.3
99
github.com/BurntSushi/toml v1.6.0
10-
github.com/CycloneDX/cyclonedx-go v0.10.0
10+
github.com/CycloneDX/cyclonedx-go v0.11.0
1111
github.com/GoogleCloudPlatform/docker-credential-gcr/v2 v2.1.32
1212
github.com/Masterminds/sprig/v3 v3.3.0
1313
github.com/NYTimes/gziphandler v1.1.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
8989
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
9090
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
9191
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
92-
github.com/CycloneDX/cyclonedx-go v0.10.0 h1:7xyklU7YD+CUyGzSFIARG18NYLsKVn4QFg04qSsu+7Y=
93-
github.com/CycloneDX/cyclonedx-go v0.10.0/go.mod h1:vUvbCXQsEm48OI6oOlanxstwNByXjCZ2wuleUlwGEO8=
92+
github.com/CycloneDX/cyclonedx-go v0.11.0 h1:GokP8FiRC+foiuwWhSSLpSD5H4hSWtGnR3wo7apkBFI=
93+
github.com/CycloneDX/cyclonedx-go v0.11.0/go.mod h1:vUvbCXQsEm48OI6oOlanxstwNByXjCZ2wuleUlwGEO8=
9494
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
9595
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
9696
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=

integration/testdata/conda-cyclonedx.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
33
"bomFormat": "CycloneDX",
4-
"specVersion": "1.6",
4+
"specVersion": "1.7",
55
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000005",
66
"version": 1,
77
"metadata": {

integration/testdata/conda-environment-cyclonedx.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
33
"bomFormat": "CycloneDX",
4-
"specVersion": "1.6",
4+
"specVersion": "1.7",
55
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000005",
66
"version": 1,
77
"metadata": {

integration/testdata/fluentd-multiple-lockfiles-short.cdx.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
33
"bomFormat": "CycloneDX",
4-
"specVersion": "1.6",
4+
"specVersion": "1.7",
55
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000006",
66
"version": 1,
77
"metadata": {

integration/testdata/fluentd-multiple-lockfiles.cdx.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
33
"bomFormat": "CycloneDX",
4-
"specVersion": "1.6",
4+
"specVersion": "1.7",
55
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000163",
66
"version": 1,
77
"metadata": {

integration/testdata/npm-cyclonedx.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
33
"bomFormat": "CycloneDX",
4-
"specVersion": "1.6",
4+
"specVersion": "1.7",
55
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000015",
66
"version": 1,
77
"metadata": {

integration/testdata/pom-cyclonedx.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
33
"bomFormat": "CycloneDX",
4-
"specVersion": "1.6",
4+
"specVersion": "1.7",
55
"serialNumber": "urn:uuid:3ff14136-e09f-4df9-80ea-000000000006",
66
"version": 1,
77
"metadata": {

pkg/sbom/cyclonedx/marshal_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
326326
},
327327
},
328328
want: &cdx.BOM{
329-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
329+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
330330
BOMFormat: "CycloneDX",
331-
SpecVersion: cdx.SpecVersion1_6,
332-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
331+
SpecVersion: cdx.SpecVersion1_7,
332+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
333333
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000014",
334334
Version: 1,
335335
Metadata: &cdx.Metadata{
@@ -965,10 +965,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
965965
},
966966
},
967967
want: &cdx.BOM{
968-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
968+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
969969
BOMFormat: "CycloneDX",
970-
SpecVersion: cdx.SpecVersion1_6,
971-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
970+
SpecVersion: cdx.SpecVersion1_7,
971+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
972972
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000007",
973973
Version: 1,
974974
Metadata: &cdx.Metadata{
@@ -1353,10 +1353,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
13531353
},
13541354
},
13551355
want: &cdx.BOM{
1356-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
1356+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
13571357
BOMFormat: "CycloneDX",
1358-
SpecVersion: cdx.SpecVersion1_6,
1359-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
1358+
SpecVersion: cdx.SpecVersion1_7,
1359+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
13601360
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000007",
13611361
Version: 1,
13621362
Metadata: &cdx.Metadata{
@@ -1585,10 +1585,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
15851585
BOM: testSBOM(),
15861586
},
15871587
want: &cdx.BOM{
1588-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
1588+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
15891589
BOMFormat: "CycloneDX",
1590-
SpecVersion: cdx.SpecVersion1_6,
1591-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
1590+
SpecVersion: cdx.SpecVersion1_7,
1591+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
15921592
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000001",
15931593
Version: 1,
15941594
Metadata: &cdx.Metadata{
@@ -1853,10 +1853,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
18531853
},
18541854
},
18551855
want: &cdx.BOM{
1856-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
1856+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
18571857
BOMFormat: "CycloneDX",
1858-
SpecVersion: cdx.SpecVersion1_6,
1859-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
1858+
SpecVersion: cdx.SpecVersion1_7,
1859+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
18601860
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000004",
18611861
Version: 1,
18621862
Metadata: &cdx.Metadata{
@@ -2043,10 +2043,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
20432043
},
20442044
},
20452045
want: &cdx.BOM{
2046-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
2046+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
20472047
BOMFormat: "CycloneDX",
2048-
SpecVersion: cdx.SpecVersion1_6,
2049-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
2048+
SpecVersion: cdx.SpecVersion1_7,
2049+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
20502050
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000003",
20512051
Version: 1,
20522052
Metadata: &cdx.Metadata{
@@ -2134,10 +2134,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
21342134
Results: types.Results{},
21352135
},
21362136
want: &cdx.BOM{
2137-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
2137+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
21382138
BOMFormat: "CycloneDX",
2139-
SpecVersion: cdx.SpecVersion1_6,
2140-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
2139+
SpecVersion: cdx.SpecVersion1_7,
2140+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
21412141
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000002",
21422142
Version: 1,
21432143
Metadata: &cdx.Metadata{
@@ -2187,10 +2187,10 @@ func TestMarshaler_MarshalReport(t *testing.T) {
21872187
BOM: testSBOMWithoutRoot(),
21882188
},
21892189
want: &cdx.BOM{
2190-
XMLNS: "http://cyclonedx.org/schema/bom/1.6",
2190+
XMLNS: "http://cyclonedx.org/schema/bom/1.7",
21912191
BOMFormat: "CycloneDX",
2192-
SpecVersion: cdx.SpecVersion1_6,
2193-
JSONSchema: "http://cyclonedx.org/schema/bom-1.6.schema.json",
2192+
SpecVersion: cdx.SpecVersion1_7,
2193+
JSONSchema: "http://cyclonedx.org/schema/bom-1.7.schema.json",
21942194
SerialNumber: "urn:uuid:3ff14136-e09f-4df9-80ea-000000000001",
21952195
Version: 1,
21962196
Metadata: &cdx.Metadata{

pkg/sbom/cyclonedx/testdata/happy/bom.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"bomFormat": "CycloneDX",
3-
"specVersion": "1.6",
3+
"specVersion": "1.7",
44
"serialNumber": "urn:uuid:c986ba94-e37d-49c8-9e30-96daccd0415b",
55
"version": 1,
66
"metadata": {

0 commit comments

Comments
 (0)