Skip to content

Commit c47884f

Browse files
Removed seq min/max. Moved name/description to attributes in XSD. Updated all examples to include name/description.
Signed-off-by: Steve Springett <[email protected]>
1 parent 2e4c17d commit c47884f

File tree

4 files changed

+76
-22
lines changed

4 files changed

+76
-22
lines changed

schema/bom-1.5.xsd

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,22 +1564,12 @@ limitations under the License.
15641564
<xs:documentation>Specifies the data classification.</xs:documentation>
15651565
</xs:annotation>
15661566
<xs:complexType>
1567-
<xs:sequence minOccurs="0" maxOccurs="1">
1567+
<xs:sequence>
15681568
<xs:element name="classification" type="bom:dataClassificationType" minOccurs="0" maxOccurs="1">
15691569
<xs:annotation>
15701570
<xs:documentation>Specifies the data classification.</xs:documentation>
15711571
</xs:annotation>
15721572
</xs:element>
1573-
<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1">
1574-
<xs:annotation>
1575-
<xs:documentation>Name for the defined data.</xs:documentation>
1576-
</xs:annotation>
1577-
</xs:element>
1578-
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1">
1579-
<xs:annotation>
1580-
<xs:documentation>Short description of the data content and usage.</xs:documentation>
1581-
</xs:annotation>
1582-
</xs:element>
15831573
<xs:element name="source" minOccurs="0" maxOccurs="1">
15841574
<xs:annotation>
15851575
<xs:documentation>The URI, URL, or BOM-Link of the components or services the data came in from.</xs:documentation>
@@ -1601,6 +1591,26 @@ limitations under the License.
16011591
</xs:complexType>
16021592
</xs:element>
16031593
</xs:sequence>
1594+
<xs:attribute name="name" type="xs:string" use="optional">
1595+
<xs:annotation>
1596+
<xs:documentation>
1597+
Name for the defined data.
1598+
</xs:documentation>
1599+
</xs:annotation>
1600+
</xs:attribute>
1601+
<xs:attribute name="description" type="xs:string" use="optional">
1602+
<xs:annotation>
1603+
<xs:documentation>
1604+
Short description of the data content and usage.
1605+
</xs:documentation>
1606+
</xs:annotation>
1607+
</xs:attribute>
1608+
<xs:anyAttribute namespace="##any" processContents="lax">
1609+
<xs:annotation>
1610+
<xs:documentation>User-defined attributes may be used on this element as long as they
1611+
do not have the same name as an existing attribute used by the schema.</xs:documentation>
1612+
</xs:annotation>
1613+
</xs:anyAttribute>
16041614
</xs:complexType>
16051615
</xs:element>
16061616
</xs:choice>

