mirror of
https://github.com/ovh/debian-cis.git
synced 2025-08-06 23:25:49 +02:00
Add sudo management in main and utils
* perform readonly checks as a regular user * sudo -n is used for checks requiring root privileges * increase accountability by providing log of individual access to sensitive files
This commit is contained in:
@@ -4,6 +4,7 @@ SCRIPT_NAME=${LONG_SCRIPT_NAME%.sh}
|
||||
CRITICAL_ERRORS_NUMBER=0 # This will be used to see if a script failed, or passed
|
||||
status=""
|
||||
forcedstatus=""
|
||||
SUDO_CMD=""
|
||||
|
||||
[ -r $CIS_ROOT_DIR/lib/constants.sh ] && . $CIS_ROOT_DIR/lib/constants.sh
|
||||
[ -r $CIS_ROOT_DIR/etc/hardening.cfg ] && . $CIS_ROOT_DIR/etc/hardening.cfg
|
||||
@@ -31,6 +32,9 @@ while [[ $# > 0 ]]; do
|
||||
info "Audit argument passed but script is disabled"
|
||||
fi
|
||||
;;
|
||||
--sudo)
|
||||
SUDO_CMD="sudo -n"
|
||||
;;
|
||||
*)
|
||||
debug "Unknown option passed"
|
||||
;;
|
||||
|
Reference in New Issue
Block a user