File tree Expand file tree Collapse file tree 12 files changed +74
-16
lines changed
inventory/group_vars/cis-hardening Expand file tree Collapse file tree 12 files changed +74
-16
lines changed Original file line number Diff line number Diff line change 2121 state : present
2222 when : ansible_facts.distribution == 'Ubuntu'
2323
24+ - name : Ensure service accounts have no expiry options set
25+ # This is to workaround an issue where we set the expiry to 365 days on kayobe
26+ # service accounts in a previous iteration of the CIS benchmark hardening
27+ # defaults. This should restore the defaults and can eventually be removed.
28+ command : chage -m 0 -M 99999 -W 7 -I -1 {{ item }}
29+ become : true
30+ changed_when : false
31+ with_items :
32+ - " {{ kayobe_ansible_user }}"
33+ - " {{ kolla_ansible_user }}"
34+
2435 - include_role :
2536 name : ansible-lockdown.rhel9_cis
2637 when : ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '9'
Original file line number Diff line number Diff line change 55 hosts : overcloud:infra-vms:seed:seed-hypervisor
66 vars :
77 ansible_python_interpreter : /usr/bin/python3
8+ reboot_timeout_s : " {{ 20 * 60 }}"
89 tasks :
910 - name : Assert that hosts are running Ubuntu Focal
1011 assert :
3738
3839 - name : Reboot to apply updates
3940 reboot :
40- reboot_timeout : 1200
41+ reboot_timeout : " {{ reboot_timeout_s }} "
4142 connect_timeout : 600
4243 become : true
4344 when : file_status.stat.exists
8182 hosts : overcloud:infra-vms:seed:seed-hypervisor
8283 vars :
8384 ansible_python_interpreter : /usr/bin/python3
85+ reboot_timeout_s : " {{ 20 * 60 }}"
8486 tasks :
8587 - name : Ensure Jammy repo definitions do not exist in sources.list
8688 blockinfile :
8789 path : /etc/apt/sources.list
8890 state : absent
8991 become : true
9092
93+ - name : Ensure Kolla Ansible Docker repo definition does not exist
94+ file :
95+ path : /etc/apt/sources.list.d/docker.list
96+ state : absent
97+ become : true
98+ when : apt_repositories | selectattr('url', 'match', '.*docker-ce.*') | list | length > 0
99+
91100 - name : Reboot and wait
92101 reboot :
93- reboot_timeout : 1200
102+ reboot_timeout : " {{ reboot_timeout_s }} "
94103 connect_timeout : 600
95104 become : true
96105
Original file line number Diff line number Diff line change @@ -52,25 +52,29 @@ stackhpc_apt_repositories:
5252 suites : " {{ ansible_facts.distribution_release }} {{ ansible_facts.distribution_release }}-updates {{ ansible_facts.distribution_release }}-backports"
5353 components : main restricted universe multiverse
5454 architecture : amd64
55+ required : true
5556 - url : " {{ stackhpc_repo_ubuntu_jammy_security_url }}"
5657 suites : " {{ ansible_facts.distribution_release }}-security"
5758 components : main restricted universe multiverse
5859 architecture : amd64
60+ required : true
5961 - url : " {{ stackhpc_repo_ubuntu_jammy_cve_2024_6387_url }}"
6062 suites : " pulp"
6163 components : upload
6264 architecture : amd64
6365 trusted : yes
64- - url : " {{ stackhpc_repo_docker_ce_ubuntu_url }}"
65- suites : " {{ ansible_facts.distribution_release }}"
66+ required : true
67+ - url : " {{ stackhpc_repo_docker_ce_ubuntu_jammy_url }}"
68+ suites : " {{ ansible_facts.distribution_release }}"
6669 components : stable
6770 signed_by : docker.asc
6871 architecture : amd64
72+ required : true
6973
7074# Do not replace apt configuration for non-overcloud hosts. This can result in
7175# errors if apt reconfiguration is performed before local repository mirrors
7276# are deployed.
73- apt_repositories : " {{ stackhpc_apt_repositories if 'overcloud' in group_names else [] }}"
77+ apt_repositories : " {{ stackhpc_apt_repositories | selectattr('required') | list if 'overcloud' in group_names else [] }}"
7478
7579# Whether to disable repositories in /etc/apt/sources.list. This may be used
7680# when replacing the distribution repositories via apt_repositories.
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ stackhpc_repo_ubuntu_jammy_version: "{{ stackhpc_pulp_repo_ubuntu_jammy_version
3232stackhpc_repo_ubuntu_jammy_security_version : " {{ stackhpc_pulp_repo_ubuntu_jammy_security_version }}"
3333stackhpc_repo_ubuntu_jammy_cve_2024_6387_version : " "
3434stackhpc_repo_ubuntu_cloud_archive_version : " {{ stackhpc_pulp_repo_ubuntu_cloud_archive_version }}"
35- stackhpc_repo_docker_ce_ubuntu_version : " {{ stackhpc_pulp_repo_docker_ce_ubuntu_version }}"
35+ stackhpc_repo_docker_ce_ubuntu_jammy_version : " {{ stackhpc_pulp_repo_docker_ce_ubuntu_jammy_version }}"
3636stackhpc_repo_centos_stream_9_nfv_openvswitch_version : " {{ stackhpc_pulp_repo_centos_stream_9_nfv_openvswitch_version }}"
3737stackhpc_repo_centos_stream_9_openstack_antelope_version : " {{ stackhpc_pulp_repo_centos_stream_9_openstack_antelope_version }}"
3838stackhpc_repo_centos_stream_9_opstools_version : " {{ stackhpc_pulp_repo_centos_stream_9_opstools_version }}"
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ stackhpc_repo_ubuntu_jammy_version: "{{ stackhpc_pulp_repo_ubuntu_jammy_version
5252stackhpc_repo_ubuntu_jammy_security_version : " {{ stackhpc_pulp_repo_ubuntu_jammy_security_version }}"
5353stackhpc_repo_ubuntu_jammy_cve_2024_6387_version : " "
5454stackhpc_repo_ubuntu_cloud_archive_version : " {{ stackhpc_pulp_repo_ubuntu_cloud_archive_version }}"
55- stackhpc_repo_docker_ce_ubuntu_version : " {{ stackhpc_pulp_repo_docker_ce_ubuntu_version }}"
55+ stackhpc_repo_docker_ce_ubuntu_jammy_version : " {{ stackhpc_pulp_repo_docker_ce_ubuntu_jammy_version }}"
5656stackhpc_repo_centos_stream_9_nfv_openvswitch_version : " {{ stackhpc_pulp_repo_centos_stream_9_nfv_openvswitch_version }}"
5757stackhpc_repo_centos_stream_9_openstack_antelope_version : " {{ stackhpc_pulp_repo_centos_stream_9_openstack_antelope_version }}"
5858stackhpc_repo_centos_stream_9_opstools_version : " {{ stackhpc_pulp_repo_centos_stream_9_opstools_version }}"
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ stackhpc_repo_ubuntu_jammy_version: "{{ stackhpc_pulp_repo_ubuntu_jammy_version
2929stackhpc_repo_ubuntu_jammy_security_version : " {{ stackhpc_pulp_repo_ubuntu_jammy_security_version }}"
3030stackhpc_repo_ubuntu_jammy_cve_2024_6387_version : " "
3131stackhpc_repo_ubuntu_cloud_archive_version : " {{ stackhpc_pulp_repo_ubuntu_cloud_archive_version }}"
32- stackhpc_repo_docker_ce_ubuntu_version : " {{ stackhpc_pulp_repo_docker_ce_ubuntu_version }}"
32+ stackhpc_repo_docker_ce_ubuntu_jammy_version : " {{ stackhpc_pulp_repo_docker_ce_ubuntu_jammy_version }}"
3333stackhpc_repo_centos_stream_9_nfv_openvswitch_version : " {{ stackhpc_pulp_repo_centos_stream_9_nfv_openvswitch_version }}"
3434stackhpc_repo_centos_stream_9_openstack_antelope_version : " {{ stackhpc_pulp_repo_centos_stream_9_openstack_antelope_version }}"
3535stackhpc_repo_centos_stream_9_opstools_version : " {{ stackhpc_pulp_repo_centos_stream_9_opstools_version }}"
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ rhel9cis_max_log_file_size: 1024
6565# `rhel9cis_bootloader_password_hash`
6666rhel9cis_set_boot_pass: false
6767
68+ # NOTICE: rule disabled otherwise rule will prevent access to accounts
69+ # as it will expire passwords older than one year.
70+ rhel9cis_rule_5_6_1_1: false
71+
6872##############################################################################
6973# Ubuntu Jammy CIS Hardening Configuration
7074
@@ -163,6 +167,18 @@ ubtu22cis_max_log_file_size: 1024
163167ubtu22cis_rule_1_4_1: false
164168ubtu22cis_rule_1_4_3: false
165169
170+ # Disable: Ensure minimum days between password changes is configured
171+ ubtu22cis_rule_5_5_1_1: false
172+
173+ # Disable: Ensure password expiration is 365 days or less
174+ ubtu22cis_rule_5_5_1_2: false
175+
176+ # Disable: Ensure inactive password lock is 30 days or less
177+ ubtu22cis_rule_5_5_1_4: false
178+
179+ # Disable: Ensure all users last password change date is in the past
180+ ubtu22cis_rule_5_5_1_5: false
181+
166182# The way this is disabled currently breaks kolla's IPV6 check, see:
167183# https://bugs.launchpad.net/kolla-ansible/+bug/2071443
168184# Also matches RHEL hardening behavior.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ stackhpc_pulp_repo_centos_stream_9_nfv_openvswitch_version: 20240406T233848
55stackhpc_pulp_repo_centos_stream_9_openstack_antelope_version : 20240417T235558
66stackhpc_pulp_repo_centos_stream_9_opstools_version : 20231213T031318
77stackhpc_pulp_repo_centos_stream_9_storage_ceph_quincy_version : 20231104T015751
8- stackhpc_pulp_repo_docker_ce_ubuntu_version : 20231020T014922
8+ stackhpc_pulp_repo_docker_ce_ubuntu_jammy_version : 20240122T172142
99stackhpc_pulp_repo_elrepo_9_version : 20240214T143520
1010stackhpc_pulp_repo_epel_9_version : 20240417T235558
1111stackhpc_pulp_repo_grafana_version : 20240417T235558
Original file line number Diff line number Diff line change @@ -114,10 +114,10 @@ stackhpc_pulp_deb_repos:
114114 required : " {{ stackhpc_pulp_sync_ubuntu_jammy | bool }}"
115115
116116 # Third-party repositories
117- - name : " Docker CE for Ubuntu"
118- url : " {{ stackhpc_release_pulp_content_url }}/docker-ce/ubuntu/{{ stackhpc_pulp_repo_docker_ce_ubuntu_version }}"
119- distribution_name : " docker-ce-for-ubuntu-"
120- base_path : " docker-ce/ubuntu/"
117+ - name : " Docker CE for Ubuntu Jammy "
118+ url : " {{ stackhpc_release_pulp_content_url }}/docker-ce/ubuntu-jammy /{{ stackhpc_pulp_repo_docker_ce_ubuntu_jammy_version }}"
119+ distribution_name : " docker-ce-for-ubuntu-jammy- "
120+ base_path : " docker-ce/ubuntu-jammy /"
121121 distributions : " jammy"
122122 components : " stable"
123123 required : " {{ stackhpc_pulp_sync_ubuntu_jammy | bool }}"
Original file line number Diff line number Diff line change @@ -45,9 +45,9 @@ stackhpc_repo_ubuntu_jammy_cve_2024_6387_version: "{{ stackhpc_repo_distribution
4545stackhpc_repo_ubuntu_cloud_archive_url : " {{ stackhpc_repo_mirror_url }}/pulp/content/ubuntu-cloud-archive/{{ stackhpc_repo_ubuntu_cloud_archive_version }}"
4646stackhpc_repo_ubuntu_cloud_archive_version : " {{ stackhpc_repo_distribution }}"
4747
48- # Docker CE for Ubuntu
49- stackhpc_repo_docker_ce_ubuntu_url : " {{ stackhpc_repo_mirror_url }}/pulp/content/docker-ce/ubuntu/{{ stackhpc_repo_docker_ce_ubuntu_version }}"
50- stackhpc_repo_docker_ce_ubuntu_version : " {{ stackhpc_repo_distribution }}"
48+ # Docker CE for Ubuntu Jammy
49+ stackhpc_repo_docker_ce_ubuntu_jammy_url : " {{ stackhpc_repo_mirror_url }}/pulp/content/docker-ce/ubuntu-jammy /{{ stackhpc_repo_docker_ce_ubuntu_jammy_version }}"
50+ stackhpc_repo_docker_ce_ubuntu_jammy_version : " {{ stackhpc_repo_distribution }}"
5151
5252# ##############################################################################
5353# RPMs
You can’t perform that action at this time.
0 commit comments