From dc0f93015b56fd1a7a2c543c4fa3d38d092ad169 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Tue, 23 Nov 2021 18:19:00 +0100 Subject: [PATCH] build_library/set_release: add CPE_NAME - v2.3 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: https://github.com/flatcar-linux/Flatcar/issues/536 Signed-off-by: Mathieu Tortuyaux --- build_library/set_lsb_release | 1 + 1 file changed, 1 insertion(+) diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index 5a1e4f62d7..2fa7c1bd1e 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -57,6 +57,7 @@ ANSI_COLOR="38;5;75" 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}:*:*:*:*:*:*:*" EOF sudo ln -sf "../usr/lib/os-release" "${ROOT_FS_DIR}/etc/os-release" sudo ln -sf "../../lib/os-release" "${ROOT_FS_DIR}/usr/share/flatcar/os-release"