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

[PKGS-7410] Does not detect the package containing the kernel. #1497

Open
ferorge opened this issue May 14, 2024 · 2 comments
Open

[PKGS-7410] Does not detect the package containing the kernel. #1497

ferorge opened this issue May 14, 2024 · 2 comments
Assignees
Labels
information-needed waiting-for-pull-request Waiting for the creation of a pull request

Comments

@ferorge
Copy link
Contributor

ferorge commented May 14, 2024

Is your feature request related to a problem? Please describe.
When lynis runs the test [PKGS-7410] it does not detect the package containing the kernel.
hardware: odroid xu4 hardkernel
OS: ubuntu 24.04 armhf
lynis:3.1.2

2024-05-14 05:28:28 ====
2024-05-14 05:28:28 Performing test ID PKGS-7410 (Count installed kernel packages)
2024-05-14 05:28:28 Test: Checking how many kernel packages are installed
2024-05-14 05:28:28 Result: found no kernels from dpkg -l output, which is unexpected
2024-05-14 05:28:28 Exception: test has an exceptional event (PKGS-7410) with text Could not find any kernel packages via package manager
2024-05-14 05:28:33 ====

# dpkg -S /boot/zImage
linux-odroid-5422: /boot/zImage

Describe the solution you'd like
I would like lynis to detect the package so that it doesn't find an exception.

Thank you so much!
Greetings!

@mboelen
Copy link
Member

mboelen commented May 14, 2024

What is the package name of the kernel that you see when running dpkg -l?

Then it can be added in include/tests_ports_packages on line 1345
KERNEL_PKG_NAMES="linux-image-[0-9]|raspberrypi-kernel|pve-kernel-[0-9]"

Would be great if you can test it, as this is very specific. If it works, a pull request would be very welcome (to give you the credit for reporting and testing).

@mboelen mboelen self-assigned this May 14, 2024
@mboelen mboelen added information-needed waiting-for-pull-request Waiting for the creation of a pull request labels May 14, 2024
@ferorge
Copy link
Contributor Author

ferorge commented Jul 23, 2024

Hi @mboelen

The solution you indicate is correct.

Line 1340 of the file /usr/share/lynis/include/tests_ports_packages looked like this:

KERNEL_PKG_NAMES="linux-image-[0-9]|raspberrypi-kernel|pve-kernel-[0-9]|linux-odroid-5422"

Output from lynis.log:

2024-07-23 06:02:15 Performing test ID PKGS-7410 (Count installed kernel packages)
2024-07-23 06:02:15 Test: Checking how many kernel packages are installed
2024-07-23 06:02:15 Result: found 1 kernel packages on the system, which is fine
2024-07-23 06:02:15 ====

The /boot/zImage file is the kernel.
I attach the output of the command:

dpkg -L linux-odroid-5422

/.
/boot
/boot/exynos5422-odroidhc1.dtb
/boot/exynos5422-odroidxu3-lite.dtb
/boot/exynos5422-odroidxu3.dtb
/boot/exynos5422-odroidxu4.dtb
/boot/exynos5422-samsung-k3g.dtb
/boot/overlays
/boot/overlays/ads7846.dtbo
/boot/overlays/hktft-cs-ogst.dtbo
/boot/overlays/hktft32.dtbo
/boot/overlays/hktft35.dtbo
/boot/overlays/i2c0.dtbo
/boot/overlays/i2c1.dtbo
/boot/overlays/onewire.dtbo
/boot/overlays/spi0.dtbo
/boot/overlays/sx865x-i2c1.dtbo
/boot/overlays/uart0.dtbo
/boot/zImage
/lib
desviado por base-files a: /lib.usr-is-merged
...

The output still lists all modules in /lib/modules/6.6.13-9/kernel and the source in /usr/src/linux-6.6.13-9/

ferorge added a commit to ferorge/lynis that referenced this issue Jul 23, 2024
Added kernel name for Hardkernel odroid XU4.
mboelen added a commit that referenced this issue Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
information-needed waiting-for-pull-request Waiting for the creation of a pull request
Projects
None yet
Development

No branches or pull requests

2 participants