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

Model and Serial numbers #872

Merged
2 changes: 2 additions & 0 deletions csaf_2.1/prose/edit/etc/bind.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ tests-01-mndtr-39-public-sharing-group-with-no-max-uuid.md
tests-01-mndtr-40-invalid-sharing-group-name.md
tests-01-mndtr-41-missing-sharing-group-name.md
tests-01-mndtr-42-purl-qualifiers.md
tests-01-mndtr-43-use-of-multiple-stars-in-model-number.md
tests-01-mndtr-44-use-of-multiple-stars-in-serial-number.md
tests-02-optional.md
tests-03-informative.md
distributing.md
Expand Down
30 changes: 30 additions & 0 deletions csaf_2.1/prose/edit/src/conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,38 @@ Secondly, the program fulfills the following for all items of:

* type `/$defs/full_product_name_t/product_identification_helper/cpe`: If a CPE is invalid, the CSAF 2.0 to CSAF 2.1 converter SHOULD removed the
invalid value and output a warning that an invalid CPE was detected and removed. Such a warning MUST include the invalid CPE.
* type `/$defs/full_product_name_t/model_number`:
* If a model number is given that does not end on a star, the CSAF 2.0 to CSAF 2.1 converter SHOULD add a `*` to the end and output a
warning that a partial model number was detected and a star has been added.
Such a warning MUST include the model number.
* If the model number contains a `\`, the CSAF 2.0 to CSAF 2.1 converter MUST escape it by inserting an additional `\` before the character.
* If the model number contains multiple unescaped `*` after the conversion, the CSAF 2.0 to CSAF 2.1 converter MUST remove the entry and
output a warning that a model number with multiple stars was detected and removed.
Such a warning MUST include the model number.

> A tool MAY provide a non-default option to interpret all model numbers as complete and therefore does not add any stars.

> A tool MAY provide a non-default option to interpret the `?` in all model numbers as part of the model number itself and therefore escape it.

> A tool MAY provide a non-default option to interpret the `*` in all model numbers as part of the model number itself and therefore escape it.

* type `/$defs/full_product_name_t/product_identification_helper/purls`: If a `/$defs/full_product_name_t/product_identification_helper/purl` is given,
the CSAF 2.0 to CSAF 2.1 converter MUST convert it into the first item of the corresponding `purls` array.
* type `/$defs/full_product_name_t/serial_number`:
* If a serial number is given that does not end on a star, the CSAF 2.0 to CSAF 2.1 converter SHOULD add a `*` to the end and output a
warning that a partial serial number was detected and a star has been added.
Such a warning MUST include the serial number.
* If the serial number contains a `\`, the CSAF 2.0 to CSAF 2.1 converter MUST escape it by inserting an additional `\` before the character.
* If the serial number contains multiple unescaped `*` after the conversion, the CSAF 2.0 to CSAF 2.1 converter MUST remove the entry and
output a warning that a serial number with multiple stars was detected and removed.
Such a warning MUST include the serial number.

> A tool MAY provide a non-default option to interpret all serial numbers as complete and therefore does not add any stars.

> A tool MAY provide a non-default option to interpret the `?` in all serial numbers as part of the serial number itself and therefore escape it.

> A tool MAY provide a non-default option to interpret the `*` in all serial numbers as part of the serial number itself and therefore escape it.

* `/$schema`: The CSAF 2.0 to CSAF 2.1 converter MUST set property with the value prescribed by the schema.
* `/document/csaf_version`: The CSAF 2.0 to CSAF 2.1 converter MUST update the value to `2.1`.
* `/document/distribution/tlp/label`: If a TLP label is given, the CSAF 2.0 to CSAF 2.1 converter MUST convert it according to the table below:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,18 @@ the component to identify.
> Often it is abbreviated as "MN", M/N" or "model no.".

If a part of a model number of the component to identify is given,
it SHOULD begin with the first character of the model number and stop at any point.
Characters which SHOULD NOT be matched MUST be replaced by either `?` (for a single character) or `*` (for zero or more characters).
Two `*` MUST NOT follow each other.
it MUST begin at the first and end at the last character position of the string representing the targeted component.
The wildcard characters `?` (for a single character) and `*` (for zero or more characters) signal exclusion of characters at these positions from matching.
This applies also to the first character.
An unescaped `*` MUST be the only `*` wildcard in the string.
As part of the model number, the special characters `?`, `*` and `\` MUST be escaped with `\`.

> Note: A backslash MUST be escaped itself in a JSON string.

*Examples 1:*

```
*-2024
6RA8096-4MV62-0AA0
6RA801?-??V62-0AA0
IC25T060ATCS05-0
Expand Down Expand Up @@ -325,9 +330,13 @@ Any given serial number of value type `string` with at least 1 character represe
abbreviated (partial) serial number of the component to identify.

