Skip to content

Commit

Permalink
Merge pull request dev-sec#267 from jbronn/moduli-when-hardening
Browse files Browse the repository at this point in the history
Only manage moduli when hardening server
  • Loading branch information
rndmh3ro committed Mar 10, 2020
2 parents f74b7c0 + bc8bda8 commit 787356e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tasks/hardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@
register: sshd_register_moduli
changed_when: false
check_mode: no
when: ssh_server_hardening | bool

- name: remove all small primes
shell: awk '$5 >= {{ sshd_moduli_minimum }}' {{ sshd_moduli_file }} > {{ sshd_moduli_file }}.new ;
[ -r {{ sshd_moduli_file }}.new -a -s {{ sshd_moduli_file }}.new ] && mv {{ sshd_moduli_file }}.new {{ sshd_moduli_file }} || true
notify: restart sshd
when: sshd_register_moduli.stdout
when:
- ssh_server_hardening | bool
- sshd_register_moduli.stdout

- name: include tasks to setup ca keys and principals
include_tasks: ca_keys_and_principals.yml
Expand Down

0 comments on commit 787356e

Please sign in to comment.