Skip to content

Commit

Permalink
Added uniq to prevent false negatives
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgendler committed Dec 12, 2024
1 parent 4ff2a13 commit bbc87ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ This document provides a high-level view of the changes to the macOS Security Co
*** os_sshd_unused_connection_timeout_configure
*** os_world_writable_library_folder_configure
*** pwpolicy_special_character_enforce
*** pwpolicy_history_enforce
*** pwpolicy_account_lockout_timeout_enforce
*** pwpolicy_account_lockout_enforce
*** system_settings_ssh_enable
** Removed Rules
*** system_settings_cd_dvd_sharing_disable
Expand Down
2 changes: 1 addition & 1 deletion rules/pwpolicy/pwpolicy_account_lockout_enforce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ discussion: |
This rule protects against malicious users attempting to gain access to the system via brute-force hacking methods.
check: |
/usr/bin/pwpolicy -getaccountpolicies 2> /dev/null | /usr/bin/tail +2 | /usr/bin/xmllint --xpath '//dict/key[text()="policyAttributeMaximumFailedAuthentications"]/following-sibling::integer[1]/text()' - | /usr/bin/awk '{ if ($1 <= $ODV) {print "yes"} else {print "no"}}'
/usr/bin/pwpolicy -getaccountpolicies 2> /dev/null | /usr/bin/tail +2 | /usr/bin/xmllint --xpath '//dict/key[text()="policyAttributeMaximumFailedAuthentications"]/following-sibling::integer[1]/text()' - | /usr/bin/awk '{ if ($1 <= $ODV) {print "yes"} else {print "no"}}' | /usr/bin/uniq
result:
string: 'yes'
fix: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ discussion: |
This rule protects against malicious users attempting to gain access to the system via brute-force hacking methods.
check: |
/usr/bin/pwpolicy -getaccountpolicies 2> /dev/null | /usr/bin/tail +2 | /usr/bin/xmllint --xpath '//dict/key[text()="autoEnableInSeconds"]/following-sibling::integer[1]/text()' - | /usr/bin/awk '{ if ($1/60 >= $ODV ) {print "yes"} else {print "no"}}'
/usr/bin/pwpolicy -getaccountpolicies 2> /dev/null | /usr/bin/tail +2 | /usr/bin/xmllint --xpath '//dict/key[text()="autoEnableInSeconds"]/following-sibling::integer[1]/text()' - | /usr/bin/awk '{ if ($1/60 >= $ODV ) {print "yes"} else {print "no"}}' | /usr/bin/uniq
result:
string: 'yes'
fix: |
Expand Down
2 changes: 1 addition & 1 deletion rules/pwpolicy/pwpolicy_history_enforce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ discussion: |
NOTE: The guidance for password based authentication in NIST 800-53 (Rev 5) and NIST 800-63B state that complexity rules should be organizationally defined. The values defined are based off of common complexity values. But your organization may define its own password complexity rules.
check: |
/usr/bin/pwpolicy -getaccountpolicies 2> /dev/null | /usr/bin/tail +2 | /usr/bin/xmllint --xpath '//dict/key[text()="policyAttributePasswordHistoryDepth"]/following-sibling::*[1]/text()' - | /usr/bin/awk '{ if ($1 >= $ODV ) {print "yes"} else {print "no"}}'
/usr/bin/pwpolicy -getaccountpolicies 2> /dev/null | /usr/bin/tail +2 | /usr/bin/xmllint --xpath '//dict/key[text()="policyAttributePasswordHistoryDepth"]/following-sibling::*[1]/text()' - | /usr/bin/awk '{ if ($1 >= $ODV ) {print "yes"} else {print "no"}}' | /usr/bin/uniq
result:
string: 'yes'
fix: |
Expand Down

0 comments on commit bbc87ba

Please sign in to comment.