Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Dec 5, 2024
1 parent 57705be commit 7c69fdb
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 212 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/bin/bash
# platform = multi_platform_ubuntu

echo "#{{{ PRM_NAME }}}={{{ CORRECT_VALUE }}}" > /etc/security/faillock.conf
{{% if PRM_NAME == "fail_interval"%}}
# variables = var_accounts_passwords_pam_faillock_fail_interval=5
VALUE=6
{{% elif PRM_NAME == "unlock_time" %}}
# variables = var_accounts_passwords_pam_faillock_unlock_time=5
VALUE=6
{{% else %}}
VALUE=1
{{% endif %}}

echo "#{{{ PRM_NAME }}}=$VALUE" > /etc/security/faillock.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/bash
# platform = multi_platform_ubuntu

{{% if PRM_NAME == "fail_interval"%}}
# variables = var_accounts_passwords_pam_faillock_fail_interval=5
VALUE=6
{{% elif PRM_NAME == "unlock_time" %}}
# variables = var_accounts_passwords_pam_faillock_unlock_time=5
VALUE=6
{{% else %}}
VALUE=1
{{% endif %}}

{{{ bash_enable_pam_faillock_directly_in_pam_files() }}}
echo "{{{ PRM_NAME }}}={{{ CORRECT_VALUE }}}" > /etc/security/faillock.conf
echo "{{{ PRM_NAME }}}=$VALUE" > /etc/security/faillock.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#!/bin/bash
# platform = multi_platform_ubuntu

{{% if PRM_NAME == "fail_interval"%}}
# variables = var_accounts_passwords_pam_faillock_fail_interval=5
VALUE=6
{{% elif PRM_NAME == "unlock_time" %}}
# variables = var_accounts_passwords_pam_faillock_unlock_time=5
VALUE=6
{{% else %}}
VALUE=1
{{% endif %}}

cat << EOF > /usr/share/pam-configs/faillock
Name: Enable pam_faillock to deny access
Default: yes
Priority: 0
Auth-Type: Primary
Auth:
[default=die] pam_faillock.so authfail {{{ PRM_NAME }}}={{{ CORRECT_VALUE }}}
[default=die] pam_faillock.so authfail {{{ PRM_NAME }}}=$VALUE
EOF

cat << EOF > /usr/share/pam-configs/faillock_notify
Expand All @@ -16,7 +26,7 @@ Default: yes
Priority: 1024
Auth-Type: Primary
Auth:
requisite pam_faillock.so preauth {{{ PRM_NAME }}}={{{ CORRECT_VALUE }}}
requisite pam_faillock.so preauth {{{ PRM_NAME }}}=$VALUE
Account-Type: Primary
Account:
required pam_faillock.so
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/bin/bash
# platform = multi_platform_ubuntu

echo "{{{ PRM_NAME }}}={{{ CORRECT_VALUE }}}" > /etc/security/faillock.conf
{{% if PRM_NAME == "fail_interval"%}}
# variables = var_accounts_passwords_pam_faillock_fail_interval=5
VALUE=6
{{% elif PRM_NAME == "unlock_time" %}}
# variables = var_accounts_passwords_pam_faillock_unlock_time=5
VALUE=6
{{% else %}}
VALUE=1
{{% endif %}}

echo "{{{ PRM_NAME }}}=$VALUE" > /etc/security/faillock.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash
# platform = multi_platform_ubuntu

{{% if PRM_NAME == "fail_interval"%}}
# variables = var_accounts_passwords_pam_faillock_fail_interval=5
VALUE=4
{{% elif PRM_NAME == "unlock_time" %}}
# variables = var_accounts_passwords_pam_faillock_unlock_time=5
VALUE=4
{{% else %}}
# variables = var_accounts_passwords_pam_faillock_deny=5
VALUE=6
{{% endif %}}

{{{ bash_enable_pam_faillock_directly_in_pam_files() }}}
echo "{{{ PRM_NAME }}}={{{ WRONG_VALUE }}}" > /etc/security/faillock.conf
echo "{{{ PRM_NAME }}}=$VALUE" > /etc/security/faillock.conf

0 comments on commit 7c69fdb

Please sign in to comment.