Security audits with Lynis
Logger
Lynis generates multiple logs. Besides a profile containing the respective test scenario, it generates a logfile and a report. Lynis shows you the search paths for the individual files after starting the tests.
The report is the most important of these files. It not only contains a detailed list of all loaded kernel modules, data on the network interfaces, and the directory structures, but it also includes all of the installed packages, cron jobs, and the tests that have been run. These do not appear in plain text like in the program output, but with their internal designations. Lynis also outputs detailed information about the services loaded by the init system.
The report also contains several suggestions on how to harden the current system against attacks. However, these suggestions are somewhat cluttered and unstructured in the report. The suggestion
tag at the beginning of each line marks the individual suggestions.
Profiles
Lynis supports the use of different profiles. You can view a list of all existing profiles with lynis show profiles
. The preset profile uses all available options. If you only want to test certain components or services, you can create an additional profile for this purpose. There are no restrictions on the number of profiles.
The profiles are simple text files, which can be managed with any text editor. However, be careful not to modify the original profile. To use a specific profile during a test run, specify its name as an option when calling Lynis. To perform a test run with a specific profile, type the following at the prompt:
lynis audit --profile <profile>
When you assign names to new profiles that you generate from the default profile as a template, you should include the components to be tested in the name. For example, you can create specific profiles for different installations, but also group different server services, such as web or mail servers, into separate profiles. The security level can also be taken into account in individual profiles.
Regular Scanning
Especially in a corporate environment, you will want to run security scans regularly. A cron job gives you the ability to run Lynis at fixed intervals. To do this, the application offers the --cronjob
call parameter, which does a complete scan of the system. You also need to generate a matching script and create the associated paths to be able to save the report.
Automated tests will then run at regular intervals without any user interaction. The software also removes all special characters from the report to facilitate processing downstream. Users of the Enterprise variant also have the option to use the --upload
parameter to send the report to their own Lynis instance for auditing and documentation purposes [5].
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.
-
Plasma Desktop 6.1.4 Release Includes Improvements and Bug Fixes
The latest release from the KDE team improves the KWin window and composite managers and plenty of fixes.
-
Manjaro Team Tests Immutable Version of its Arch-Based Distribution
If you're a fan of immutable operating systems, you'll be thrilled to know that the Manjaro team is working on an immutable spin that is now available for testing.