Skip to content

Commit d28f1c0

Browse files
jovialmarkgoddard
andauthored
Fixes various issues with the cis.yml playbook (#791)
* Fixes various issues with the cis.yml playbook See release note for details. * Apply suggestions from code review Co-authored-by: Mark Goddard <[email protected]> --------- Co-authored-by: Mark Goddard <[email protected]>
1 parent 6628e10 commit d28f1c0

File tree

4 files changed

+44
-21
lines changed

4 files changed

+44
-21
lines changed

doc/source/configuration/security-hardening.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ about what each variable does. The documentation can be found here:
3333
Running the playbooks
3434
---------------------
3535

36+
.. note:
37+
38+
On CentOS 8, you must run with `INJECT_FACT_AS_VARS <https://docs.ansible.com/ansible/latest/reference_appendices/config.html#inject-facts-as-vars>`__
39+
enabled. To do this for this playbook only, you can use:
40+
41+
.. code-block: shell
42+
43+
ANSIBLE_INJECT_FACT_VARS=true kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/cis.yml
44+
45+
3646
As there is potential for unintended side effects when applying the hardening
3747
playbooks, the playbooks are not currently enabled by default. It is recommended
3848
that they are first applied to a representative staging environment to determine

etc/kayobe/ansible/requirements.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ roles:
1616
src: https://github.com/ansible-lockdown/RHEL8-CIS
1717
version: 1.3.0
1818
- name: ansible-lockdown.ubuntu22_cis
19-
src: https://github.com/ansible-lockdown//UBUNTU22-CIS
20-
#FIXME: Waiting for https://github.com/ansible-lockdown/UBUNTU22-CIS/pull/132
19+
src: https://github.com/stackhpc/UBUNTU22-CIS
20+
#FIXME: Waiting for https://github.com/ansible-lockdown/UBUNTU22-CIS/pull/174
2121
# to be in a tagged release
22-
version: c91a1038fd218f727075d21b2d0880751322b162
22+
version: bugfix/inject-facts
2323
- name: ansible-lockdown.rhel9_cis
24-
src: https://github.com/ansible-lockdown/RHEL9-CIS
25-
#FIXME: Waiting for https://github.com/ansible-lockdown/RHEL9-CIS/pull/54
24+
src: https://github.com/stackhpc/RHEL9-CIS
25+
#FIXME: Waiting for https://github.com/ansible-lockdown/RHEL9-CIS/pull/115
2626
# to be in a tagged release.
27-
version: 3525cb6aab12a3d1e34aa8432ed77dd76be6a44a
27+
version: bugfix/inject-facts
2828
- name: wazuh-ansible
2929
src: https://github.com/stackhpc/wazuh-ansible
3030
version: stackhpc

etc/kayobe/inventory/group_vars/overcloud/cis

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ rhel9cis_auditd:
7171
# Max size of audit logs (MB)
7272
rhel9cis_max_log_file_size: 1024
7373

74+
# Disable setting of boatloader password. This requires setting the variable
75+
# `rhel9cis_bootloader_password_hash`
76+
rhel9cis_set_boot_pass: false
77+
7478
##############################################################################
7579
# Ubuntu Jammy CIS Hardening Configuration
7680

@@ -106,27 +110,35 @@ ubtu22cis_rule_5_3_4: false
106110
ubtu22cis_sshd:
107111
log_level: "INFO"
108112
max_auth_tries: 4
109-
ciphers: "[email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr"
110-
macs: "[email protected],[email protected],hmac-sha2-512,hmac-sha2-256"
111-
kex_algorithms: "curve25519-sha256,[email protected],diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256"
113+
ciphers:
114+
115+
116+
117+
- aes256-ctr
118+
- aes192-ctr
119+
- aes128-ctr
120+
macs:
121+
122+
123+
- hmac-sha2-512
124+
- hmac-sha2-256
125+
kex_algorithms:
126+
- curve25519-sha256
127+
128+
- diffie-hellman-group14-sha256
129+
- diffie-hellman-group16-sha512
130+
- diffie-hellman-group18-sha512
131+
- ecdh-sha2-nistp521
132+
- ecdh-sha2-nistp384
133+
- ecdh-sha2-nistp256
134+
- diffie-hellman-group-exchange-sha256
112135
client_alive_interval: 300
113136
client_alive_count_max: 3
114137
login_grace_time: 60
115-
max_sessions: 10
138+
max_sessions: 8
116139
allow_users: "kolla stack ubuntu"
117140
allow_groups: "kolla stack ubuntu"
118-
# This variable, if specified, configures a list of USER name patterns, separated by spaces, to prevent SSH access
119-
# for users whose user name matches one of the patterns. This is done
120-
# by setting the value of `DenyUsers` option in `/etc/ssh/sshd_config` file.
121-
# If an USER@HOST format will be used, the specified user will be restricted only on that particular host.
122-
# The allow/deny directives process order: DenyUsers, AllowUsers, DenyGroups, AllowGroups.
123-
# For more info, see https://linux.die.net/man/5/sshd_config
124141
deny_users: ""
125-
# This variable, if specified, configures a list of GROUP name patterns, separated by spaces, to prevent SSH access
126-
# for users whose primary group or supplementary group list matches one of the patterns. This is done
127-
# by setting the value of `DenyGroups` option in `/etc/ssh/sshd_config` file.
128-
# The allow/deny directives process order: DenyUsers, AllowUsers, DenyGroups, AllowGroups.
129-
# For more info, see https://linux.die.net/man/5/sshd_config
130142
deny_groups: ""
131143

132144
# Do not change /var/lib/docker permissions

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
kayobe@git+https://github.com/stackhpc/kayobe@stackhpc/yoga
22
ansible-modules-hashivault@git+https://github.com/stackhpc/ansible-modules-hashivault@stackhpc;python_version < "3.8"
33
ansible-modules-hashivault;python_version >= "3.8"
4+
jmespath

0 commit comments

Comments
 (0)