-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu enable unix #12660
Merged
dodys
merged 18 commits into
ComplianceAsCode:master
from
alanmcanonical:ubuntu_enable_unix
Dec 17, 2024
Merged
Ubuntu enable unix #12660
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
dadf18a
Create bash_pam_unix_enable macro
alanmcanonical 1f71398
Use pam-auth-update to remediate the pam_unix related rules
alanmcanonical 7faac26
correct the pam-auth-update conf path
alanmcanonical 280ee43
Use bash variable instead of jinja variable
alanmcanonical 34c80d8
Use pam-auth-update to fix the accounts_password_pam_unix_remember test
alanmcanonical 84a9c94
Use pam-auth-update to fix the set_password_hashing_algorithm_systema…
alanmcanonical 0879b3e
Make oval of set_password_hashing_algorithm_systemauth to also exclud…
alanmcanonical 1436411
Fix more test
alanmcanonical 0ba8302
Add word boundary for hash algorithm
alanmcanonical 446f44e
Use {{{ pam_file }}} as file path
alanmcanonical c067b76
Only change password* section of configuration
alanmcanonical 17e58f5
Stick to default configuration shipped by Ubuntu
alanmcanonical 2b0a499
Check the existance and md5sum of unix configuration
alanmcanonical c96cfc5
Use $() substitution instead of ``
alanmcanonical 8675619
Delete unix configuration after the common-password updated by pam-au…
alanmcanonical f95eada
Fix para position
alanmcanonical 8db82d4
Add replace flag
alanmcanonical 4b4714b
Correct the config_file name
alanmcanonical File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
33 changes: 29 additions & 4 deletions
33
...ut_password_attempts/accounts_password_pam_unix_remember/tests/ubuntu_arg_missing.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,7 +1,32 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ubuntu | ||
|
||
config_file=/etc/pam.d/common-password | ||
if grep -q "pam_unix\.so.*remember=" "${config_file}" ; then | ||
sed -i "/pam_unix\.so/ s/\bremember=\S*//" "${config_file}" | ||
fi | ||
config_file=/usr/share/pam-configs/tmpunix | ||
cat << EOF > "$config_file" | ||
Name: Unix authentication | ||
Default: yes | ||
Priority: 256 | ||
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 | ||
Password-Initial: | ||
[success=end default=ignore] pam_unix.so obscure yescrypt | ||
EOF | ||
|
||
DEBIAN_FRONTEND=noninteractive pam-auth-update | ||
rm "$config_file" |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to the regexes affect all platforms. Would be better to make a separate PR for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small change from any character (.) to non-comment character ([^#]) and add word boundary to pam_unix_algorithms