Skip to content

Commit

Permalink
make sha rounds configurable and increase no of rounds
Browse files Browse the repository at this point in the history
Fixes #365

Signed-off-by: rndmh3ro <github@gumpri.ch>
  • Loading branch information
rndmh3ro committed Jun 28, 2021
1 parent d72db60 commit 8555544
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion roles/os_hardening/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,12 @@ We know that this is the case on Raspberry Pi.
- `os_ignore_home_folder_users`
- Default: `lost+found`
- Description: specify user home folders in `/home` that shouldn't be chmodded to 700

- `os_sha_crypt_min_rounds`
- Default: `640000`
- Description: Define the number of minimum SHA rounds. With a lot of rounds, it is more difficult to brute forcing the password. But note also that it more CPU resources will be needed to authenticate users. The values must be inside the 1000-999999999 range.
- `os_sha_crypt_max_rounds`
- Default: `640000`
- Description: Define the number of maximum SHA rounds. With a lot of rounds, it is more difficult to brute forcing the password. But note also that it more CPU resources will be needed to authenticate users. The values must be inside the 1000-999999999 range.
## Packages

We remove the following packages:
Expand Down
6 changes: 6 additions & 0 deletions roles/os_hardening/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,9 @@ os_selinux_policy: targeted

# Mount options for proc in /etc/fstab.
proc_mnt_options: 'rw,nosuid,nodev,noexec,relatime,hidepid={{ hidepid_option }}'

# Define the number of SHA rounds.
# With a lot of rounds, it is more difficult to brute forcing the password. But note also that it more CPU resources will be needed to authenticate users.
# The values must be inside the 1000-999999999 range.
os_sha_crypt_min_rounds: "640000"
os_sha_crypt_max_rounds: "640000"
4 changes: 2 additions & 2 deletions roles/os_hardening/templates/etc/login.defs.j2
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ ENCRYPT_METHOD SHA512
# With a lot of rounds, it is more difficult to brute forcing the password. But note also that it more CPU resources will be needed to authenticate users.
# If not specified, the libc will choose the default number of rounds (5000). The values must be inside the 1000-999999999 range. If only one of the MIN or MAX values is set, then this value will be used.
# If MIN > MAX, the highest value will be used.
#SHA_CRYPT_MIN_ROUNDS 5000
#SHA_CRYPT_MAX_ROUNDS 5000
SHA_CRYPT_MIN_ROUNDS {{ os_sha_crypt_min_rounds }}
SHA_CRYPT_MAX_ROUNDS {{ os_sha_crypt_max_rounds }}


# Obsoleted by PAM
Expand Down

0 comments on commit 8555544

Please sign in to comment.