If a part of a serial number of the component to identify is given,
it SHOULD begin with the first character of the serial number and stop at any point.
Characters which SHOULD NOT be matched MUST be replaced by either `?` (for a single character) or `*` (for zero or more characters).
Two `*` MUST NOT follow each other.
it MUST begin at the first and end at the last character position of the string representing the targeted component.
The wildcard characters `?` (for a single character) and `*` (for zero or more characters) signal exclusion of characters at these positions from matching.
This applies also to the first character.
An unescaped `*` MUST be the only `*` wildcard in the string.
As part of the serial number, the special characters `?`, `*` and `\` MUST be escaped with `\`.

> Note: A backslash MUST be escaped itself in a JSON string.

##### Full Product Name Type - Product Identification Helper - SKUs

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### Use of Multiple Stars in Model Number

For each model number it MUST be tested that the it does not contain multiple unescaped stars.

> Multiple `*` that match zero or multiple characters within a model number introduce ambiguity and are therefore prohibited.

The relevant paths for this test are:

```
/product_tree/branches[](/branches[])*/product/product_identification_helper/model_numbers[]
/product_tree/full_product_names[]/product_id/product_identification_helper/model_numbers[]
/product_tree/relationships[]/full_product_name/product_id/product_identification_helper/model_numbers[]
```

*Example 1 (which fails the test):*

```
"model_numbers": [
"P*A*"
]
```

> The model number contains two unescaped stars.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### Use of Multiple Stars in Serial Number

For each serial number it MUST be tested that the it does not contain multiple unescaped stars.

> Multiple `*` that match zero or multiple characters within a serial number introduce ambiguity and are therefore prohibited.

The relevant paths for this test are:

```
/product_tree/branches[](/branches[])*/product/product_identification_helper/serial_numbers[]
/product_tree/full_product_names[]/product_id/product_identification_helper/serial_numbers[]
/product_tree/relationships[]/full_product_name/product_id/product_identification_helper/serial_numbers[]
```

*Example 1 (which fails the test):*

```
"serial_numbers": [
"P*A*"
]
```

> The serial number contains two unescaped stars.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Use of Multiple Stars in Model Number (failing example 1)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-43-01",
"initial_release_date": "2024-01-24T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-24T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "1"
}
},
"product_tree": {
"full_product_names": [
{
"name": "Product A",
"product_id": "CSAFPID-9080700",
"product_identification_helper": {
"model_numbers": [
"P*A*"
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Use of Multiple Stars in Model Number (failing example 2)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-43-02",
"initial_release_date": "2024-01-24T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-24T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "1"
}
},
"product_tree": {
"full_product_names": [
{
"name": "Product A",
"product_id": "CSAFPID-9080700",
"product_identification_helper": {
"model_numbers": [
"*P*\\*?*"
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Use of Multiple Stars in Model Number (valid example 1)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-43-11",
"initial_release_date": "2024-01-24T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-24T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "1"
}
},
"product_tree": {
"full_product_names": [
{
"name": "Product A",
"product_id": "CSAFPID-9080700",
"product_identification_helper": {
"model_numbers": [
"PA*",
"P?A*",
"P??A*",
"P???A*",
"P????A*"
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Use of Multiple Stars in Model Number (valid example 2)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-43-12",
"initial_release_date": "2024-01-24T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-24T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "1"
}
},
"product_tree": {
"full_product_names": [
{
"name": "Product A",
"product_id": "CSAFPID-9080700",
"product_identification_helper": {
"model_numbers": [
"*P\\*\\*?\\*"
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/csaf_json_schema.json",
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Use of Multiple Stars in Model Number (valid example 3)",
"tracking": {
"current_release_date": "2024-01-24T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-43-13",
"initial_release_date": "2024-01-24T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-24T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "1"
}
},
"product_tree": {
"full_product_names": [
{
"name": "Product A",
"product_id": "CSAFPID-9080700",
"product_identification_helper": {
"model_numbers": [
"P\\*\\*\\\\?"
]
}
}
]
}
}
Loading