diff --git a/CHANGELOG.md b/CHANGELOG.md index a3522551..2d4d7ad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,115 @@ # Lynis Changelog +## Lynis 3.0.0 (not released yet) + +This is a major release of Lynis and includes several big changes. +Some of these changes may break your current usage of the tool, so test before +deployment! + +### Breaking changes +- Some commands or switches are deprecated or removed +- Format of all profile options converted (from key:value to key=value) +- Non-interactive by default (use --wait option to pause between groups of tests) + +### Security +An important focus area for this release is on security. We added several +measures to further tighten any possible misuse. + +### Added +- Security: test PATH and warn or exit on discovery of dangerous location +- Security: additional safeguard by testing if common system tools are available +- Security: test parameters and arguments for presence of control characters +- Security: filtering out unexpected characters from profiles +- Security: test if setuid bit is set on Lynis binary +- New function: DisplayWarning - show a warning on the screen +- New function: Equals - compare two strings +- New function: Readonly - mark variable read-only (security) +- New function: SafeFile - test file type and call permission check +- New function: SafeInput - check for safe input (security) +- New profile option: disable-plugin - disables a single plugin +- New profile option: ssl-certificate-paths-to-ignore - ignore a path +- New test: CRYP-7930 - disk or file system encryption testing +- New test: PROC-3802 - Check presence of prelink tooling +- New report key: openssh_daemon_running +- New command: lynis generate systemd-units +- Measure timing of tests and report slow tests (10+ seconds) + +### Changed +- Function: CheckItem - returns only exit code (ITEM_FOUND value is dropped) +- Profiles: unused options removed +- Profiles: message is displayed when old format "key:value" is used +- Security: the 'nounset' (set -u) parameter is now activated by default +- Use only locations from PATH environment variable, unless it is not defined +- Show 'lynis generate hostids' when they are missing +- NAME-4408 - corrected Report function call +- NETW-3032 - small rewrite of test and extended with addrwatch +- PROC-3602 - allow different root directory +- PROC-3612 - show 'Not found' instead of 'OK' +- PROC-3614 - show 'Not found' instead of 'OK' +- SSH-7402 - detect other SSH daemons like dropbear +- Whow changelog works again for newer versions +- systemd service file adjusted +- bash completion script extended + +--------------------------------------------------------------------------------- + +## Lynis 2.7.5 (2019-06-24) + +### Added +- Danish translation +- Slackware end-of-life information +- Detect BSD-style (rc.d) init in Linux systems +- Detection of Bro and Suricata (IDS) + +### Changed +- Corrected end-of-life entries for CentOS 5 and 6 +- AUTH-9204 - change name to check in /etc/passwd file for QNAP devices +- AUTH-9268 - AIX enhancement to use correct find statement +- FILE-6310 - Filter on correct field for AIX +- NETW-3012 - set ss command as preferred option for Linux and changed output format +- List of PHP ini file locations has been extended +- Removed several pieces of the code as part of cleanup and code health +- Extended help + +--------------------------------------------------------------------------------- + + +## Lynis 2.7.4 (2019-04-21) + +This is a bigger release than usual, including several new tests created by +Capashenn (GitHub). It is a coincidence that it is released exactly one month +after the previous version and on Easter. No easter eggs, only improvements! + +### Added +- FILE-6324 - Discover XFS mount points +- INSE-8000 - Installed inetd package +- INSE-8100 - Installed xinetd package +- INSE-8102 - Status of xinet daemon +- INSE-8104 - xinetd configuration file +- INSE-8106 - xinetd configuration for inactive daemon +- INSE-8200 - Usage of TCP wrappers +- INSE-8300 - Presence of rsh client +- INSE-8302 - Presence of rsh server +- Detect equery binary detection +- New 'generate' command + +### Changed +- AUTH-9278 - Test LDAP in all PAM components on Red Hat and other systems +- PKGS-7410 - Add support for DPKG-based systems to gather installed kernel packages +- PKGS-7420 - Detect toolkit to automatically download and apply upgrades +- PKGS-7328 - Added global Zypper option --non-interactive +- PKGS-7330 - Added global Zypper option --non-interactive +- PKGS-7386 - Only show warning when vulnerable packages were discovered +- PKGS-7392 - Skip test for Zypper-based systems +- Minor changes to improve text output, test descriptions, and logging +- Changed CentOS identifiers in end-of-life database +- AIX enhancement for IsRunning function +- Extended PackageIsInstalled function +- Improve text output on AIX systems +- Corrected lsvg binary detection + +--------------------------------------------------------------------------------- + ## Lynis 2.7.3 (2019-03-21) ### Added diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..7f5895cd --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 3.x.x | :white_check_mark: | +| 2.x.x | :white_check_mark: | +| < 2.x | :x: | + +## Reporting a Vulnerability + +To report a vulnerability, use security@cisofy.com + +See our [security page](https://cisofy.com/security/) for more details. + +## Preferred language + +English + +## Acknowledgments + +https://cisofy.com/security/#thanks + +## Other + +See the latest 'security.txt' at https://cisofy.com/.well-known/security.txt diff --git a/db/languages/da b/db/languages/da new file mode 100644 index 00000000..d26c1220 --- /dev/null +++ b/db/languages/da @@ -0,0 +1,41 @@ +ERROR_NO_LICENSE="Ingen licensnøgle konfigureret" +ERROR_NO_UPLOAD_SERVER="Ingen upload server konfigureret" +GEN_CHECKING="Tjekker" +GEN_CURRENT_VERSION="Nuværende version" +GEN_DEBUG_MODE="Fejlfindingstilstand" +GEN_INITIALIZE_PROGRAM="Initialiserer program" +GEN_LATEST_VERSION="Seneste version" +GEN_PHASE="Fase" +GEN_PLUGINS_ENABLED="Plugins aktiverede" +GEN_UPDATE_AVAILABLE="opdatering tilgængelig" +GEN_VERBOSE_MODE="Detaljeret tilstand" +GEN_WHAT_TO_DO="At gøre" +NOTE_EXCEPTIONS_FOUND="Undtagelser fundet" +NOTE_EXCEPTIONS_FOUND_DETAILED="Nogle usædvanlige hændelser eller information var fundet" +NOTE_PLUGINS_TAKE_TIME="Bemærk: plugins har mere omfattende tests og kan tage flere minutter at fuldføre" +NOTE_SKIPPED_TESTS_NON_PRIVILEGED="Sprang over tests på grund af ikke-privilegeret tilstand" +SECTION_CUSTOM_TESTS="Brugerdefinerede Tests" +SECTION_MALWARE="Malware" +SECTION_MEMORY_AND_PROCESSES="Hukommelse og Processer" +STATUS_DISABLED="DEAKTIVERET" +STATUS_DONE="FÆRDIG" +STATUS_ENABLED="AKTIVERET" +STATUS_NOT_ENABLED="IKKE AKTIVERET" +STATUS_ERROR="FEJL" +STATUS_FOUND="FUNDET" +STATUS_YES="JA" +STATUS_NO="NEJ" +STATUS_OFF="FRA" +STATUS_OK="OK" +STATUS_ON="TIL" +STATUS_NONE="INGEN" +STATUS_NOT_FOUND="IKKE FUNDET" +STATUS_NOT_RUNNING="KØRER IKKE" +STATUS_RUNNING="KØRER" +STATUS_SKIPPED="SPRUNGET OVER" +STATUS_SUGGESTION="FORSLAG" +STATUS_UNKNOWN="UKENDT" +STATUS_WARNING="ADVARSEL" +STATUS_WEAK="SVAG" +TEXT_YOU_CAN_HELP_LOGFILE="Du kan hjælpe ved at bidrage med din logfil" +TEXT_UPDATE_AVAILABLE="opdatering tilgængelig" diff --git a/db/software-eol.db b/db/software-eol.db index 39edb2da..7b511237 100644 --- a/db/software-eol.db +++ b/db/software-eol.db @@ -11,9 +11,9 @@ # # CentOS # -os:CentOS 5:2017-03-31:1490911200: -os:CentOS 6:2020-11-30:1606690800: -os:CentOS 7:2024-06-30:1719698400: +os:CentOS release 5:2017-03-31:1490911200: +os:CentOS release 6:2020-11-30:1606690800: +os:CentOS Linux release 7:2024-06-30:1719698400: # # FreeBSD - https://www.freebsd.org/security/unsupported.html # @@ -42,5 +42,21 @@ os:Ubuntu 16.10:2017-07-01:1498860000: os:Ubuntu 17.04:2018-01-01:1514761200: os:Ubuntu 17.10:2018-07-01:1530396000: os:Ubuntu 18.04:2023-05-01:1682892000: -os:Ubuntu 18.10:2019-07-01:1561932000: -os:Ubuntu 19.04:2020-01-01:1577833200: \ No newline at end of file +os:Ubuntu 18.10:2019-07-18:1563400800: +os:Ubuntu 19.04:2020-01-01:1577833200: +# +# Slackware - https://en.wikipedia.org/wiki/Slackware#Releases +# +os:Slackware Linux 8.1:2012-08-01:1343768400: +os:Slackware Linux 9.0:2012-08-01:1343768400: +os:Slackware Linux 9.1:2012-08-01:1343768400: +os:Slackware Linux 10.0:2012-08-01:1343768400: +os:Slackware Linux 10.1:2012-08-01:1343768400: +os:Slackware Linux 10.2:2012-08-01:1343768400: +os:Slackware Linux 11.0:2012-08-01:1343768400: +os:Slackware Linux 12.0:2012-08-01:1343768400: +os:Slackware Linux 12.1:2013-12-09:1386540000: +os:Slackware Linux 12.2:2013-12-09:1386540000: +os:Slackware Linux 13.0:2018-07-05:1530738000: +os:Slackware Linux 13.1:2018-07-05:1530738000: +os:Slackware Linux 13.37:2018-07-05:1530738000: diff --git a/db/tests.db b/db/tests.db index 641ea927..cd978c50 100644 --- a/db/tests.db +++ b/db/tests.db @@ -84,6 +84,7 @@ CONT-8107:test:performance:containers::Check number of unused Docker containers: CONT-8108:test:security:containers::Check file permissions for Docker files: CORE-1000:test:performance:system_integrity::Check all system binaries: CRYP-7902:test:security:crypto::Check expire date of SSL certificates: +CRYP-7930:test:security:crypto::Determine if system uses disk or file encryption: DNS-1600:test:security:dns::Validating that the DNSSEC signatures are checked: DBS-1804:test:security:databases::Checking active MySQL process: DBS-1816:test:security:databases::Checking MySQL root password: @@ -169,11 +170,17 @@ HTTP-6712:test:security:webservers::Check nginx access logging: HTTP-6714:test:security:webservers::Check for missing error logs in nginx: HTTP-6716:test:security:webservers::Check for debug mode on error log in nginx: HTTP-6720:test:security:webservers::Check Nginx log files: -INSE-8002:test:security:insecure_services::Check for enabled inet daemon: -INSE-8004:test:security:insecure_services::Check for enabled inet daemon: -INSE-8006:test:security:insecure_services::Check configuration of inetd when disabled: +INSE-8000:test:security:insecure_services::Installed inetd package: +INSE-8002:test:security:insecure_services::Status of inet daemon: +INSE-8004:test:security:insecure_services::Presence of inetd configuration file: +INSE-8006:test:security:insecure_services::Check configuration of inetd when it is disabled: INSE-8016:test:security:insecure_services::Check for telnet via inetd: INSE-8050:test:security:insecure_services:MacOS:Check for insecure services on macOS systems: +INSE-8100:test:security:insecure_services::Installed xinetd package: +INSE-8116:test:security:insecure_services::Insecure services enabled via xinetd: +INSE-8200:test:security:insecure_services::Usage of TCP wrappers: +INSE-8300:test:security:insecure_services::Presence of rsh client: +INSE-8302:test:security:insecure_services::Presence of rsh server: KRNL-5622:test:security:kernel:Linux:Determine Linux default run level: KRNL-5677:test:security:kernel:Linux:Check CPU options and support: KRNL-5695:test:security:kernel:Linux:Determine Linux kernel version and release number: @@ -319,6 +326,7 @@ PKGS-7393:test:security:ports_packages::Check for Gentoo vulnerable packages: PKGS-7394:test:security:ports_packages:Linux:Check for Ubuntu updates: PKGS-7398:test:security:ports_packages::Check for package audit tool: PKGS-7410:test:security:ports_packages::Count installed kernel packages: +PKGS-7420:test:security:ports_packages::Detect toolkit to automatically download and apply upgrades: PRNT-2302:test:security:printers_spools:FreeBSD:Check for printcap consistency: PRNT-2304:test:security:printers_spools::Check cupsd status: PRNT-2306:test:security:printers_spools::Check CUPSd configuration file: @@ -332,6 +340,7 @@ PROC-3602:test:security:memory_processes:Linux:Checking /proc/meminfo for memory PROC-3604:test:security:memory_processes:Solaris:Query prtconf for memory details: PROC-3612:test:security:memory_processes::Check dead or zombie processes: PROC-3614:test:security:memory_processes::Check heavy IO waiting based processes: +PROC-3802:test:security:memory_processes::Check presence of prelink tooling: RBAC-6272:test:security:mac_frameworks::Check grsecurity presence: SCHD-7702:test:security:scheduling::Check status of cron daemon: SCHD-7704:test:security:scheduling::Check crontab/cronjobs: diff --git a/default.prf b/default.prf index ef474b1f..1431beb6 100644 --- a/default.prf +++ b/default.prf @@ -1,30 +1,33 @@ ################################################################################# # # -# Lynis - Scan Profile (default) -# -# This is the default profile and contains default values. +# Lynis - Default scan profile # # ################################################################################# # # -# SUGGESTION +# This profile provides Lynis with most of its initial values to perform a +# system audit. +# +# +# WARNINGS # ---------- # -# Do NOT make changes to this file, instead copy your preferred settings to -# custom.prf and put it in the same directory as default.prf +# Do NOT make changes to this file. Instead, copy only your changes into +# the file custom.prf and put it in the same directory as default.prf # # To discover where your profiles are located: lynis show profiles # # +# Lynis performs a strict check on profiles to avoid the inclusion of +# possibly harmful injections. See include/profiles for details. +# +# ################################################################################# # # All empty lines or with the # prefix will be skipped # -# More information about this plugin can be found in the documentation: -# https://cisofy.com/documentation/lynis/ -# ################################################################################# # Use colored output @@ -33,6 +36,9 @@ colors=yes # Compressed uploads (set to zero when errors with uploading occur) compressed-uploads=yes +# Amount of connections in WAIT state before reporting it as a suggestion +#connections-max-wait-state=5000 + # Debug mode (for debugging purposes, extra data logged to screen) #debug=yes @@ -42,20 +48,27 @@ error-on-warnings=no # Use Lynis in your own language (by default auto-detected) language= -# Lynis Enterprise license key -license-key= +# Log tests from another guest operating system (default: yes) +#log-tests-incorrect-os=yes + +# Define if available NTP daemon is configured as a server or client on the network +# values: server or client (default: client) +#ntpd-role=client # Defines the role of the system (personal, workstation or server) machine-role=server +# Ignore some stratum 16 hosts (for example when running as time source itself) +#ntp-ignore-stratum-16-peer=127.0.0.1 + # Profile name, will be used as title/description profile-name=Default Audit Template # Number of seconds to pause between every test (0 is no pause) pause-between-tests=0 -# Enable quick mode (no waiting for keypresses, same as --quick option) -quick=no +# Quick mode (do not wait for keypresses) +quick=yes # Refresh software repositories to help detecting vulnerable packages refresh-repositories=yes @@ -76,39 +89,20 @@ skip-plugins=no #skip-test=SSH-7408:loglevel #skip-test=SSH-7408:permitrootlogin +# Skip Lynis upgrade availability test (default: no) +#skip-upgrade-test=yes + +# Locations where to search for SSL certificates (separate paths with a colon) +ssl-certificate-paths=/etc/apache2:/etc/dovecot:/etc/httpd:/etc/letsencrypt:/etc/pki:/etc/postfix:/etc/ssl:/opt/psa/var/certificates:/usr/local/psa/var/certificates:/usr/local/share/ca-certificates:/var/www:/srv/www +ssl-certificate-paths-to-ignore=/etc/letsencrypt/archive: + # Scan type - how deep the audit should be (light, normal or full) test-scan-mode=full -# Upload data to central server -upload=no - -# The hostname/IP address to receive the data -upload-server= - -# Provide options to cURL (or other upload tool) when uploading data. -# upload-options=--insecure --> use HTTPS, but skip certificate check (e.g. self-signed) -upload-options= - # Verbose output verbose=no -################################################################################# -# -# Upgrade and updating -# -------------------- -# -# The old settings to do automatic updating are deprecated. It is suggested to -# use a package or deploy your the tarball via a custom script. -# -# The latest packages can be found at: https://packages.cisofy.com -# -################################################################################# - -# Skip Lynis upgrade availability test (default: no) -#skip-upgrade-test=yes - - ################################################################################# # # Plugins @@ -119,10 +113,11 @@ verbose=no # - Nothing happens if plugin isn't available # - There is no order in execution of plugins # - See documentation about how to use plugins and phases +# - Some are for Lynis Enterprise users only # ################################################################################# -# Lynis Plugins (some are for Lynis Enterprise users only) +# Lynis plugins to enable plugin=authentication plugin=compliance plugin=configuration @@ -149,17 +144,22 @@ plugin=system-integrity plugin=systemd plugin=users +# Disable a particular plugin (will overrule an enabled plugin) +#disable-plugin=authentication ################################################################################# # # Kernel options # --------------- -# sysctl::::: +# configdate=, followed by: # -# Sysctl key = name -# Expected value = value of sysctl key -# Hardening points = Number of hardening points. For most keys 1 HP will be suitable -# Description = Text description of key +# - Type = Set to 'sysctl' +# - Setting = value of sysctl key (e.g. kernel.sysrq) +# - Expected value = Preferred value for key (e.g. 0) +# - Hardening Points = Number of hardening points (typically 1 point per key) (1) +# - Description = Textual description about the sysctl key(Disable magic SysRQ) +# - Related file or command = For example, sysctl -a to retrieve more details +# - Solution field = Specifies more details or where to find them (url:URL, text:TEXT, or -) # ################################################################################# @@ -269,86 +269,58 @@ config-data=sysctl;security.bsd.hardlink_check_gid;1;1;Unprivileged processes ar config-data=sysctl;security.bsd.hardlink_check_uid;1;1;Unprivileged processes are not allowed to create hard links to files which are owned by other users;-;category:security; -################################################################################# -# -# Apache options -# columns: (1)apache : (2)option : (3)value -# -################################################################################# - -apache:ServerTokens:Prod: - - -################################################################################# -# -# OpenLDAP options -# columns: (1)openldap : (2)file : (3)option : (4)expected value(s) -# -################################################################################# - -openldap:slapd.conf:permissions:640-600: -openldap:slapd.conf:owner:ldap-root: - - - - -################################################################################# -# -# NTP options -# -################################################################################# - -# Ignore some stratum 16 hosts (for example when running as time source itself) -#ntp-ignore-stratum-16-peer=127.0.0.1 - - -################################################################################# -# -# File/directories permissions (currently not used yet) -# -################################################################################# - -# Scan for exact file name match -#[scanfiles] -#scanfile:/etc/rc.conf:FreeBSD configuration: - -# Scan for exact directory name match -#[scandirs] -#scandir:/etc:/etc directory: - - ################################################################################# # # permfile # --------------- -# permfile:file name:file permissions:owner:group:action: +# permfile=file name:file permissions:owner:group:action: # Action = NOTICE or WARN # Examples: -# permfile:/etc/test1.dat:600:root:wheel:NOTICE: -# permfile:/etc/test1.dat:640:root:-:WARN: +# permfile=/etc/test1.dat:600:root:wheel:NOTICE: +# permfile=/etc/test1.dat:640:root:-:WARN: # ################################################################################# -#permfile:/etc/inetd.conf:rw-------:root:-:WARN: -#permfile:/etc/fstab:rw-r--r--:root:-:WARN: -permfile:/etc/lilo.conf:rw-------:root:-:WARN: - +#permfile=/etc/inetd.conf:rw-------:root:-:WARN: +#permfile=/etc/fstab:rw-r--r--:root:-:WARN: +permfile=/boot/grub2/grub.cfg:rw-------:root:root:WARN: +permfile=/boot/grub/grub.cfg:rw-------:root:root:WARN: +permfile=/boot/grub2/user.cfg:rw-------:root:root:WARN: +permfile=/etc/at.allow:rw-------:root:-:WARN: +permfile=/etc/at.deny:rw-------:root:-:WARN: +permfile=/etc/cron.allow:rw-------:root:-:WARN: +permfile=/etc/cron.deny:rw-------:root:-:WARN: +permfile=/etc/crontab:rw-------:root:-:WARN: +permfile=/etc/group:rw-r--r--:root:-:WARN: +permfile=/etc/group-:rw-r--r--:root:-:WARN: +permfile=/etc/gshadow:---------:root:-:WARN: +permfile=/etc/gshadow-:---------:root:-:WARN: +permfile=/etc/hosts.allow:rw-r--r--:root:root:WARN: +permfile=/etc/hosts.deny:rw-r--r--:root:root:WARN: +permfile=/etc/issue:rw-r--r--:root:root:WARN: +permfile=/etc/issue.net:rw-r--r--:root:root:WARN: +permfile=/etc/lilo.conf:rw-------:root:-:WARN: +permfile=/etc/motd:rw-r--r--:root:root:WARN: +permfile=/etc/passwd:rw-r--r--:root:-:WARN: +permfile=/etc/passwd-:rw-r--r--:root:-:WARN: +permfile=/etc/shadow:---------:root:-:WARN: +permfile=/etc/shadow-:---------:root:-:WARN: +permfile=/etc/ssh/sshd_config:rw-------:root:-:WARN: ################################################################################# # # permdir # --------------- -# permdir:directory name:file permissions:owner:group:action when permissions are different: +# permdir=directory name:file permissions:owner:group:action when permissions are different: # ################################################################################# -permdir:/root/.ssh:rwx------:root:-:WARN: - -# Scan for a program/binary in BINPATHs -#scanbinary:Rootkit Hunter:rkhunter: - -# Amount of connections in WAIT state before reporting it as a suggestion -#connections-max-wait-state=5000 +permdir=/root/.ssh:rwx------:root:-:WARN: +permdir=/etc/cron.d:rwx------:root:root:WARN: +permdir=/etc/cron.daily:rwx------:root:root:WARN: +permdir=/etc/cron.hourly:rwx------:root:root:WARN: +permdir=/etc/cron.weekly:rwx------:root:root:WARN: +permdir=/etc/cron.monthly:rwx------:root:root:WARN: # Ignore some specific home directories @@ -356,12 +328,6 @@ permdir:/root/.ssh:rwx------:root:-:WARN: # checks, like file permissions, SSH and other configuration files #ignore-home-dir=/home/user -# Do not log tests with another guest operating system (default: yes) -#log-tests-incorrect-os=no - -# Define if available NTP daemon is configured as a server or client on the network -# values: server or client (default: client) -#ntpd-role=client # Allow promiscuous interfaces #