-
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
Changes from 17 commits
2a59875
440307d
fb5764e
7a7fc90
9563886
49d1195
eff356a
5ab7c2b
a5959f5
a4d452b
93072bd
3a8b5fd
424bf9b
e9c9edf
b611fa1
8e507e8
e4bface
458691c
3b5f7a1
010e023
eb977ca
0f423af
8c4ef50
2967247
a2ec817
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -263,6 +263,10 @@ fi | |
| sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-device-data_*.deb || \ | ||
| sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f | ||
|
|
||
| # Install cracklib (and its dependencies via 'apt-get -y install -f') | ||
| sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/libpam-cracklib_*.deb || \ | ||
|
||
| sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f | ||
|
|
||
| # Install pam-tacplus and nss-tacplus | ||
| sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/libtac2_*.deb || \ | ||
| sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| SPATH := $($(LIBPAM_CRACKLIB)_SRC_PATH) | ||
| DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/cracklib.mk rules/cracklib.dep | ||
| DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
| DEP_FILES += $(shell git ls-files $(SPATH)) | ||
|
|
||
| $(SOCAT)_CACHE_MODE := GIT_CONTENT_SHA | ||
| $(SOCAT)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
| $(SOCAT)_DEP_FILES := $(DEP_FILES) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # CRACKLIB packages | ||
|
|
||
| PAM_CRACKLIB_VERSION = 1.4.0-9+deb11u1 | ||
| export PAM_CRACKLIB_VERSION | ||
|
|
||
| LIBPAM_CRACKLIB = libpam-cracklib_$(PAM_CRACKLIB_VERSION)_$(CONFIGURED_ARCH).deb | ||
|
|
||
| $(LIBPAM_CRACKLIB)_URL = "http://http.us.debian.org/debian/pool/main/p/pam/$(LIBPAM_CRACKLIB)" | ||
|
|
||
| SONIC_ONLINE_DEBS += $(LIBPAM_CRACKLIB) |
| 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 | ||
liuh-80 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # 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 | ||
Uh oh!
There was an error while loading. Please reload this page.