Skip to content

Commit 72407e7

Browse files
Added test cases, comment to schema, and corrected space issue with behavior schema.
Signed-off-by: Steve Springett <steve@springett.us>
1 parent 6ec41a6 commit 72407e7

38 files changed

Lines changed: 2910 additions & 21 deletions

File tree

schema/2.0/cyclonedx-2.0.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"$schema": {
1414
"type": "string"
1515
},
16+
"$comment": {
17+
"type": "string"
18+
},
1619
"specFormat": {
1720
"type": "string",
1821
"title": "Specification Format",

schema/2.0/model/cyclonedx-behavior-2.0.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"$id": "https://cyclonedx.org/schema/2.0/model/cyclonedx-behavior-2.0.schema.json",
44
"type": "null",
55
"title": "CycloneDX Behavior Model",
6-
"$comment" : "OWASP CycloneDX is an Ecma International standard (ECMA-424) developed in collaboration between the OWASP Foundation and Ecma Technical Committee 54 (TC54). The standard is published under a royalty-free patent policy. This JSON schema is the reference implementation and is licensed under the Apache License 2.0.",
6+
"$comment": "OWASP CycloneDX is an Ecma International standard (ECMA-424) developed in collaboration between the OWASP Foundation and Ecma Technical Committee 54 (TC54). The standard is published under a royalty-free patent policy. This JSON schema is the reference implementation and is licensed under the Apache License 2.0.",
77
"$defs": {
88
"behaviors": {
99
"type": "object",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"specFormat": "CycloneDX",
3+
"specVersion": "2.0",
4+
"serialNumber": "urn:uuid:a1b2c3d4-0004-4abc-8def-1122334455dd",
5+
"version": 1,
6+
"blueprints": [
7+
{
8+
"bom-ref": "bp-bad-node",
9+
"name": "Activity node with two mutually exclusive sources",
10+
"modelTypes": [
11+
"process"
12+
],
13+
"behaviors": {
14+
"graphs": [
15+
{
16+
"bom-ref": "g-bad",
17+
"nodes": [
18+
{
19+
"bom-ref": "n-bad",
20+
"kind": "activity",
21+
"behavior": "data:ingestion:receivesRequest",
22+
"graph": "g-other"
23+
}
24+
]
25+
}
26+
]
27+
}
28+
}
29+
]
30+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"specFormat": "CycloneDX",
3+
"specVersion": "2.0",
4+
"serialNumber": "urn:uuid:1a2b3c4d-5e6f-4079-8190-2b3c4d5e6f70",
5+
"version": 1,
6+
"blueprints": [
7+
{
8+
"bom-ref": "bp-legacy-auth",
9+
"name": "Legacy authentication values",
10+
"modelTypes": [
11+
"data-flow"
12+
],
13+
"assets": [
14+
{
15+
"bom-ref": "asset-legacy",
16+
"type": "service",
17+
"name": "Legacy service",
18+
"authentication": [
19+
"mfa",
20+
"mTLS"
21+
]
22+
}
23+
]
24+
}
25+
]
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"specFormat": "CycloneDX",
3+
"specVersion": "2.0",
4+
"serialNumber": "urn:uuid:5e4d3c2b-1a09-4f8e-9d7c-6b5a4c3d2e1f",
5+
"version": 1,
6+
"blueprints": [
7+
{
8+
"bom-ref": "bp-legacy-authz",
9+
"name": "Removed authorization model",
10+
"modelTypes": [
11+
"data-flow"
12+
],
13+
"assets": [
14+
{
15+
"bom-ref": "asset-legacy-authz",
16+
"type": "service",
17+
"name": "Legacy service",
18+
"authorization": [
19+
"cbac"
20+
]
21+
}
22+
]
23+
}
24+
]
25+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"specFormat": "CycloneDX",
3+
"specVersion": "2.0",
4+
"serialNumber": "urn:uuid:a1b2c3d4-0006-4abc-8def-1122334455ff",
5+
"version": 1,
6+
"blueprints": [
7+
{
8+
"bom-ref": "bp-bad-relationship",
9+
"name": "Relationship with unknown type",
10+
"modelTypes": [
11+
"architecture"
12+
],
13+
"assets": [
14+
{
15+
"bom-ref": "asset-a",
16+
"type": "service",
17+
"name": "Service A"
18+
},
19+
{
20+
"bom-ref": "asset-b",
21+
"type": "service",
22+
"name": "Service B"
23+
}
24+
],
25+
"relationships": [
26+
{
27+
"ref": "asset-a",
28+
"uses": [
29+
"asset-b"
30+
]
31+
}
32+
]
33+
}
34+
]
35+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"specFormat": "CycloneDX",
3+
"specVersion": "2.0",
4+
"serialNumber": "urn:uuid:9f8e7d6c-5b4a-4039-8271-1a2b3c4d5e6f",
5+
"version": 1,
6+
"blueprints": [
7+
{
8+
"bom-ref": "bp-legacy",
9+
"name": "Legacy visualization shape",
10+
"modelTypes": [
11+
"data-flow"
12+
],
13+
"visualizations": [
14+
{
15+
"bom-ref": "viz-legacy",
16+
"name": "Old shape using removed properties",
17+
"type": {
18+
"type": "data-flow"
19+
},
20+
"format": "mermaid",
21+
"content": "flowchart LR; a-->b"
22+
}
23+
]
24+
}
25+
]
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"specFormat": "CycloneDX",
3+
"specVersion": "2.0",
4+
"serialNumber": "urn:uuid:4d3c2b1a-6e5f-4a09-9b8c-7d6e5f4a3b2c",
5+
"version": 1,
6+
"blueprints": [
7+
{
8+
"bom-ref": "bp-renamed",
9+
"name": "Renamed visualization type",
10+
"modelTypes": [
11+
"behavioral"
12+
],
13+
"visualizations": [
14+
{
15+
"bom-ref": "viz-collaboration",
16+
"name": "Uses the renamed-away collaboration type",
17+
"type": {
18+
"type": "collaboration"
19+
}
20+
}
21+
]
22+
}
23+
]
24+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"serialNumber": "urn:uuid:5e2c8a4d-1b9f-4c3e-a7d0-6f4b2e9c8a15",
6+
"version": 1,
7+
"controls": [
8+
{
9+
"bom-ref": "control-unnamed"
10+
}
11+
]
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"serialNumber": "urn:uuid:3a7f1c5e-8d4b-4e2a-9b0c-7e5d3f1a6c92",
6+
"version": 1,
7+
"controls": [
8+
{
9+
"bom-ref": "control-bad-status",
10+
"name": "Control with an unknown status",
11+
"status": "active"
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)