-
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.
- Loading branch information
1 parent
c1b0b0a
commit 2a15dc8
Showing
7 changed files
with
168 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
18 changes: 18 additions & 0 deletions
18
...m/locking_out_password_attempts/accounts_password_pam_unix_authtok/tests/ubuntu_common.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
# remove all pam-auth-update configs which update the | ||
# primary password block and create a config with well defined | ||
# high priority to ensure correct stacking of our module | ||
grep -il "Password-Type: Primary" /usr/share/pam-configs/* | grep -v "/unix$" | xargs rm -f | ||
|
||
cat << EOF > /usr/share/pam-configs/cac_test_echo | ||
Name: Echo | ||
Default: yes | ||
Priority: 10000 | ||
Password-Type: Primary | ||
Password: | ||
password optional pam_echo.so | ||
Password-Initial: | ||
password optional pam_echo.so | ||
EOF |
39 changes: 39 additions & 0 deletions
39
...sword_attempts/accounts_password_pam_unix_authtok/tests/ubuntu_conflicting_values.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
source ubuntu_common.sh | ||
|
||
config_file=/usr/share/pam-configs/tmpunix | ||
|
||
# lower priority to ensure the config is below the cac_test_echo | ||
# on the stack, thus using the "Password:" configuration | ||
cat << EOF > "$config_file" | ||
Name: Unix authentication | ||
Default: yes | ||
Priority: 1024 | ||
Conflicts: unix | ||
Auth-Type: Primary | ||
Auth: | ||
[success=end default=ignore] pam_unix.so try_first_pass | ||
Auth-Initial: | ||
[success=end default=ignore] pam_unix.so | ||
Account-Type: Primary | ||
Account: | ||
[success=end new_authtok_reqd=done default=ignore] pam_unix.so | ||
Account-Initial: | ||
[success=end new_authtok_reqd=done default=ignore] pam_unix.so | ||
Session-Type: Additional | ||
Session: | ||
required pam_unix.so | ||
Session-Initial: | ||
required pam_unix.so | ||
Password-Type: Primary | ||
Password: | ||
[success=end default=ignore] pam_unix.so obscure use_authtok try_first_pass yescrypt | ||
[success=end default=ignore] pam_unix.so obscure try_first_pass yescrypt | ||
Password-Initial: | ||
[success=end default=ignore] pam_unix.so obscure yescrypt | ||
EOF | ||
|
||
DEBIAN_FRONTEND=noninteractive pam-auth-update | ||
rm "$config_file" |
39 changes: 39 additions & 0 deletions
39
...word_attempts/accounts_password_pam_unix_authtok/tests/ubuntu_conflicting_values2.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
source ubuntu_common.sh | ||
|
||
config_file=/usr/share/pam-configs/tmpunix | ||
|
||
# lower priority to ensure the config is below the cac_test_echo | ||
# on the stack, thus using the "Password:" configuration | ||
cat << EOF > "$config_file" | ||
Name: Unix authentication | ||
Default: yes | ||
Priority: 1024 | ||
Conflicts: unix | ||
Auth-Type: Primary | ||
Auth: | ||
[success=end default=ignore] pam_unix.so try_first_pass | ||
Auth-Initial: | ||
[success=end default=ignore] pam_unix.so | ||
Account-Type: Primary | ||
Account: | ||
[success=end new_authtok_reqd=done default=ignore] pam_unix.so | ||
Account-Initial: | ||
[success=end new_authtok_reqd=done default=ignore] pam_unix.so | ||
Session-Type: Additional | ||
Session: | ||
required pam_unix.so | ||
Session-Initial: | ||
required pam_unix.so | ||
Password-Type: Primary | ||
Password: | ||
[success=end default=ignore] pam_unix.so obscure try_first_pass yescrypt | ||
[success=end default=ignore] pam_unix.so obscure use_authtok try_first_pass yescrypt | ||
Password-Initial: | ||
[success=end default=ignore] pam_unix.so obscure yescrypt | ||
EOF | ||
|
||
DEBIAN_FRONTEND=noninteractive pam-auth-update | ||
rm "$config_file" |
7 changes: 6 additions & 1 deletion
7
...t_password_attempts/accounts_password_pam_unix_authtok/tests/ubuntu_correct_value.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
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
38 changes: 38 additions & 0 deletions
38
...rd_attempts/accounts_password_pam_unix_authtok/tests/ubuntu_missing_value_initial.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
source ubuntu_common.sh | ||
|
||
config_file=/usr/share/pam-configs/tmpunix | ||
|
||
# higher priority to ensure the config is above the cac_test_echo | ||
# on the stack, thus using the "Password-Initial:" configuration | ||
cat << EOF > "$config_file" | ||
Name: Unix authentication | ||
Default: yes | ||
Priority: 1000000 | ||
Conflicts: unix | ||
Auth-Type: Primary | ||
Auth: | ||
[success=end default=ignore] pam_unix.so try_first_pass | ||
Auth-Initial: | ||
[success=end default=ignore] pam_unix.so | ||
Account-Type: Primary | ||
Account: | ||
[success=end new_authtok_reqd=done default=ignore] pam_unix.so | ||
Account-Initial: | ||
[success=end new_authtok_reqd=done default=ignore] pam_unix.so | ||
Session-Type: Additional | ||
Session: | ||
required pam_unix.so | ||
Session-Initial: | ||
required pam_unix.so | ||
Password-Type: Primary | ||
Password: | ||
[success=end default=ignore] pam_unix.so obscure try_first_pass yescrypt | ||
Password-Initial: | ||
[success=end default=ignore] pam_unix.so obscure yescrypt | ||
EOF | ||
|
||
DEBIAN_FRONTEND=noninteractive pam-auth-update | ||
rm "$config_file" |