Skip to content

Commit

Permalink
Lynis hardening recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaassssiiee committed Aug 18, 2023
1 parent e7360db commit bc6e45b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
crypto_policy: 'STRICT'

allow_tcp_forwarding: 'no'
allow_agent_forwarding: 'no'

# Diffie Hellmann moduli size
min_dh_size: '3072'
Expand Down
8 changes: 6 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@
line: 'X11Forwarding no'
- regexp: '^(#)?AllowTcpForwarding'
line: "AllowTcpForwarding {{ allow_tcp_forwarding }}"
- regexp: '^(#)?AllowAgentForwarding'
line: "AllowAgentForwarding {{ allow_agent_forwarding }}"
- regexp: '^(#)?MaxAuthTries \d'
line: 'MaxAuthTries 4'
line: 'MaxAuthTries 3'
- regexp: '^(#)?MaxSessions'
line: "MaxSessions 10"
line: "MaxSessions 2"
- regexp: '^(#)?TCPKeepAlive'
line: "TCPKeepAlive no"
notify: Restart sshd

- name: Apply STRICT hardening for sshd
Expand Down

0 comments on commit bc6e45b

Please sign in to comment.