tools/src/test/resources/1.5/valid-saasbom-1.5.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
"trustZone": "Acme Public Zone",
3131
"data": [
3232
{
33+
"name": "Consumer to Stock Service",
34+
"description": "Traffic to/from consumer to service",
3335
"classification": "Customer",
3436
"flow": "bi-directional",
3537
"source": [
@@ -40,6 +42,8 @@
4042
]
4143
},
4244
{
45+
"name": "Stock Service to MS-1",
46+
"description": "Traffic to/from stock service to microservice-1",
4347
"classification": "PII",
4448
"flow": "bi-directional",
4549
"source": [
@@ -50,6 +54,8 @@
5054
]
5155
},
5256
{
57+
"name": "Stock Service to MS-2",
58+
"description": "Traffic to/from stock service to microservice-2",
5359
"classification": "PIFI",
5460
"flow": "bi-directional",
5561
"source": [
@@ -60,6 +66,8 @@
6066
]
6167
},
6268
{
69+
"name": "Stock Service to MS-3",
70+
"description": "Traffic to/from stock service to microservice-3",
6371
"classification": "Public",
6472
"flow": "bi-directional",
6573
"source": [
@@ -94,6 +102,8 @@
94102
"trustZone": "Acme Private Zone",
95103
"data": [
96104
{
105+
"name": "Stock Service to MS-1",
106+
"description": "Traffic to/from stock service to microservice-1",
97107
"classification": "PII",
98108
"flow": "bi-directional",
99109
"source": [
@@ -104,6 +114,8 @@
104114
]
105115
},
106116
{
117+
"name": "MS-1 to Database",
118+
"description": "Traffic to/from microservice-1 to database",
107119
"classification": "PII",
108120
"flow": "bi-directional",
109121
"source": [
@@ -138,6 +150,8 @@
138150
"trustZone": "Acme Private Zone",
139151
"data": [
140152
{
153+
"name": "Stock Service to MS-2",
154+
"description": "Traffic to/from stock service to microservice-2",
141155
"classification": "PIFI",
142156
"flow": "bi-directional",
143157
"source": [
@@ -172,6 +186,8 @@
172186
"trustZone": "Acme Private Zone",
173187
"data": [
174188
{
189+
"name": "Stock Service to MS-3",
190+
"description": "Traffic to/from stock service to microservice-3",
175191
"classification": "Public",
176192
"flow": "bi-directional",
177193
"source": [
@@ -182,6 +198,8 @@
182198
]
183199
},
184200
{
201+
"name": "MS-3 to S3",
202+
"description": "Data pushed from microservice-3 to S3 bucket",
185203
"classification": "Public",
186204
"flow": "outbound",
187205
"destination": [
@@ -209,6 +227,8 @@
209227
"trustZone": "Acme Private Zone",
210228
"data": [
211229
{
230+
"name": "MS-1 to Database",
231+
"description": "Traffic to/from microservice-1 to database",
212232
"classification": "PII",
213233
"flow": "bi-directional",
214234
"source": [
@@ -232,6 +252,8 @@
232252
"trustZone": "Public Internet",
233253
"data": [
234254
{
255+
"name": "MS-3 to S3",
256+
"description": "Data pushed from microservice-3 to S3 bucket",
235257
"classification": "Public",
236258
"flow": "inbound",
237259
"source": [

tools/src/test/resources/1.5/valid-saasbom-1.5.textproto

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,32 @@ services {
2929
data {
3030
flow: DATA_FLOW_BI_DIRECTIONAL
3131
value: "Customer"
32+
name: "Consumer to Stock Service",
33+
description: "Traffic to/from consumer to service"
3234
source: "https://0.0.0.0"
3335
destination: "https://0.0.0.0"
3436
}
3537
data {
3638
flow: DATA_FLOW_BI_DIRECTIONAL
3739
value: "PII"
40+
name: "Stock Service to MS-1"
41+
description: "Traffic to/from stock service to microservice-1"
3842
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1.example.com"
3943
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1.example.com"
4044
}
4145
data {
4246
flow: DATA_FLOW_BI_DIRECTIONAL
4347
value: "PIFI"
48+
name: "Stock Service to MS-2"
49+
description: "Traffic to/from stock service to microservice-2"
4450
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-2.example.com"
4551
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-2.example.com"
4652
}
4753
data {
4854
flow: DATA_FLOW_BI_DIRECTIONAL
4955
value: "Public"
56+
name: "Stock Service to MS-3"
57+
description: "Traffic to/from stock service to microservice-3"
5058
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-3.example.com"
5159
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-3.example.com"
5260
}
@@ -69,12 +77,16 @@ services {
6977
data {
7078
flow: DATA_FLOW_BI_DIRECTIONAL
7179
value: "PII"
80+
name: "Stock Service to MS-1"
81+
description: "Traffic to/from stock service to microservice-1"
7282
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service"
7383
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service"
7484
}
7585
data {
7686
flow: DATA_FLOW_BI_DIRECTIONAL
7787
value: "PII"
88+
name: "MS-1 to Database"
89+
description: "Traffic to/from microservice-1 to database"
7890
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1-pgsql.example.com"
7991
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1-pgsql.example.com"
8092
}
@@ -98,6 +110,8 @@ services {
98110
data {
99111
flow: DATA_FLOW_BI_DIRECTIONAL
100112
value: "PIFI"
113+
name: "Stock Service to MS-2"
114+
description: "Traffic to/from stock service to microservice-2"
101115
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service"
102116
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service"
103117
}
@@ -121,12 +135,16 @@ services {
121135
data {
122136
flow: DATA_FLOW_BI_DIRECTIONAL
123137
value: "Public"
138+
name: "Stock Service to MS-3"
139+
description: "Traffic to/from stock service to microservice-3"
124140
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service"
125141
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service"
126142
}
127143
data {
128144
flow: DATA_FLOW_OUTBOUND
129145
value: "Public"
146+
name: "MS-3 to S3"
147+
description: "Data pushed from microservice-3 to S3 bucket"
130148
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#s3-example.amazon.com"
131149
}
132150
external_references {
@@ -146,6 +164,8 @@ services {
146164
data {
147165
flow: DATA_FLOW_BI_DIRECTIONAL
148166
value: "PII"
167+
name: "MS-1 to Database"
168+
description: "Traffic to/from microservice-1 to database"
149169
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1.example.com"
150170
destination: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1.example.com"
151171
}
@@ -161,6 +181,8 @@ services {
161181
data {
162182
flow: DATA_FLOW_INBOUND
163183
value: "PII"
184+
name: "MS-3 to S3"
185+
description: "Data pushed from microservice-3 to S3 bucket"
164186
source: "urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-3.example.com"
165187
}
166188
}

tools/src/test/resources/1.5/valid-saasbom-1.5.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<authenticated>true</authenticated>
2323
<trustZone>Acme Public Zone</trustZone>
2424
<data>
25-
<dataflow>
25+
<dataflow name="Consumer to Stock Service" description="Traffic to/from consumer to service">
2626
<classification flow="bi-directional">Customer</classification>
2727
<source>
2828
<url>https://0.0.0.0</url>
@@ -31,7 +31,7 @@
3131
<url>https://0.0.0.0</url>
3232
</destination>
3333
</dataflow>
34-
<dataflow>
34+
<dataflow name="Stock Service to MS-1" description="Traffic to/from stock service to microservice-1">
3535
<classification flow="bi-directional">PII</classification>
3636
<source>
3737
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1.example.com</url>
@@ -40,7 +40,7 @@
4040
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1.example.com</url>
4141
</destination>
4242
</dataflow>
43-
<dataflow>
43+
<dataflow name="Stock Service to MS-2" description="Traffic to/from stock service to microservice-2">
4444
<classification flow="bi-directional">PIFI</classification>
4545
<source>
4646
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-2.example.com</url>
@@ -49,7 +49,7 @@
4949
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-2.example.com</url>
5050
</destination>
5151
</dataflow>
52-
<dataflow>
52+
<dataflow name="Stock Service to MS-3" description="Traffic to/from stock service to microservice-3">
5353
<classification flow="bi-directional">Public</classification>
5454
<source>
5555
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-3.example.com</url>
@@ -78,7 +78,7 @@
7878
<authenticated>true</authenticated>
7979
<trustZone>Acme Private Zone</trustZone>
8080
<data>
81-
<dataflow>
81+
<dataflow name="Stock Service to MS-1" description="Traffic to/from stock service to microservice-1">
8282
<classification flow="bi-directional">PII</classification>
8383
<source>
8484
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service</url>
@@ -87,7 +87,7 @@
8787
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service</url>
8888
</destination>
8989
</dataflow>
90-
<dataflow>
90+
<dataflow name="MS-1 to Database" description="Traffic to/from microservice-1 to database">
9191
<classification flow="bi-directional">PII</classification>
9292
<source>
9393
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1-pgsql.example.com</url>
@@ -116,7 +116,7 @@
116116
<authenticated>true</authenticated>
117117
<trustZone>Acme Private Zone</trustZone>
118118
<data>
119-
<dataflow>
119+
<dataflow name="Stock Service to MS-2" description="Traffic to/from stock service to microservice-2">
120120
<classification flow="bi-directional">PII</classification>
121121
<source>
122122
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service</url>
@@ -145,7 +145,7 @@
145145
<authenticated>true</authenticated>
146146
<trustZone>Acme Private Zone</trustZone>
147147
<data>
148-
<dataflow>
148+
<dataflow name="Stock Service to MS-3" description="Traffic to/from stock service to microservice-3">
149149
<classification flow="bi-directional">PII</classification>
150150
<source>
151151
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service</url>
@@ -154,7 +154,7 @@
154154
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#stock-ticker-service</url>
155155
</destination>
156156
</dataflow>
157-
<dataflow>
157+
<dataflow name="MS-3 to S3" description="Data pushed from microservice-3 to S3 bucket">
158158
<classification flow="outbound">Public</classification>
159159
<destination>
160160
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#s3-example.amazon.com</url>
@@ -178,7 +178,7 @@
178178
<authenticated>true</authenticated>
179179
<trustZone>Acme Private Zone</trustZone>
180180
<data>
181-
<dataflow>
181+
<dataflow name="MS-1 to Database" description="Traffic to/from microservice-1 to database">
182182
<classification flow="bi-directional">PII</classification>
183183
<source>
184184
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-1.example.com</url>
@@ -199,7 +199,7 @@
199199
<authenticated>true</authenticated>
200200
<trustZone>Public Internet</trustZone>
201201
<data>
202-
<dataflow>
202+
<dataflow name="MS-3 to S3" description="Data pushed from microservice-3 to S3 bucket">
203203
<classification flow="inbound">Public</classification>
204204
<source>
205205
<url>urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#ms-3.example.com</url>

0 commit comments

Comments
 (0)