CIS Hardening (sec-hardening)

Checks the system against CIS benchmark recommendations: sudo configuration, kernel parameters, PAM, audit logging, disk encryption, and more.

Configuration

ParameterTypeDefaultDescription
enabledbooltrueEnable/disable module
Linux Checks
check_sudobooltrueCheck sudoers for NOPASSWD
check_sysctlbooltrueCheck kernel parameters against expected values
check_pambooltrueCheck PAM password quality
check_auditdbooltrueCheck audit daemon status
check_reposbooltrueCheck package sources
check_luksbooltrueCheck disk encryption
allowed_nopasswd_userslist["root"]Allowed NOPASSWD users
expected_sysctldictsee belowExpected sysctl values
pam_minlenint8Minimum password length (pam_pwquality)
trusted_sourceslist[]Trusted package sources
Windows Checks
check_password_policybooltrueCheck password policy
check_audit_policybooltrueCheck audit policy
check_bitlockerbooltrueCheck BitLocker encryption
check_uacbooltrueCheck User Account Control
check_smb1booltrueCheck SMBv1 protocol
check_rdp_nlabooltrueCheck RDP Network Level Authentication
check_driversbooltrueCheck driver signatures
check_winrmbooltrueCheck WinRM encryption
min_password_lengthint8Minimum password length

Default sysctl Values

expected_sysctl:
  net.ipv4.ip_forward: "0"
  net.ipv4.conf.all.accept_redirects: "0"
  net.ipv4.tcp_syncookies: "1"
  net.ipv4.conf.all.send_redirects: "0"

YAML Example

sec_hardening:
  enabled: true
  check_sudo: true
  check_sysctl: true
  expected_sysctl:
    net.ipv4.ip_forward: "0"
    net.ipv4.tcp_syncookies: "1"
  pam_minlen: 12
  check_bitlocker: true
  min_password_length: 12

Diagnostic Codes

Linux

CodeSeverityMeaningRecommendation
74000Hardening baseline met
74011NOPASSWD in sudoersRemove NOPASSWD or explicitly allow user
74021sudoers permissions too openchmod 0440 /etc/sudoers
74031Kernel parameter deviatesAdjust sysctl value
74041No/weak password qualityConfigure pam_pwquality
74051auditd not activesystemctl enable --now auditd
74061auditd has no audit rulesConfigure audit rules
74071Unknown package sourceVerify source or add to trusted_sources
74081No LUKS encryptionSet up disk encryption

Windows

CodeSeverityMeaningRecommendation
84000Hardening baseline met
84011Minimum password length too shortStrengthen password policy
84021No account lockout configuredEnable lockout policy
84031Password age not limitedSet maximum password age
84041Audit subcategory not enabledEnable audit policy
84051Drive not encrypted with BitLockerEnable BitLocker
84061BitLocker protection suspendedResume protection
84072UAC disabledEnable UAC (EnableLUA = 1)
84081UAC at lowest levelIncrease ConsentPromptBehaviorAdmin
84091RDP without NLAEnable NLA
84101SMBv1 enabledDisable SMBv1
84111Unsigned driverVerify or replace driver
84121WinRM allows unencryptedEnforce encryption

Platform Support

  • Linux: Checks sudoers, sysctl, PAM, auditd, APT/YUM repos, LUKS.
  • Windows: Checks password/lockout/audit policies, BitLocker, UAC, SMB, RDP, WinRM, drivers.