Skip to content
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

(feature) Allow for customisation of SSH MaxStartups and MaxSessions #7

Merged
merged 1 commit into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ allowed_users: ali saleh baker root #Put None or list of users space between eac
allowed_groups: None
deny_users: None
deny_groups: None
## 5.2.21 Ensure SSH MaxStartups is configured
ssh_max_Startups: "10:30:100"
# 5.2.22 Ensure SSH MaxSessions is limited
ssh_max_sessions: 10
# 5.4.1.1 Ensure password expiration is 365 days or less
pass_expire_in_days: 300
pass_warn_age: 7
Expand Down
2 changes: 1 addition & 1 deletion tasks/section_1_Initial_Setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@
- name: 1.7.1.2 Ensure AppArmor is enabled in the bootloader configuration | reload
shell: |
update-grub
when: output_1_7_1_2
when: output_1_7_1_2 | bool
tags:
- section1
- level_1_server
Expand Down
8 changes: 4 additions & 4 deletions tasks/section_5_Access_Authentication_and_Authorization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -448,25 +448,25 @@
- 5.2.20
# 5.2.21 Ensure SSH MaxStartups is configured
# To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon.
- name: 5.2.21 Ensure SSH MaxStartups is configured
- name: "5.2.21 Ensure SSH MaxStartups is configured to {{ ssh_max_startups }}"
lineinfile:
state: present
dest: /etc/ssh/sshd_config
regexp: "^MaxStartups"
line: "MaxStartups 10:30:100"
line: "MaxStartups {{ ssh_max_startups }}"
tags:
- section5
- level_1_server
- level_1_workstation
- 5.2.21
# 5.2.22 Ensure SSH MaxSessions is limited
# To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon.
- name: 5.2.22 Ensure SSH MaxSessions is limited
- name: "5.2.22 Ensure SSH MaxSessions is limited to {{ ssh_max_sessions }}"
lineinfile:
state: present
dest: /etc/ssh/sshd_config
regexp: "^MaxSessions"
line: "MaxSessions 10"
line: "MaxSessions {{ ssh_max_sessions }}"
tags:
- section5
- level_1_server
Expand Down