mirror of
https://github.com/CISOfy/lynis.git
synced 2026-03-11 08:55:28 +00:00
Added check to ensure that common system tools are defined as extra safety measure
This commit is contained in:
parent
08e8e59197
commit
5e4e44bdf3
1 changed files with 22 additions and 0 deletions
|
|
@ -269,6 +269,28 @@
|
|||
LogText "Result: checking of binaries skipped in this mode"
|
||||
fi
|
||||
|
||||
# Test if the basic system tools are defined. These will be used during the audit.
|
||||
[ "${AWKBINARY:-}" ] || ExitFatal "awk binary not found"
|
||||
[ "${CUTBINARY:-}" ] || ExitFatal "cut binary not found"
|
||||
[ "${EGREPBINARY:-}" ] || ExitFatal "grep binary not found"
|
||||
[ "${FINDBINARY:-}" ] || ExitFatal "find binary not found"
|
||||
[ "${GREPBINARY:-}" ] || ExitFatal "grep binary not found"
|
||||
[ "${HEADBINARY:-}" ] || ExitFatal "head binary not found"
|
||||
[ "${LSBINARY:-}" ] || ExitFatal "ls binary not found"
|
||||
[ "${PSBINARY:-}" ] || ExitFatal "ps binary not found"
|
||||
[ "${SEDBINARY:-}" ] || ExitFatal "sed binary not found"
|
||||
[ "${SORTBINARY:-}" ] || ExitFatal "sort binary not found"
|
||||
[ "${TRBINARY:-}" ] || ExitFatal "tr binary not found"
|
||||
[ "${UNIQBINARY:-}" ] || ExitFatal "uniq binary not found"
|
||||
[ "${WCBINARY:-}" ] || ExitFatal "wc binary not found"
|
||||
|
||||
# Test a few other tools that we did not specifically define (yet)
|
||||
TOOLS="xxd"
|
||||
for T in ${TOOLS}; do
|
||||
DATA=$(type ${T})
|
||||
if [ $? -gt 0 ]; then ExitFatal "${T} binary not found"; fi
|
||||
done
|
||||
|
||||
#
|
||||
#================================================================================
|
||||
# Lynis - Security Auditing and System Hardening for Linux and UNIX - https://cisofy.com
|
||||
|
|
|
|||
Loading…
Reference in a new issue