-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for Password Hardening #10323
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
Merged
liat-grozovik
merged 25 commits into
sonic-net:master
from
davidpil2002:dev-password-hardening
Jun 29, 2022
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2a59875
Password Hardening Feature
davidpil2002 440307d
fix password hardening comments from the pull request
davidpil2002 fb5764e
Merge branch 'master' into dev-password-hardening
davidpil2002 7a7fc90
small fix about passw hardening P.R
davidpil2002 9563886
move init_cfg.json.j2 changes to separate pull request with YANG model
davidpil2002 49d1195
modify age calculation & fix some values in the common-password.j2 file
davidpil2002 eff356a
fix digits class name case
davidpil2002 5ab7c2b
fix unitest hostcfgd_passwh_test.py by adding enable_digits_class sample
davidpil2002 a5959f5
Merge branch 'master' into dev-password-hardening
davidpil2002 a4d452b
add mock table to passw hardening unitest in result of changes in com…
davidpil2002 93072bd
fix credit disabled, by setting 0 instead to be clear
davidpil2002 3a8b5fd
removed unused import
davidpil2002 424bf9b
Merge branch 'master' into dev-password-hardening
davidpil2002 e9c9edf
passw-hardening, fix unitest mocks tables
davidpil2002 b611fa1
Merge branch 'master' into dev-password-hardening
davidpil2002 8e507e8
[passw-hardening] remove misstype line in hostcfgd
davidpil2002 e4bface
[password-hardening] move passw logic from AaaCfg class to PasswHarde…
davidpil2002 458691c
[password-hardening]fix few comments from PR: https://github.com/Azur…
davidpil2002 3b5f7a1
Merge branch 'Azure:master' into dev-password-hardening
davidpil2002 010e023
Merge branch 'Azure:master' into dev-password-hardening
davidpil2002 eb977ca
[ci] Publish logs when building image job is canceled by timeout. (#1…
liushilongbuaa 0f423af
[CODEOWNERS]: update code owners for various repos (#10980)
lguohan 8c4ef50
[Ci]: Fix the target directory not empty issue when publishing artifa…
xumia 2967247
[password-hardening]install cracklib from debian repo list instead do…
davidpil2002 a2ec817
Merge branch 'master' into dev-password-hardening
davidpil2002 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 hidden or 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 hidden or 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,43 @@ | ||
| #THIS IS AN AUTO-GENERATED FILE | ||
| # | ||
| # /etc/pam.d/common-password - password-related modules common to all services | ||
| # | ||
| # This file is included from other service-specific PAM config files, | ||
| # and should contain a list of modules that define the services to be | ||
| # used to change user passwords. The default is pam_unix. | ||
|
|
||
| # Explanation of pam_unix options: | ||
| # The "yescrypt" option enables | ||
| #hashed passwords using the yescrypt algorithm, introduced in Debian | ||
| #11. Without this option, the default is Unix crypt. Prior releases | ||
| #used the option "sha512"; if a shadow password hash will be shared | ||
| #between Debian 11 and older releases replace "yescrypt" with "sha512" | ||
| #for compatibility . The "obscure" option replaces the old | ||
| #`OBSCURE_CHECKS_ENAB' option in login.defs. See the pam_unix manpage | ||
| #for other options. | ||
|
|
||
| # As of pam 1.0.1-6, this file is managed by pam-auth-update by default. | ||
| # To take advantage of this, it is recommended that you configure any | ||
| # local modules either before or after the default block, and use | ||
| # pam-auth-update to manage selection of other modules. See | ||
| # pam-auth-update(8) for details. | ||
|
|
||
| # here are the per-package modules (the "Primary" block) | ||
|
|
||
| {% if passw_policies %} | ||
| {% if passw_policies['state'] == 'enabled' %} | ||
| password requisite pam_cracklib.so retry=3 maxrepeat=0 {% if passw_policies['len_min'] %}minlen={{passw_policies['len_min']}}{% endif %} {% if passw_policies['upper_class'] %}ucredit=-1{% else %}ucredit=0{% endif %} {% if passw_policies['lower_class'] %}lcredit=-1{% else %}lcredit=0{% endif %} {% if passw_policies['digits_class'] %}dcredit=-1{% else %}dcredit=0{% endif %} {% if passw_policies['special_class'] %}ocredit=-1{% else %}ocredit=0{% endif %} {% if passw_policies['reject_user_passw_match'] %}reject_username{% endif %} enforce_for_root | ||
|
|
||
| password required pam_pwhistory.so {% if passw_policies['history_cnt'] %}remember={{passw_policies['history_cnt']}}{% endif %} use_authtok enforce_for_root | ||
| {% endif %} | ||
| {% endif %} | ||
|
|
||
| password [success=1 default=ignore] pam_unix.so obscure yescrypt | ||
| # here's the fallback if no module succeeds | ||
| password requisite pam_deny.so | ||
| # prime the stack with a positive return value if there isn't one already; | ||
| # this avoids us returning an error just because nothing sets a success code | ||
| # since the modules above will each just jump around | ||
| password required pam_permit.so | ||
| # and here are more per-package modules (the "Additional" block) | ||
| # end of pam-auth-update config | ||
This file contains hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.