Skip to content

Commit 663f84d

Browse files
authored
Merge pull request #427 from ansible-lockdown/devel
Release to main
2 parents 9bab97d + e6a29ab commit 663f84d

File tree

14 files changed

+47
-44
lines changed

14 files changed

+47
-44
lines changed

.github/workflows/add_repo_issue_to_gh_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
- uses: actions/add-to-project@main
1515
with:
1616
project-url: https://github.com/orgs/ansible-lockdown/projects/1
17-
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
github-token: ${{ secrets.ALD_GH_PROJECT }}

.github/workflows/update_galaxy.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ repos:
4141
- id: detect-secrets
4242

4343
- repo: https://github.com/gitleaks/gitleaks
44-
rev: v8.28.0
44+
rev: v8.30.0
4545
hooks:
4646
- id: gitleaks
4747

4848
- repo: https://github.com/ansible-community/ansible-lint
49-
rev: v25.9.2
49+
rev: v26.1.1
5050
hooks:
5151
- id: ansible-lint
5252
name: Ansible-lint
@@ -65,7 +65,7 @@ repos:
6565
# - ansible-core>=2.10.1
6666

6767
- repo: https://github.com/adrienverge/yamllint.git
68-
rev: v1.37.1 # or higher tag
68+
rev: v1.38.0 # or higher tag
6969
hooks:
7070
- id: yamllint
7171
name: Check YAML Lint

Changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Changes to rhel9CIS
22

3-
43
## 2.0.4 - Based on CIS v2.0.0
54

5+
- addressed issue #419, thank you @aaronk1
6+
- addressed issue #418 thank you @bbaassssiiee
7+
- addressed issue #416 thank you @georgenalen and @bbaassssiiee
68
- addressed issue #393 thank you to @fragglexarmy
79
- addressed issue #394 thank you to @dbeuker
810
- addressed issues #390 and #391 thanks to @polski-g
@@ -11,6 +13,9 @@
1113
- work flow updates
1214
- audit logic improvements
1315
- auditd template 2.19 compatible
16+
- pre-commit updates
17+
- #410 thanks to @kpi-nourman
18+
- #413 thanks to @bbaassssiiee
1419

1520
## 2.0.3 - Based on CIS v2.0.0
1621
- addressed issue #387, thank you @fragglexarmy

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Mindpoint Group - A Tyto Athene Company / Ansible Lockdown
3+
Copyright (c) 2026 Mindpoint Group - A Tyto Athene Company / Ansible Lockdown
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

defaults/main.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,7 @@ rhel9cis_crypto_policy_ansiblemanaged: true
602602
# -'FUTURE': conservative security level that is believed to withstand any near-term future attacks
603603
# -'FIPS': A level that conforms to the FIPS140-2 requirements
604604
rhel9cis_crypto_policy: 'DEFAULT'
605-
# This variable contains the value of the crypto policy module(combinations of policies and
606-
# sub-policies) to be allowed as default setting. Allowed options are defined in 'vars/main.yml' file,
607-
# using 'rhel9cis_allowed_crypto_policies_modules' variable, which currently are:
608-
# - 'OSPP'
609-
# - 'AD-SUPPORT'
610-
# - 'AD-SUPPORT-LEGACY'
611-
rhel9cis_crypto_policy_module: ''
612-
## Controls 1.6.x
605+
## Control 1.6
613606
# This variable contains the value of the crypto policy module(combinations of policies and
614607
# sub-policies) to be allowed as default setting. Allowed options are defined in 'vars/main.yml' file,
615608
# using those listed in the 'rhel9cis_allowed_crypto_policies_modules' variable.
@@ -802,6 +795,8 @@ rhel9cis_tftp_client: false
802795
## Control 3.1.1 - Ensure IPv6 status is identified
803796
# This variable governs whether ipv6 is enabled or disabled.
804797
rhel9cis_ipv6_required: true
798+
# rhel9cis_ipv6_disable defines the method of disabling IPv6, sysctl vs kernel
799+
rhel9cis_ipv6_disable_method: "sysctl"
805800

