Skip to content

Commit 3f00e9a

Browse files
Alex-Welshstackhpc-ci
authored andcommitted
Enable CIS hardening for Ubuntu Noble
1 parent b0868db commit 3f00e9a

File tree

3 files changed

+36
-34
lines changed

3 files changed

+36
-34
lines changed

etc/kayobe/ansible/maintenance/cis.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Security hardening
2+
- name: CIS - Prerequisites
33
hosts: cis-hardening
44
become: true
55
tags:
@@ -31,12 +31,18 @@
3131
- "{{ kayobe_ansible_user }}"
3232
- "{{ kolla_ansible_user }}"
3333

34+
- name: Security hardening
35+
hosts: cis-hardening
36+
become: true
37+
tags:
38+
- cis
39+
tasks:
3440
- name: Run CIS hardening role (RHEL 9)
3541
ansible.builtin.include_role:
3642
name: ansible-lockdown.rhel9_cis
3743
when: ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '9'
3844

39-
- name: Run CIS hardening role (Ubuntu 22)
45+
- name: Run CIS hardening role (Ubuntu 24)
4046
ansible.builtin.include_role:
41-
name: ansible-lockdown.ubuntu22_cis
42-
when: ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_major_version == '22'
47+
name: ansible-lockdown.ubuntu24_cis
48+
when: ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_major_version == '24'

etc/kayobe/ansible/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ roles:
1717
version: 1.1.0
1818
- name: ansible-lockdown.ubuntu24_cis
1919
src: https://github.com/ansible-lockdown/UBUNTU24-CIS
20-
version: 1.0.1
20+
version: 1.0.4
2121
- name: ansible-lockdown.rhel9_cis
2222
src: https://github.com/ansible-lockdown/RHEL9-CIS
2323
version: v1.3.4

etc/kayobe/inventory/group_vars/cis-hardening/cis

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ rhel9cis_rule_5_6_1_1: false
7575

7676
##############################################################################
7777
# Ubuntu Noble CIS Hardening Configuration
78-
# FIXME: These settings are untested, they are just carried over from Jammy
78+
79+
# Stop general "High Disruption" tasks
80+
ubtu24cis_disruption_high: false
7981

8082
# Ubuntu 24 CIS configuration
8183
# Disable changing routing rules
@@ -93,17 +95,16 @@ ubtu24cis_install_network_manager: false
9395
# Set syslog service to journald
9496
ubtu24cis_syslog_service: journald
9597

96-
# Squashfs is compiled into the kernel
97-
ubtu24cis_rule_1_1_1_2: false
98+
# Allow rsync server
99+
ubtu24cis_rsync_server: true
98100

99-
# This updates the system. Let's do this explicitly.
100-
ubtu24cis_rule_1_9: false
101+
# AIDE doesn't play well with hosts that have been upgraded from Jammy to Noble
102+
ubtu24cis_config_aide: false
101103

102104
# Do not change Chrony Time servers
103-
ubtu24cis_rule_2_1_2_1: false
104-
105-
# Disable CIS from touching sudoers
106-
ubtu24cis_rule_5_3_4: false
105+
ubtu24cis_rule_2_3_3_1: false
106+
ubtu24cis_rule_2_3_3_2: false
107+
ubtu24cis_rule_2_3_3_3: false
107108

108109
# Add stack and kolla to allowed ssh users
109110
ubtu24cis_sshd:
@@ -144,21 +145,15 @@ ubtu24cis_sshd:
144145
# takes a long time. Related to the changing permissions block below. This
145146
# would normally warn you about violations, but we can use Wazuh to continually
146147
# monitor this.
147-
ubtu24cis_rule_6_1_9: false
148-
ubtu24cis_rule_6_1_10: false
149-
ubtu24cis_rule_6_1_11: false
150-
ubtu24cis_rule_6_1_12: false
151-
ubtu24cis_rule_6_1_13: false
148+
ubtu24cis_rule_6_3_1: true
149+
ubtu24cis_rule_6_3_2: true
150+
ubtu24cis_rule_6_3_3: true
152151

153152
# The following rules change permissions on all files on every mounted
154153
# filesystem. We do not want to change /var/lib/docker permissions.
155-
ubtu24cis_no_group_adjust: false
156-
ubtu24cis_no_owner_adjust: false
154+
ubtu24cis_ownership_adjust: false
157155
ubtu24cis_no_world_write_adjust: false
158-
ubtu24cis_suid_adjust: false
159-
160-
# Prevent hardening from recursivley changing permissions on log files
161-
ubtu24cis_rule_4_2_3: false
156+
ubtu24cis_suid_sgid_adjust: false
162157

163158
# Configure log rotation to prevent audit logs from filling the disk
164159
ubtu24cis_auditd:
@@ -175,20 +170,21 @@ ubtu24cis_max_log_file_size: 1024
175170
ubtu24cis_rule_1_4_1: false
176171
ubtu24cis_rule_1_4_3: false
177172

178-
# Disable: Ensure minimum days between password changes is configured
179-
ubtu24cis_rule_5_5_1_1: false
180173

181-
# Disable: Ensure password expiration is 365 days or less
182-
ubtu24cis_rule_5_5_1_2: false
174+
# Disable minimum days between password changes
175+
ubtu24cis_rule_5_4_1_1: false
176+
ubtu24cis_rule_5_4_1_2: false
177+
ubtu24cis_rule_5_4_1_3: false
178+
ubtu24cis_rule_5_4_1_5: false
179+
ubtu24cis_rule_5_4_1_6: false
183180

184-
# Disable: Ensure inactive password lock is 30 days or less
185-
ubtu24cis_rule_5_5_1_4: false
181+
# Do not require a sudo password
182+
ubtu24cis_rule_5_2_4: false
186183

187-
# Disable: Ensure all users last password change date is in the past
188-
ubtu24cis_rule_5_5_1_5: false
184+
# Do not require a root password
185+
ubtu24cis_rule_5_4_2_4: false
189186

190187
# The way this is disabled currently breaks kolla's IPV6 check, see:
191188
# https://bugs.launchpad.net/kolla-ansible/+bug/2071443
192189
# Also matches RHEL hardening behavior.
193190
ubtu24cis_ipv6_required: true
194-

0 commit comments

Comments
 (0)