Skip to content

build_library/set_release: add CPE_NAME - v2.3#182

Merged
vbatts merged 1 commit intomainfrom
tormath1/cpe
Nov 24, 2021
Merged

build_library/set_release: add CPE_NAME - v2.3#182
vbatts merged 1 commit intomainfrom
tormath1/cpe

Conversation

@tormath1
Copy link
Copy Markdown
Contributor

@tormath1 tormath1 commented Nov 23, 2021

Flatcar is in the NIST CPE dictionary. Let's programmatically build the
CPE_NAME in the build process in order to be scanned.

CPE_NAME is part of /etc/os-release with the following manual entry:

CPE_NAME=
  A CPE name for the operating system, in URI binding syntax, following the Common Platform Enumeration Specification[2] as proposed by the NIST.
  This field is optional. Example: "CPE_NAME="cpe:/o:fedoraproject:fedora:17""
...
[^2]: Common Platform Enumeration Specification
           http://scap.nist.gov/specifications/cpe/

Which indicates that the current version of CPE is 2.3.

Closes: flatcar/Flatcar#536

Signed-off-by: Mathieu Tortuyaux mtortuyaux@microsoft.com


CI: http://jenkins.infra.kinvolk.io:8080/job/os/job/manifest/4230/cldsv/

Output example with the image provided by this CI ⬆️ :

[bound] core@localhost ~ $ cat /etc/os-release
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=2021.11.23+dev-flatcar-master-4230
VERSION_ID=2021.11.23
BUILD_ID=dev-flatcar-master-4230
PRETTY_NAME="Flatcar Container Linux by Kinvolk 2021.11.23+dev-flatcar-master-4230 (Oklo)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar-linux.org/"
BUG_REPORT_URL="https://issues.flatcar-linux.org"
FLATCAR_BOARD="amd64-usr"
CPE_NAME="cpe:2.3:o:flatcar-linux:flatcar_linux:2021.11.23+dev-flatcar-master-4230:*:*:*:*:*:*:*"

Flatcar is in the NIST CPE dictionary. Let's programmatically build the
`CPE_NAME` in the build process in order to be scanned.

`CPE_NAME` is part of `/etc/os-release` with the following manual entry:

```
CPE_NAME=
  A CPE name for the operating system, in URI binding syntax, following the Common Platform Enumeration Specification[2] as proposed by the NIST.
  This field is optional. Example: "CPE_NAME="cpe:/o:fedoraproject:fedora:17""
...
[^2]: Common Platform Enumeration Specification
           http://scap.nist.gov/specifications/cpe/
```

Which indicates that the current version of CPE is 2.3.

Closes: flatcar/Flatcar#536

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
@tormath1 tormath1 self-assigned this Nov 23, 2021
@tormath1 tormath1 marked this pull request as ready for review November 24, 2021 08:58
@tormath1 tormath1 requested review from a team and vbatts November 24, 2021 08:59
HOME_URL="https://flatcar-linux.org/"
BUG_REPORT_URL="https://issues.flatcar-linux.org"
FLATCAR_BOARD="$FLAGS_board"
CPE_NAME="cpe:2.3:o:${OS_ID}-linux:${OS_ID}_linux:${FLATCAR_VERSION}:*:*:*:*:*:*:*"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vbatts
Copy link
Copy Markdown
Member

vbatts commented Nov 24, 2021

@jepio jepio requested review from jepio and vbatts November 24, 2021 14:45
Copy link
Copy Markdown
Member

@jepio jepio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I pressed some button and the reviews disappeared.

@vbatts vbatts merged commit 5c21980 into main Nov 24, 2021
@vbatts vbatts deleted the tormath1/cpe branch November 24, 2021 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFE] include Flatcar CPE in /etc/os-release

4 participants