diff options
| author | Michael Opdenacker <michael.opdenacker@rootcommit.com> | 2025-08-19 20:39:46 +0000 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@intel.com> | 2025-09-12 08:15:13 +0800 |
| commit | 2222925e923f8b151f62a7a5fb343be52aab0b15 (patch) | |
| tree | 6e6fcf1967ce0dd01928622595db641f230468ab | |
| parent | f2b163a416a1e96b8a4e6f428380fdbfc1fcaaec (diff) | |
| download | meta-openembedded-2222925e923f8b151f62a7a5fb343be52aab0b15.tar.gz | |
kernel-hardening-checker: backport recipe
This recipe is a Scarthgap backport of kernel-hardening-checker_0.6.10.2.bb
in the master branch as of August 19, 2025.
Tested on qemux86-64 and on beaglebone-yocto
Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
3 files changed, 101 insertions, 0 deletions
diff --git a/meta-oe/recipes-security/kernel-hardening-checker/files/0001-pyproject.toml-fix-up-license-information.patch b/meta-oe/recipes-security/kernel-hardening-checker/files/0001-pyproject.toml-fix-up-license-information.patch new file mode 100644 index 0000000000..4460146722 --- /dev/null +++ b/meta-oe/recipes-security/kernel-hardening-checker/files/0001-pyproject.toml-fix-up-license-information.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From e94c486c6c3473979ce5be627f030cc95ce165e6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Michael Opdenacker <michael.opdenacker@rootcommit.com> | ||
| 3 | Date: Sun, 17 Aug 2025 17:27:21 +0200 | ||
| 4 | Subject: [PATCH 1/2] pyproject.toml: fix up license information | ||
| 5 | |||
| 6 | Without this change, the Python tooling complains that you | ||
| 7 | can't have both "license" and "license-files" settings in pyproject.toml. | ||
| 8 | |||
| 9 | This issue doesn't happen any more with the Python tooling | ||
| 10 | in master (as of August 2025), so it's irrelevant for upstream. | ||
| 11 | |||
| 12 | Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com> | ||
| 13 | Upstream-Status: Inappropriate [oe specific] | ||
| 14 | --- | ||
| 15 | pyproject.toml | 3 +-- | ||
| 16 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/pyproject.toml b/pyproject.toml | ||
| 19 | index a0b75c3..79e710b 100644 | ||
| 20 | --- a/pyproject.toml | ||
| 21 | +++ b/pyproject.toml | ||
| 22 | @@ -20,8 +20,7 @@ authors = [ | ||
| 23 | maintainers = [ | ||
| 24 | {name = "Alexander Popov", email = "alex.popov@linux.com"} | ||
| 25 | ] | ||
| 26 | -license = "GPL-3.0-only" | ||
| 27 | -license-files = ["LICENSE.txt"] | ||
| 28 | +license = { text = "GPL-3.0-only" } | ||
| 29 | classifiers = [ | ||
| 30 | "Development Status :: 5 - Production/Stable", | ||
| 31 | "Topic :: Security", | ||
diff --git a/meta-oe/recipes-security/kernel-hardening-checker/files/0002-pyproject.toml-relax-setuptool-version-requirement.patch b/meta-oe/recipes-security/kernel-hardening-checker/files/0002-pyproject.toml-relax-setuptool-version-requirement.patch new file mode 100644 index 0000000000..05a8126c4e --- /dev/null +++ b/meta-oe/recipes-security/kernel-hardening-checker/files/0002-pyproject.toml-relax-setuptool-version-requirement.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From 7c64511d2dcb58bc4d83dd41667c1f9295ca9712 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Michael Opdenacker <michael.opdenacker@rootcommit.com> | ||
| 3 | Date: Tue, 19 Aug 2025 21:47:05 +0200 | ||
| 4 | Subject: [PATCH 2/2] pyproject.toml: relax setuptool version requirement | ||
| 5 | |||
| 6 | To match with what's available in Scarthgap | ||
| 7 | It turns out that setuptools 69 is sufficient for building this tool. | ||
| 8 | The developer may have aligned the version with his testing environment. | ||
| 9 | |||
| 10 | This patch is not needed on meta-openembedded master which has a recent enough | ||
| 11 | version. | ||
| 12 | |||
| 13 | Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com> | ||
| 14 | Upstream-Status: Inappropriate [oe specific] | ||
| 15 | --- | ||
| 16 | pyproject.toml | 2 +- | ||
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/pyproject.toml b/pyproject.toml | ||
| 20 | index 79e710b..a8b59d8 100644 | ||
| 21 | --- a/pyproject.toml | ||
| 22 | +++ b/pyproject.toml | ||
| 23 | @@ -1,5 +1,5 @@ | ||
| 24 | [build-system] | ||
| 25 | -requires = ["setuptools >= 77.0.3"] | ||
| 26 | +requires = ["setuptools >= 69"] | ||
| 27 | build-backend = "setuptools.build_meta" | ||
| 28 | |||
| 29 | [tool.setuptools.packages.find] | ||
diff --git a/meta-oe/recipes-security/kernel-hardening-checker/kernel-hardening-checker_0.6.10.2.bb b/meta-oe/recipes-security/kernel-hardening-checker/kernel-hardening-checker_0.6.10.2.bb new file mode 100644 index 0000000000..c0ae0f0d3c --- /dev/null +++ b/meta-oe/recipes-security/kernel-hardening-checker/kernel-hardening-checker_0.6.10.2.bb | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | SUMMARY = "A tool for checking the security hardening options of the Linux kernel" | ||
| 2 | DESCRIPTION = "\ | ||
| 3 | There are plenty of security hardening options for the Linux kernel; Kconfig \ | ||
| 4 | options (compile-time); Kernel cmdline arguments (boot-time); Sysctl \ | ||
| 5 | parameters (runtime). A lot of them have to be enabled manually to make the \ | ||
| 6 | system more secure which is difficult to track. This tool helps with this \ | ||
| 7 | task by checking and reporting about the settings compared to a list of \ | ||
| 8 | recommendation. \ | ||
| 9 | " | ||
| 10 | HOMEPAGE = "https://github.com/a13xp0p0v/kernel-hardening-checker" | ||
| 11 | BUGTRACKER = "https://github.com/a13xp0p0v/kernel-hardening-checker/issues" | ||
| 12 | LICENSE = "GPL-3.0-only" | ||
| 13 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=d32239bcb673463ab874e80d47fae504" | ||
| 14 | |||
| 15 | SRC_URI = "git://github.com/a13xp0p0v/kernel-hardening-checker;protocol=https;branch=master \ | ||
| 16 | file://0001-pyproject.toml-fix-up-license-information.patch \ | ||
| 17 | file://0002-pyproject.toml-relax-setuptool-version-requirement.patch" | ||
| 18 | |||
| 19 | SRCREV = "0ebece346f187e7d3589883cc1d194fcd1c3cda8" | ||
| 20 | |||
| 21 | S = "${WORKDIR}/git" | ||
| 22 | |||
| 23 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 24 | |||
| 25 | RDEPENDS:${PN} = "\ | ||
| 26 | python3-json \ | ||
| 27 | python3-misc \ | ||
| 28 | python3-compression \ | ||
| 29 | bash \ | ||
| 30 | " | ||
| 31 | |||
| 32 | # /boot/config is required for the analysis | ||
| 33 | RRECOMMENDS:${PN}:class-target = "\ | ||
| 34 | kernel-dev \ | ||
| 35 | " | ||
| 36 | |||
| 37 | inherit python_setuptools_build_meta | ||
| 38 | |||
| 39 | # allow to run on build host, if you don't want it in the image | ||
| 40 | # oe-run-native kernel-hardening-checker-native kernel-hardening-checker ... | ||
| 41 | BBCLASSEXTEND = "native" | ||
