Skip to content

Commit 3d4babf

Browse files
Merge pull request #96 from ansible-lockdown/pub_nov_updates
Pub nov updates
2 parents 8e4d8ea + 2c6c69e commit 3d4babf

File tree

6 files changed

+31
-19
lines changed

6 files changed

+31
-19
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ repos:
3939
rev: v1.5.0
4040
hooks:
4141
- id: detect-secrets
42+
name: Detect Secrets test
4243

4344
- repo: https://github.com/gitleaks/gitleaks
4445
rev: v8.29.1
4546
hooks:
4647
- id: gitleaks
48+
name: Run Gitleaks test
4749

4850
- repo: https://github.com/ansible-community/ansible-lint
4951
rev: v25.11.0

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Based on CIS v1.0.0
44

5+
### 1.0.5 - based on benchmark CIS 1.0.0
6+
#92 1.1.1.7 logic improved and updating inline with audit branches - thanks @jbruno
7+
#93 ufw logic improved thanks to @ToonSpinTUe
8+
#94 Fixed var names dailychecktimer thanks to #94 @huan086
9+
pre-commit updates
10+
typo fixes
11+
512
1.0.4 - based on Benchmark CIS 1.0.0
613
- pre-commit updates
714
- workflow updates

tasks/prelim.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
ubtu24cis_apparmor_enforce_only: false
77
changed_when: false
88

9-
- name: "PRELIM | AUDIT | Register if snap being used"
9+
- name: "PRELIM | AUDIT | squashfs logic"
1010
when: ubtu24cis_rule_1_1_1_7
1111
tags: always
12-
ansible.builtin.shell: df -h | grep -wc "/snap"
13-
changed_when: false
14-
failed_when: prelim_snap_pkg_mgr.rc not in [ 0, 1 ]
15-
register: prelim_snap_pkg_mgr
12+
block:
13+
- name: "PRELIM | AUDIT | Register if snap being used"
14+
ansible.builtin.shell: lsblk | grep -wc "/snap"
15+
changed_when: false
16+
failed_when: prelim_snap_pkg_mgr.rc not in [ 0, 1 ]
17+
register: prelim_snap_pkg_mgr
1618

17-
- name: "PRELIM | AUDIT | Register if squashfs is built into the kernel"
18-
when: ubtu24cis_rule_1_1_1_7
19-
tags: always
20-
ansible.builtin.shell: cat /lib/modules/$(uname -r)/modules.builtin | grep -c "squashfs"
21-
changed_when: false
22-
failed_when: prelim_squashfs_builtin.rc not in [ 0, 1 ]
23-
register: prelim_squashfs_builtin
19+
- name: "PRELIM | AUDIT | Register if squashfs is built into the kernel"
20+
ansible.builtin.shell: cat /lib/modules/$(uname -r)/modules.builtin | grep "squashfs"
21+
changed_when: false
22+
failed_when: prelim_squashfs_builtin.rc not in [ 0, 1 ]
23+
register: prelim_squashfs_builtin
2424

2525
- name: PRELIM | AUDIT | Section 1.1 | Create list of mount points
2626
tags: always
@@ -67,7 +67,9 @@
6767
file: audit.yml
6868

6969
- name: Include pre-remediation audit tasks
70-
when: run_audit or audit_only or setup_audit
70+
when:
71+
- run_audit or audit_only
72+
- setup_audit
7173
tags:
7274
- run_audit
7375
- setup_audit
@@ -264,7 +266,8 @@
264266

265267
- name: "PRELIM | PATCH | Install UFW"
266268
when:
267-
- ubtu24cis_rule_2_4_1_1
269+
- ubtu24cis_rule_4_2_1
270+
- ubtu24cis_section4
268271
- ubtu24cis_firewall_package == "ufw"
269272
tags: always
270273
ansible.builtin.package:

tasks/section_1/cis_1.1.1.x.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@
206206
- name: "1.1.1.7 | PATCH | Ensure squashfs kernel module is not available"
207207
when:
208208
- ubtu24cis_rule_1_1_1_7
209-
- not prelim_squashfs_builtin
210-
- prelim_snap_pkg_mgr.rc != 0
209+
- prelim_squashfs_builtin.rc != 0
210+
- prelim_snap_pkg_mgr.rc == 1
211211
tags:
212212
- level2-server
213213
- level2-workstation

templates/ansible_vars_goss.yml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ ubtu24cis_desktop_required: {{ ubtu24cis_desktop_required }}
469469

470470
## Section 1
471471

472-
# If system uses squahshfs e.gf. snap package manager set true
473-
ubtu24cis_squashfs_required:{% if prelim_snap_pkg_mgr.rc == 0 %} true {% else %} false{% endif %}
472+
# If system uses squashfs e.gf. snap package manager set true
473+
ubtu24cis_squashfs_skip:{% if prelim_squashfs_builtin.rc == 0 and prelim_snap_pkg_mgr.rc != 0 %} true{% else %} false{% endif %}
474474

475475
## Controls 1.3.1.3 and 1.3.1.4 Ensure all AppArmor Profiles are in enforce (1.3.1.3/4) or complain (1.3.1.3) mode
476476

templates/etc/systemd/system/dailyaidecheck.timer.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Description=Daily AIDE check
33

44
[Timer]
5-
OnCalendar={{ ubtu24cis_aide_cron_aide_day }}-{{ ubtu24cis_aide_cron_aide_month }}-{{ ubtu24cis_aide_cron_aide_weekday }} {{ ubtu24cis_aide_cron_aide_hour }}:{{ ubtu24cis_aide_cron_aide_minute }}:00
5+
OnCalendar={{ ubtu24cis_aide_cron_day }}-{{ ubtu24cis_aide_cron_month }}-{{ ubtu24cis_aide_cron_weekday }} {{ ubtu24cis_aide_cron_hour }}:{{ ubtu24cis_aide_cron_minute }}:00
66
Persistent=true
77

88
[Install]

0 commit comments

Comments
 (0)