806801
## Control 3.1.2 - Ensure wireless interfaces are disabled
807802
# if wireless adapter found allow network manager to be installed

tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
- rule_5.4.2.4
135135
block:
136136
- name: "Ensure root password is set"
137-
ansible.builtin.shell: LC_ALL=C passwd -S root | grep -E "(Password set|Password locked)"
137+
ansible.builtin.shell: LC_ALL=C passwd -S root | grep -E "(Alternate authentication|Password set|Password locked)"
138138
changed_when: false
139139
failed_when: prelim_root_passwd_set.rc not in [ 0, 1 ]
140140
register: prelim_root_passwd_set

tasks/section_3/cis_3.1.x.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,30 @@
1616
- rule_3.1.1
1717
- NIST800-53R5_CM-7
1818
block:
19-
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | refresh"
19+
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | Set vars for sysctl template"
20+
when: "'sysctl' in rhel9cis_ipv6_disable_method"
2021
ansible.builtin.set_fact:
2122
rhel9cis_sysctl_update: true
2223
rhel9cis_flush_ipv6_route: true
2324

24-
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | disable"
25+
- name: "3.1.1 | AUDIT | Ensure IPv6 status is identified | Message out implementation info"
26+
when: "'sysctl' in rhel9cis_ipv6_disable_method"
2527
ansible.builtin.debug:
2628
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-disable_ipv6.conf"
2729

30+
- name: "3.1.1 | AUDIT | Ensure IPv6 status is identified | Find IPv6 status"
31+
when: "'kernel' in rhel9cis_ipv6_disable_method"
32+
ansible.builtin.command: grubby --info=ALL
33+
changed_when: false
34+
failed_when: false
35+
register: discovered_rhel9cis_3_1_1_ipv6_status
36+
37+
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | Disable IPV6 via Kernel"
38+
when:
39+
- "'kernel' in rhel9cis_ipv6_disable_method"
40+
- "'ipv6.disable=1' not in discovered_rhel9cis_3_1_1_ipv6_status.stdout"
41+
ansible.builtin.shell: grubby --update-kernel=ALL --args="ipv6.disable=1"
42+
2843
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled"
2944
when:
3045
- rhel9cis_rule_3_1_2

tasks/section_5/cis_5.1.x.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@
431431
path: "{{ rhel9cis_sshd_config_file }}"
432432
regexp: (?i)^(#|)\s*MaxStartups
433433
line: 'MaxStartups {{ rhel9cis_ssh_maxstartups }}'
434+
insertbefore: "^Match"
435+
firstmatch: true
434436
validate: sshd -t -f %s
435437
notify: Restart sshd
436438

tasks/section_5/cis_5.3.2.x.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@
9393
loop:
9494
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+preauth"
9595
after: "auth\\s+required\\s+pam_env.so" # yamllint disable-line rule:colons
96-
line: "auth required pam_faillock.so preauth silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
96+
line: "auth required pam_faillock.so preauth silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
9797
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+authfail"
9898
before: "auth\\s+required\\s+pam_deny.so"
99-
line: "auth required pam_faillock.so authfail silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
99+
line: "auth required pam_faillock.so authfail silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
100100
- regexp: "account\\s+required\\s+pam_faillock.so"
101101
before: "account\\s+required\\s+pam_unix.so"
102102
line: "account required pam_faillock.so" # yamllint disable-line rule:colons
@@ -112,10 +112,10 @@
112112
loop:
113113
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+preauth"
114114
after: "auth\\s+required\\s+pam_env.so" # yamllint disable-line rule:colons
115-
line: "auth required pam_faillock.so preauth silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
115+
line: "auth required pam_faillock.so preauth silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
116116
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+authfail"
117117
before: "auth\\s+required\\s+pam_deny.so"
118-
line: "auth required pam_faillock.so authfail silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
118+
line: "auth required pam_faillock.so authfail silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
119119
- regexp: "account\\s+required\\s+pam_faillock.so"
120120
before: "account\\s+required\\s+pam_unix.so"
121121
line: "account required pam_faillock.so" # yamllint disable-line rule:colons

0 commit comments

Comments
 (0)