2014-08-26 17:33:55 +02:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
# Lynis
|
|
|
|
|
# ------------------
|
|
|
|
|
#
|
2015-01-03 12:45:22 +01:00
|
|
|
|
# Copyright 2007-2015, Michael Boelen, CISOfy (michael.boelen@cisofy.com)
|
2014-12-03 22:44:31 +01:00
|
|
|
|
# Web site: https://cisofy.com
|
2014-08-26 17:33:55 +02:00
|
|
|
|
#
|
|
|
|
|
# This software is licensed under GPL, version 3. See LICENSE file for
|
|
|
|
|
# usage of this software.
|
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
# Consts
|
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# Paths where system and program binaries are located
|
|
|
|
|
BINPATHS="/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin \
|
|
|
|
|
/usr/local/libexec /usr/libexec /usr/sfw/bin /usr/sfw/sbin \
|
|
|
|
|
/usr/sfw/libexec /opt/sfw/bin /opt/sfw/sbin /opt/sfw/libexec \
|
2014-12-03 22:44:31 +01:00
|
|
|
|
/usr/xpg4/bin /usr/css/bin /usr/ucb /usr/X11R6/bin /usr/X11R7/bin \
|
|
|
|
|
/usr/pkg/bin /usr/pkg/sbin"
|
2014-08-26 17:33:55 +02:00
|
|
|
|
|
|
|
|
|
# Do not use specific language, fall back to default
|
2015-07-22 12:20:27 +02:00
|
|
|
|
# Some tools with translated strings are very hard to parse
|
2014-08-26 17:33:55 +02:00
|
|
|
|
unset LANG
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
# Initialize defaults
|
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
# == Variable initializing ==
|
|
|
|
|
#
|
|
|
|
|
AUDITORNAME=""
|
|
|
|
|
PROFILE=""
|
|
|
|
|
REPORTFILE=""
|
|
|
|
|
AFICKBINARY=""
|
|
|
|
|
AIDEBINARY=""
|
|
|
|
|
AASTATUSBINARY=""
|
2014-10-13 19:56:44 +02:00
|
|
|
|
BINARY_SCAN_FINISHED=0
|
2015-01-30 13:14:18 +01:00
|
|
|
|
CHECK_BINARIES=1
|
2014-08-26 17:33:55 +02:00
|
|
|
|
CHKROOTKITBINARY=""
|
|
|
|
|
CHKCONFIGBINARY=""
|
2015-01-30 18:09:46 +01:00
|
|
|
|
CONTROL_URL_APPEND=""
|
|
|
|
|
CONTROL_URL_PREPEND=""
|
|
|
|
|
CUSTOM_URL_APPEND=""
|
|
|
|
|
CUSTOM_URL_PREPEND=""
|
2015-05-27 11:25:35 +02:00
|
|
|
|
DOCKER_DAEMON_RUNNING=0
|
2014-08-26 17:33:55 +02:00
|
|
|
|
FILEVALUE=""
|
|
|
|
|
FIND=""
|
2015-04-22 00:57:35 +02:00
|
|
|
|
FIREWALL_ACTIVE=0
|
2014-09-12 17:04:27 +02:00
|
|
|
|
FOUNDPATH=0
|
2015-01-30 13:14:18 +01:00
|
|
|
|
GREPBINARY="grep"
|
2014-08-26 17:33:55 +02:00
|
|
|
|
GRPCKBINARY=""
|
|
|
|
|
GROUP_NAME=""
|
2015-01-30 13:14:18 +01:00
|
|
|
|
HELPER=""
|
2014-09-19 16:44:22 +02:00
|
|
|
|
HOSTID=""
|
2014-08-26 17:33:55 +02:00
|
|
|
|
IPTABLESBINARY=""
|
|
|
|
|
LINUX_VERSION=""
|
|
|
|
|
LINUXCONFIGFILE=""
|
|
|
|
|
LOGFILE=""
|
2014-11-29 16:21:13 +01:00
|
|
|
|
LYNIS_COMPLIANCE_TESTS=0
|
2014-09-19 16:44:22 +02:00
|
|
|
|
MACHINEID=""
|
2015-04-22 00:57:35 +02:00
|
|
|
|
MALWARE_SCANNER_INSTALLED=0
|
2014-08-26 17:33:55 +02:00
|
|
|
|
NGINX_ACCESS_LOG_DISABLED=0
|
|
|
|
|
NGINX_ACCESS_LOG_MISSING=0
|
|
|
|
|
NGINX_ALIAS_FOUND=0
|
|
|
|
|
NGINX_ALLOW_FOUND=0
|
|
|
|
|
NGINX_DENY_FOUND=0
|
|
|
|
|
NGINX_ERROR_LOG_DEBUG=0
|
|
|
|
|
NGINX_ERROR_LOG_MISSING=0
|
|
|
|
|
NGINX_EXPIRES_FOUND=0
|
|
|
|
|
NGINX_FASTCGI_FOUND=0
|
|
|
|
|
NGINX_FASTCGI_PARAMS_FOUND=0
|
|
|
|
|
NGINX_FASTCGI_PASS_FOUND=0
|
|
|
|
|
NGINX_LISTEN_FOUND=0
|
|
|
|
|
NGINX_LOCATION_FOUND=0
|
|
|
|
|
NGINX_SSL_CIPHERS=0
|
|
|
|
|
NGINX_SSL_ON=0
|
|
|
|
|
NGINX_SSL_PREFER_SERVER_CIPHERS=0
|
|
|
|
|
NGINX_SSL_PROTOCOLS=0
|
|
|
|
|
NGINX_RETURN_FOUND=0
|
|
|
|
|
NGINX_ROOT_FOUND=0
|
|
|
|
|
OS=""; OS_MODE=""
|
|
|
|
|
OS_REDHAT_OR_CLONE=0
|
|
|
|
|
OSIRISBINARY=""
|
|
|
|
|
PIDFILE=""
|
|
|
|
|
PFFOUND=0
|
2014-09-25 11:25:07 +02:00
|
|
|
|
PRIVILEGED=0
|
2014-08-26 17:33:55 +02:00
|
|
|
|
PROFILEVALUE=""
|
2014-09-12 17:04:27 +02:00
|
|
|
|
PSBINARY="ps"
|
2014-08-26 17:33:55 +02:00
|
|
|
|
RKHUNTERBINARY=""
|
|
|
|
|
RPMBINARY=""
|
2015-01-30 13:14:18 +01:00
|
|
|
|
RUN_HELPERS=0
|
|
|
|
|
RUN_PLUGINS=1
|
|
|
|
|
RUN_TESTS=1
|
2014-08-26 17:33:55 +02:00
|
|
|
|
SAMHAINBINARY=""
|
|
|
|
|
SCAN_TEST_HEAVY=""; SCAN_TEST_MEDIUM=""; SCAN_TEST_LOW=""
|
|
|
|
|
SESTATUSBINARY=""
|
2014-11-29 16:21:13 +01:00
|
|
|
|
SERVICE_MANAGER=""
|
2015-04-30 01:23:47 +02:00
|
|
|
|
SHOW_PROGRAM_DETAILS=1
|
2015-01-30 13:14:18 +01:00
|
|
|
|
SHOW_REPORT=1
|
2014-09-08 15:12:44 +02:00
|
|
|
|
SKIPPED_TESTS_ROOTONLY=""
|
2014-08-26 17:33:55 +02:00
|
|
|
|
SSHKEYSCANBINARY=""
|
|
|
|
|
SSHKEYSCANFOUND=0
|
|
|
|
|
SYSLOGNGBINARY=""
|
|
|
|
|
TEST_SKIP_ALWAYS=""
|
|
|
|
|
TESTS_EXECUTED=""
|
|
|
|
|
TESTS_SKIPPED=""
|
|
|
|
|
TRIPWIREBINARY=""
|
2015-01-30 13:14:18 +01:00
|
|
|
|
UPLOAD_OPTIONS=""
|
2014-08-26 17:33:55 +02:00
|
|
|
|
UPDATE_CHECK_SKIPPED=0
|
|
|
|
|
VALUE=""
|
2015-05-26 11:10:50 +02:00
|
|
|
|
VMTYPE=""
|
2014-08-26 17:33:55 +02:00
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
2015-07-22 12:20:27 +02:00
|
|
|
|
# * Options
|
2014-08-26 17:33:55 +02:00
|
|
|
|
#
|
2015-07-22 12:20:27 +02:00
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
CRONJOB=0 # Run as a cronjob
|
|
|
|
|
CTESTS_PERFORMED=0 # Number of tests which are performed
|
2014-08-26 17:33:55 +02:00
|
|
|
|
DEBUG=0 # Debugging mode (to screen)
|
|
|
|
|
HPPOINTS=0 # Number of hardening points
|
|
|
|
|
HPTOTAL=0 # Maximum number of hardening points
|
2015-07-22 12:20:27 +02:00
|
|
|
|
LOG_INCORRECT_OS=1 # Log tests with incorrect OS
|
|
|
|
|
NEVERBREAK=0 # Don't wait for user input
|
2014-09-08 13:58:24 +02:00
|
|
|
|
PENTESTINGMODE=0 # Try tests without root privileges
|
2015-07-22 12:20:27 +02:00
|
|
|
|
QUICKMODE=0 # Don't wait for user input
|
|
|
|
|
QUIET=0 # Show normal messages and warnings as well
|
|
|
|
|
SHOW_TOOL_TIPS=1 # Show inline tool tips (default true)
|
|
|
|
|
SKIPLOGTEST=0 # Skip logging for one test
|
|
|
|
|
SKIP_UPGRADE_TEST=0 # Skip upgrade test
|
|
|
|
|
TESTS_TO_PERFORM="" # Which tests only to perform
|
|
|
|
|
TEST_PAUSE_TIME=0 # Default pause time
|
|
|
|
|
TOTAL_TESTS=0 # Total amount of tests (counter)
|
2014-08-26 17:33:55 +02:00
|
|
|
|
UPLOAD_DATA=0 # Upload of data to central node
|
2015-07-22 12:20:27 +02:00
|
|
|
|
VIEWHELP=0 # Show help
|
|
|
|
|
WRONGOPTION=0 # A wrong option is used
|
2014-08-26 17:33:55 +02:00
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
# Installed packages and other settings
|
|
|
|
|
COMPILER_INSTALLED=0
|
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
2015-07-22 12:20:27 +02:00
|
|
|
|
# * Colors
|
|
|
|
|
#
|
|
|
|
|
# For improved display
|
2014-08-26 17:33:55 +02:00
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
2015-07-22 12:20:27 +02:00
|
|
|
|
NORMAL="[0;39m"
|
|
|
|
|
WARNING="[1;31m" # Bad (red)
|
|
|
|
|
SECTION="[1;33m" # Section (yellow)
|
|
|
|
|
NOTICE="[1;33m" # Notice (yellow)
|
|
|
|
|
OK="[1;32m" # Ok (green)
|
|
|
|
|
BAD="[1;31m" # Bad (red)
|
2014-08-26 17:33:55 +02:00
|
|
|
|
|
2015-07-22 12:20:27 +02:00
|
|
|
|
# Normal color names
|
|
|
|
|
YELLOW="[1;33m"
|
|
|
|
|
WHITE="[1;37m"
|
|
|
|
|
GREEN="[1;32m"
|
|
|
|
|
RED="[1;31m"
|
2014-08-26 17:33:55 +02:00
|
|
|
|
PURPLE="[0;35m"
|
|
|
|
|
MAGENTA="[1;35m"
|
|
|
|
|
BROWN="[0;33m"
|
|
|
|
|
CYAN="[0;36m"
|
|
|
|
|
BLUE="[0;34m"
|
|
|
|
|
#
|
|
|
|
|
#################################################################################
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
#================================================================================
|
2015-01-03 12:45:22 +01:00
|
|
|
|
# Lynis - Copyright 2007-2015, Michael Boelen, CISOfy - https://cisofy.com
|