-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align the pam_account_password_faillock template tests with oval chec…
…k logic
- Loading branch information
1 parent
a1003e9
commit 83e684f
Showing
5 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
shared/templates/pam_account_password_faillock/tests/ubuntu_correct.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
SIGN='=' | ||
{{% if EXT_VARIABLE %}} | ||
VALUE=1 | ||
{{% else %}} | ||
if [[ {{{ VARIABLE_UPPER_BOUND }}} =~ ^[0-9]+$ ]]; then | ||
VALUE=$(( {{{ VARIABLE_UPPER_BOUND }}} - 1 )) | ||
elif [[ {{{ VARIABLE_LOWER_BOUND }}} =~ ^[0-9]+$ ]]; then | ||
VALUE=$(( {{{ VARIABLE_LOWER_BOUND }}} + 1 )) | ||
else | ||
SIGN="" | ||
fi | ||
{{% endif %}} | ||
|
||
{{{ bash_enable_pam_faillock_directly_in_pam_files() }}} | ||
echo "{{{ PRM_NAME }}}={{{ VARIABLE_LOWER_BOUND }}}" > /etc/security/faillock.conf | ||
echo "{{{ PRM_NAME }}}$SIGN$VALUE" > /etc/security/faillock.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
shared/templates/pam_account_password_faillock/tests/ubuntu_wrong_value.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
SIGN='=' | ||
{{% if EXT_VARIABLE %}} | ||
VALUE=1 | ||
if [[ {{{ VARIABLE_UPPER_BOUND }}} == "use_ext_variable" ]]; then | ||
VALUE=$(( $VALUE + 1 )) | ||
elif [[ {{{ VARIABLE_LOWER_BOUND }}} == "use_ext_variable" ]]; then | ||
VALUE=$(( $VALUE - 1 )) | ||
fi | ||
{{% else %}} | ||
if [[ {{{ VARIABLE_UPPER_BOUND }}} =~ ^[0-9]+$ ]]; then | ||
VALUE=$(( {{{ VARIABLE_UPPER_BOUND }}} + 1 )) | ||
elif [[ {{{ VARIABLE_LOWER_BOUND }}} =~ ^[0-9]+$ ]]; then | ||
VALUE=$(( {{{ VARIABLE_LOWER_BOUND }}} - 1 )) | ||
else | ||
SIGN="" | ||
fi | ||
{{% endif %}} | ||
|
||
{{{ bash_enable_pam_faillock_directly_in_pam_files() }}} | ||
echo "{{{ PRM_NAME }}}={{{ VARIABLE_UPPER_BOUND }}}" > /etc/security/faillock.conf |