CISOfy / lynis

Lynis - Security auditing tool for Linux, macOS, and UNIX-based systems. Assists with compliance testing (HIPAA/ISO27001/PCI DSS) and system hardening. Agentless, and installation optional.
https://cisofy.com/lynis/
GNU General Public License v3.0
13.47k stars 1.49k forks source link

Function/test: [KRNL-5840:1] - Could not find any kernel packages via package manager #1020

Closed daniejstriata closed 4 years ago

daniejstriata commented 4 years ago

Describe the bug On a LXC container you might find no kernels installed as the host kernel is used.

Version LXC container running ubuntu 20.04 on Proxmox host.

Expected behaviour It should be known if a host is a container and not a VM or host.

I have this check in one of my scripts. If it fails if [[ $(find /boot/ -maxdepth 1 -name 'vmlinuz*' -print -quit) ]]; then I know it is a container. Possibly better checks out there but this works without installing any new tools.


# uname -r
5.4.55-1-pve
# dpkg -l | grep linux-image
NULL
mboelen commented 4 years ago

Implemented using commit https://github.com/CISOfy/lynis/commit/61c6d5df8d156cdbfc670c3f641db06aa1b761db

Can you test next release if this gives the expected result (= no exception displayed)?