mirror of
https://github.com/ovh/debian-cis.git
synced 2025-07-15 13:22:18 +02:00

- "users_homedir_is_configured.sh" is a concatenation of different existing scripts: - [users_homedir_exist.sh](https://github.com/ovh/debian-cis/blob/master/bin/hardening/users_homedir_exist.sh) - [users_homedir_ownership.sh](https://github.com/ovh/debian-cis/blob/master/bin/hardening/users_homedir_ownership.sh) - [check_user_dir_perm.sh](https://github.com/ovh/debian-cis/blob/master/bin/hardening/check_user_dir_perm.sh) And so is its test It will be mapped as 7.2.9 for debian 12 - The following scripts are a split from [5.3.1_enable_pwquality.sh](https://github.com/ovh/debian-cis/blob/master/bin/hardening/enable_pwquality.sh): - enable_libpam_pwquality.sh -> will be mapped as 5.3.2.3 - install_libpam_pwquality.sh -> will be mapped as 5.3.1.3 - password_complexity.sh -> will be mapped as 5.3.3.2.3 - password_min_length.sh -> will be mapped as 5.3.3.2.2 The others are scripts are new. They will be mapped as follow for debian 12 CIS : - apt_gpg_is_configured.sh -> 1.2.1.1 - dev_shm_separate_partition.sh -> 1.2.2.1 - install_iptables.sh -> 4.3.1.1 - install_nftables.sh -> 4.2.1 - password_consecutive_characters.sh -> 5.3.3.2.4 - password_max_sequential_characters.sh -> 5.3.3.2.5
22 lines
627 B
Bash
22 lines
627 B
Bash
# shellcheck shell=bash
|
|
# run-shellcheck
|
|
test_audit() {
|
|
PATTERN_COMMON='pam_pwquality.so'
|
|
FILE_COMMON='/etc/pam.d/common-password'
|
|
|
|
# create issue
|
|
sed -i '/'$PATTERN_COMMON'/d' "$FILE_COMMON"
|
|
|
|
describe Running non compliant
|
|
register_test retvalshouldbe 1
|
|
# shellcheck disable=2154
|
|
run noncompliant "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
|
|
|
sed -i 's/audit/enabled/' "${CIS_CONF_DIR}/conf.d/${script}.cfg"
|
|
"${CIS_CHECKS_DIR}/${script}.sh" || true
|
|
|
|
describe Checking resolved state
|
|
register_test retvalshouldbe 0
|
|
run resolved "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
|
}
|