6
0
Fork 0

Compare commits

..

207 commits

Author SHA1 Message Date
irl
c403016b38 feat: become true for all tasks 2026-05-12 19:33:37 +01:00
uk-bolly
b98381fcd8
Merge pull request #432 from ansible-lockdown/devel
Latest main release
2026-02-27 11:43:24 +00:00
Frederick Witty
587dfb40cf
Merge pull request #429 from ansible-lockdown/pub_feb26_updates
Pub feb26 updates
2026-02-12 10:14:46 -05:00
Mark Bolwell
25b9934ce0
removed dup key
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-12 12:17:31 +00:00
uk-bolly
3015e2fe2f
Merge branch 'devel' into pub_feb26_updates
Signed-off-by: uk-bolly <69214557+uk-bolly@users.noreply.github.com>
2026-02-12 09:54:10 +00:00
Mark Bolwell
032c75924e
Tidy up 5.3.2.1
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-12 09:49:52 +00:00
Mark Bolwell
98e89d8945
Latest fixes updates Feb26
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-12 09:15:05 +00:00
Frederick Witty
3cfcf00717
Merge pull request #63 from ansible-lockdown/Feb26_updates
Update .j2 branding
2026-02-11 17:01:56 -05:00
Frederick Witty
f413385208
Update .j2 branding
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-02-11 15:39:59 -05:00
Frederick Witty
4aa09d558f
Merge pull request #61 from ansible-lockdown/Feb26_updates
2026 Feb QA Fixes
2026-02-11 15:19:20 -05:00
Frederick Witty
71206432be
QA fixes and rollback of audit_only logic
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-02-11 14:54:30 -05:00
uk-bolly
15ebe5500b
Merge pull request #428 from draygoX/devel
Move rhel9cis_ipv6_disable_method to a better location
2026-02-11 09:32:37 +00:00
Frederick Witty
11becb32c5
QA Fixes
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-02-10 16:01:05 -05:00
Frederick Witty
a6aa5895d5
Merge pull request #60 from ansible-lockdown/Feb26_updates
Enhance documents for password hash
2026-02-06 10:24:39 -05:00
Mark Bolwell
2863be6c02
tidied up comments to make it simpler
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-06 14:16:29 +00:00
Mark Bolwell
591f0d90f4
Updated comments for password hash and variable
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-06 12:49:05 +00:00
Frederick Witty
0a77d6859f
Merge pull request #59 from ansible-lockdown/Feb26_updates
Feb26 updates
2026-02-05 16:01:24 -05:00
Mark Bolwell
3442801399
tidy up of variables and warning for bootloader password
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-05 20:29:37 +00:00
Mark Bolwell
9a3f458db0
Updated bootloader password logic and enabled old methods without change
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-05 18:10:29 +00:00
Mark Bolwell
9b091984db
updated logic to allow manual hash to be added or filter
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-05 17:53:55 +00:00
Mark Bolwell
f1786fe20f
added passlib dependency documentation
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-05 10:39:04 +00:00
Mark Bolwell
83ee942ecf
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-03 09:18:36 +00:00
Mark Bolwell
943b570484
incorporated PR 345 thanks to @thulium-drake
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-03 09:01:55 +00:00
Mark Bolwell
c7567a98ac
fixed tags and audit logic
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-03 08:57:45 +00:00
Mark Bolwell
eb9c96f335
Updated Company title
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-01 20:13:34 +00:00
Mark Bolwell
2708a28409
removed schedule tasks
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-01 20:09:48 +00:00
Mark Bolwell
3e27eb88de
Updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-01 20:09:10 +00:00
Mark Bolwell
db0b08762e
fixed typo thats to Eugene @Frequentis
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-01 19:54:22 +00:00
Mark Bolwell
63d2ce7d2d
removed legacy option
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2026-02-01 19:53:50 +00:00
draygoX
8126665a02
Move rhel9cis_ipv6_disable_method to a better location
Signed-off-by: draygoX <90591954+draygoX@users.noreply.github.com>
2026-01-30 08:48:00 -06:00
uk-bolly
663f84d1fe
Merge pull request #427 from ansible-lockdown/devel
Release to main
2026-01-26 12:00:22 +00:00
uk-bolly
e6a29ab36d
Merge pull request #426 from ansible-lockdown/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2026-01-22 08:48:58 +00:00
uk-bolly
d3f24d9d94
Merge pull request #420 from bol7742/patch-1
fix: make 5.3.2.2 idempotent with 5.3.3.1.1
2026-01-22 08:48:38 +00:00
pre-commit-ci[bot]
c1f4b780be
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/ansible-community/ansible-lint: v25.12.2 → v26.1.1](https://github.com/ansible-community/ansible-lint/compare/v25.12.2...v26.1.1)
- [github.com/adrienverge/yamllint.git: v1.37.1 → v1.38.0](https://github.com/adrienverge/yamllint.git/compare/v1.37.1...v1.38.0)
2026-01-19 17:44:50 +00:00
Frederick Witty
6b986a7352
Merge pull request #57 from ansible-lockdown/2026Jan_Updates
2026 Jan Updates: Public Issue fixes, Lic Year and Linting
2026-01-08 16:41:35 -05:00
Frederick Witty
e65df16f67
Update 3.1.1
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-01-08 14:33:16 -05:00
Frederick Witty
173fbd3254
Linting
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-01-08 14:26:24 -05:00
Frederick Witty
10f88cc1a3
update vars to rhel9
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-01-08 14:13:07 -05:00
Frederick Witty
309ff4cdd7
Fixes from Public Issue 418 and 419 + Lic year
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-01-08 14:08:35 -05:00
Frederick Witty
b2d08552c5
Merge pull request #425 from ansible-lockdown/2026Jan_Updates
2026 Jan Updates
2026-01-08 13:50:20 -05:00
Frederick Witty
02132181e6
update changelog
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-01-08 12:24:44 -05:00
Frederick Witty
22a9b085d7
fix for #419, thank you @aaronk1
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-01-08 12:23:40 -05:00
Frederick Witty
87cd0f3eb5
fix for #418 and update Lic year
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2026-01-08 09:40:08 -05:00
Frederick Witty
2d02d8b048
Merge pull request #56 from ansible-lockdown/benchmark_v2.0.0
Benchmark v2.0.0 Sync
2025-12-30 14:42:39 -05:00
Frederick Witty
fb74617694
Merge pull request #55 from ansible-lockdown/disable_ipv6_improvements
Update audit vars to add rhel9cis_ipv6_disable_method
2025-12-30 10:19:52 -05:00
Frederick Witty
923cba3ca5
Merge pull request #424 from ansible-lockdown/issue_416_fix
Issue 416: update changelog and ansible_vars_goss
2025-12-30 10:18:50 -05:00
Frederick Witty
5d1143ff87
Update changelog
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2025-12-30 08:21:47 -05:00
Frederick Witty
fefd2c94b2
Update ansible_vars_goss with var rhel9cis_ipv6_disable_method
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2025-12-30 08:17:57 -05:00
Frederick Witty
ac83c8cf35
Update audit vars to add rhel9cis_ipv6_disable_method: {{ rhel9cis_ipv6_disable_method }}
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2025-12-29 17:18:05 -05:00
Frederick Witty
863d1af4cf
Merge pull request #423 from ansible-lockdown/crypto_policies
Tidy up wording regarding crypto policy module
2025-12-29 09:24:02 -05:00
Mark Bolwell
76cd8c7cb3
Tidy up wording regarding crypto policy modules thanks to @kpi-nourman #414
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-12-29 09:43:28 +00:00
Frederick Witty
67b411400e
Merge pull request #54 from ansible-lockdown/benchmark_v2.0.0
Benchmark v2.0.0 Sync
2025-12-24 10:11:45 -05:00
Frederick Witty
fe41034da6
Merge pull request #53 from ansible-lockdown/disable_ipv6_improvements
Disable ipv6 improvements
2025-12-24 09:06:32 -05:00
George Nalen
7ff8e7b6b9
Updated disable IPv6 logic
Signed-off-by: George Nalen <georgen@mindpointgroup.com>
2025-12-23 11:20:21 -05:00
George Nalen
8c2597e61b
Merge pull request #422 from ansible-lockdown/issue_416_fix
Issue 416 fix
2025-12-23 11:10:13 -05:00
George Nalen
29a48f7f4c
updated name info for tasks related to 3.1.1
Signed-off-by: George Nalen <georgen@mindpointgroup.com>
2025-12-23 09:04:42 -05:00
George Nalen
d9927f005b
fixed typo in disable method var
Signed-off-by: George Nalen <georgen@mindpointgroup.com>
2025-12-23 08:42:28 -05:00
uk-bolly
f5d7d2294d
Merge pull request #421 from ansible-lockdown/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-12-23 09:27:35 +00:00
George Nalen
2b7c8293b8
fixed linting issue
Signed-off-by: George Nalen <georgen@mindpointgroup.com>
2025-12-22 16:56:24 -05:00
George Nalen
beb3bfdc94
added option for sysctl or kernel for disabling IPv6
Signed-off-by: George Nalen <georgen@mindpointgroup.com>
2025-12-22 16:35:08 -05:00
pre-commit-ci[bot]
96474159ab
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/ansible-community/ansible-lint: v25.12.1 → v25.12.2](https://github.com/ansible-community/ansible-lint/compare/v25.12.1...v25.12.2)
2025-12-22 17:33:38 +00:00
bol7742
f15407dcb4
fix: make 5.3.2.2 idempotent with 5.3.3.1.1
Signed-off-by: bol7742 <102948121+bol7742@users.noreply.github.com>
2025-12-22 11:28:49 +01:00
George Nalen
62989d258b
added fix to issue #416
Signed-off-by: George Nalen <gjnalen@gmail.com>
2025-12-19 16:31:37 -05:00
Frederick Witty
53287f31a9
Merge pull request #417 from ansible-lockdown/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-12-17 14:43:02 -05:00
pre-commit-ci[bot]
322404a692
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/gitleaks/gitleaks: v8.29.1 → v8.30.0](https://github.com/gitleaks/gitleaks/compare/v8.29.1...v8.30.0)
- [github.com/ansible-community/ansible-lint: v25.11.0 → v25.12.1](https://github.com/ansible-community/ansible-lint/compare/v25.11.0...v25.12.1)
2025-12-15 17:41:29 +00:00
Frederick Witty
de09b5d150
Merge pull request #50 from ansible-lockdown/benchmark_v2.0.0
Benchmark v2.0.0
2025-12-01 11:00:12 -05:00
Frederick Witty
07885f99b4
Merge pull request #415 from ansible-lockdown/issue_413
issues 413 addressed thansk to @bbaassssiiee
2025-12-01 08:53:54 -05:00
Frederick Witty
c04326b2fe
Merge pull request #51 from ansible-lockdown/priv_413
pre-commit and issue 413
2025-12-01 08:38:43 -05:00
Mark Bolwell
f80c60bb8a
updated with correct fix thanks to @bbaassssiiee
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-12-01 10:41:38 +00:00
Mark Bolwell
571711f11e
updated with correct fix thanks to @bbaassssiiee
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-12-01 10:23:25 +00:00
Mark Bolwell
52452b1e3c
issues 413 addressed thansk to @bbaassssiiee
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-28 14:51:43 +00:00
Mark Bolwell
add8ebb819
udpated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-28 14:47:00 +00:00
Mark Bolwell
ed784d270b
added fix for issues #413 azure locked passwords
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-28 14:44:59 +00:00
Mark Bolwell
32a3473ddc
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-28 14:35:20 +00:00
Frederick Witty
8b160681f5
Merge pull request #412 from ansible-lockdown/issue_#410
#410 add fix provided by @kpi-nourman via discord community
2025-11-25 10:06:32 -05:00
Frederick Witty
63931388ed
Merge pull request #49 from ansible-lockdown/priv_410
add fix provided by @kpi-nourman via discord community
2025-11-25 10:05:47 -05:00
Mark Bolwell
dc570e8b53
add fix provided by @kpi-nourman via discord community
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-25 09:29:56 +00:00
Mark Bolwell
72602c63fa
add fix provided by @kpi-nourman via discord community
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-25 09:28:00 +00:00
uk-bolly
5091aafcd6
Merge pull request #411 from ansible-lockdown/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-11-25 08:46:23 +00:00
pre-commit-ci[bot]
539ac4f5cc
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/gitleaks/gitleaks: v8.29.0 → v8.29.1](https://github.com/gitleaks/gitleaks/compare/v8.29.0...v8.29.1)
2025-11-24 17:42:03 +00:00
uk-bolly
eb432ddb14
Merge pull request #409 from ansible-lockdown/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2025-11-17 12:07:40 +00:00
pre-commit-ci[bot]
0ec943073c
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/gitleaks/gitleaks: v8.28.0 → v8.29.0](https://github.com/gitleaks/gitleaks/compare/v8.28.0...v8.29.0)
- [github.com/ansible-community/ansible-lint: v25.9.2 → v25.11.0](https://github.com/ansible-community/ansible-lint/compare/v25.9.2...v25.11.0)
2025-11-10 17:45:49 +00:00
Frederick Witty
a07d03baaf
Merge pull request #48 from ansible-lockdown/benchmark_v2.0.0
Benchmark v2.0.0
2025-11-04 17:23:03 -05:00
Mark Bolwell
d2dc32d3ba
updated layout
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-04 16:43:37 +00:00
Mark Bolwell
1a3e56c11d
updated layout
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-11-04 16:37:40 +00:00
Frederick Witty
28b52876ec
Merge pull request #408 from ansible-lockdown/auto_issue_to_project
.github standardization
2025-10-23 15:07:02 -04:00
Frederick Witty
4c41656a3b
.github standardization
Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
2025-10-23 08:28:06 -04:00
Frederick Witty
2591a46a45
Merge pull request #47 from ansible-lockdown/benchmark_v2.0.0
Update default brach with latest Benchmark v2.0.0
2025-10-16 11:13:23 -04:00
Frederick Witty
18b7305a71
Merge pull request #46 from ansible-lockdown/priv_Oct25
Latest updated for benchmark
2025-10-16 10:41:51 -04:00
Mark Bolwell
cd66f4b76f
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-16 15:20:39 +01:00
Mark Bolwell
ec7226377b
updated template logic for 2.19
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-16 15:18:15 +01:00
Mark Bolwell
25d3e897fe
updated to latest version
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-16 15:01:57 +01:00
Mark Bolwell
45018f30cb
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-16 14:58:52 +01:00
Mark Bolwell
a525e4a2fb
Added extra failure for no data
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-16 14:58:06 +01:00
Mark Bolwell
727ae4515b
updated auditd variables
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-16 14:57:24 +01:00
Mark Bolwell
6be41416ec
updated workflow permissions
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-16 14:51:22 +01:00
Frederick Witty
20f6b18e34
Merge pull request #45 from ansible-lockdown/ssh_and_badges
Ssh and badges
2025-10-03 09:06:04 -04:00
Mark Bolwell
16441ddef6
added badge workflows
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-03 08:14:13 +01:00
Mark Bolwell
8f1aba35f6
added fix for public #399
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-03 08:13:35 +01:00
Frederick Witty
499309b39d
Merge pull request #44 from ansible-lockdown/typo_fix
Typo fix
2025-10-02 08:38:26 -04:00
Mark Bolwell
2cef9e6b29
updated workflows
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-02 12:04:51 +01:00
Mark Bolwell
88278381db
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-02 09:22:09 +01:00
Mark Bolwell
fdc0a7afed
fixed typo thanks to @trumbaut #397
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-02 09:20:47 +01:00
Frederick Witty
362d9bd196
Merge pull request #43 from ansible-lockdown/updates_sept25
Updates sept25
2025-10-01 14:16:12 -04:00
Mark Bolwell
b9478e4cd5
changed wording for OS supported
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-01 17:46:37 +01:00
Mark Bolwell
ee07e5fcce
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-01 17:45:50 +01:00
Mark Bolwell
383c4651c5
added public fix #396
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-10-01 17:44:17 +01:00
Mark Bolwell
955d3052cc
latest badges and layout
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 16:01:12 +01:00
Mark Bolwell
5f64ccd843
5.3.2.1 updated var naming
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 15:20:23 +01:00
Mark Bolwell
0d56df1eda
5.4.1.3 typo fix thanks to @fragglexarmy
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 14:53:17 +01:00
Mark Bolwell
f09cd1dcc6
updated ansible lint version
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 14:52:29 +01:00
Mark Bolwell
7769bec99e
Added section5 subsections public #390 thanks to @polski-g
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 14:44:57 +01:00
Mark Bolwell
caffb14671
applied latest fix from public #386 thansk to @polski-g
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 14:38:45 +01:00
Mark Bolwell
3c3bdaeb38
using benchmark_version variable
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 14:36:15 +01:00
Mark Bolwell
5dd64ebdb8
max concurrent options and default added
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 14:20:10 +01:00
Mark Bolwell
9a113ea4a8
fix pre-commit var naming for authselect
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-09-30 14:17:08 +01:00
Fred W.
12f97a0945
Merge pull request #42 from ansible-lockdown/2025_Sep_Updates
2025 Sep Updates: Public Issue Fixes and Improvements
2025-09-12 08:03:22 -04:00
Frederick Witty
d927b3006d
linting clean up
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-09-11 16:05:24 -04:00
Frederick Witty
67c574d8a9
Updates from Public
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-09-10 12:57:50 -04:00
Fred W.
a1d88edde0
Merge pull request #41 from ansible-lockdown/benchmark_v2.0.0
Apply updates to the latest branch
2025-08-21 16:34:38 -04:00
Fred W.
c630c23725
Merge pull request #40 from ansible-lockdown/august_updates
August updates
2025-08-14 16:37:22 -04:00
Mark Bolwell
811b70612e
udpated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 17:25:37 +01:00
Mark Bolwell
eafee7e040
Added typo updates thanks to @DianaMariaDDM
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 17:19:53 +01:00
Mark Bolwell
f1e50bdc4c
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 17:15:35 +01:00
Mark Bolwell
55c7fa6dd5
added password of different LC public issue 372
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 17:12:56 +01:00
Mark Bolwell
95ed2ff03d
changed to import task public PR 377
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 17:09:58 +01:00
Mark Bolwell
4b302f97f9
fixed compability pre 2.14 thanks to public PR #380
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 16:50:41 +01:00
Mark Bolwell
55917c8daa
udpated pre-commit hooks version
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 16:27:41 +01:00
Mark Bolwell
625e4041c1
update logic for 5.2.4 public PR #371
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 16:20:51 +01:00
Mark Bolwell
73320db603
dont not run section 1.8 if not gdm PR #364 from public
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 16:17:45 +01:00
Mark Bolwell
62095f75fe
updated as per public PR #350
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-14 16:14:47 +01:00
uk-bolly
c501e3d210
Merge pull request #39 from ansible-lockdown/audit_update
Updated audit file permissions when running audit thansk to @steve-hayes
2025-08-05 13:20:34 +01:00
Mark Bolwell
ef2c4d4ddb
Updated audit file permissions when running audit thansk to @steve-hayes
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-08-04 10:15:48 +01:00
Mark Bolwell
3778d6fb62
improvement updated with public #361
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-07-04 11:34:53 +01:00
Mark Bolwell
0a56b16d32
updated as per public fix #360
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-07-04 11:32:56 +01:00
jjoympg
eaf5294c1e
Merge pull request #38 from ansible-lockdown/benchmark_v2.0.0
Align latest with public fixes
2025-07-02 11:44:35 -04:00
Mark Bolwell
1bdef212bd
Apply latest public fixes benchmark_v2.0.0
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-07-02 10:47:56 +01:00
uk-bolly
cf8581fb03
Merge pull request #36 from ansible-lockdown/benchmark_v2.0.0
Benchmark v2.0.0 Sync
2025-07-01 16:59:02 +01:00
jjoympg
0f5f3ee19b
Merge pull request #37 from ansible-lockdown/rule_6.3.3.5_update
Rule 6.3.3.5 update
2025-07-01 10:17:54 -04:00
Mark Bolwell
b8ed2dfdac
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-07-01 09:37:25 +01:00
Mark Bolwell
2142934148
updated 6.3.3.5
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-07-01 09:29:08 +01:00
Fred W.
968e7783d0
Merge pull request #35 from ansible-lockdown/fix_5.2.4
Improved logic for 5.2.4
2025-06-27 16:58:20 -04:00
Frederick Witty
874890ee40
Update site.yml hosts logic
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-27 12:06:18 -04:00
Frederick Witty
0ee2de5e20
Addresses #318 - Thank you @kodebach & @bgro
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-27 12:04:29 -04:00
Fred W.
0efd92e2a3
Merge pull request #31 from ansible-lockdown/JUNE2025QA
June 2025 QA: Replace egrep to grep
2025-06-23 08:36:55 -04:00
uk-bolly
383822d107
Merge pull request #33 from ansible-lockdown/audit_only_fetch
Audit only fetch
2025-06-20 14:41:34 +02:00
Mark Bolwell
9db79097f9
fixed crypto logic
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-20 12:14:14 +01:00
Mark Bolwell
82cc458d7a
Fix logic and notes for in crypto policy building
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-20 11:32:31 +01:00
Mark Bolwell
aaea8352de
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-19 16:33:29 +01:00
Mark Bolwell
379b184554
added changed_when to fix false warning errors
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-19 16:32:20 +01:00
Mark Bolwell
d2de2783a8
added ability to fetch audit and update title
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-19 16:31:37 +01:00
Fred W.
3be331c0d2
Merge pull request #32 from ansible-lockdown/June25_align
June25 align
2025-06-17 09:33:09 -04:00
Frederick Witty
acacb7a6bc
QA Fixes
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-16 17:18:08 -04:00
Frederick Witty
38a173546c
Update auditd with check_mode
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-16 16:49:36 -04:00
Frederick Witty
b38e7d06eb
var fixes for 1.1.2.3.x and 1.1.2.4.x
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-16 15:14:08 -04:00
Frederick Witty
6ced990430
Update handler naming change_requires_reboot to set reboot required
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-16 14:58:21 -04:00
Mark Bolwell
7e5fb97b9a
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:23:28 +01:00
Mark Bolwell
b65504de6b
Updated egrep
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:20:40 +01:00
Mark Bolwell
f892525a7c
5.1.10 and 5.1.11 updated variable naming
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:19:18 +01:00
Mark Bolwell
02008339b4
updated regex
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:18:22 +01:00
Mark Bolwell
2724faf1fc
50-redhat.conf var naming update
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:17:00 +01:00
Mark Bolwell
1537bf72df
5-redhat.conf var naming
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:16:26 +01:00
Mark Bolwell
2eb85294c8
Updated conditionals for audit steps
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:15:42 +01:00
Mark Bolwell
ce3ae8361e
Updated logic for root password check
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:14:58 +01:00
Mark Bolwell
6770e5a4ff
added check_mode false to task
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:13:53 +01:00
Mark Bolwell
27c7ec3604
fixed typos
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-06-16 17:12:21 +01:00
Frederick Witty
3a0ee6e9f8
update 1.3.1.6 log to grep -E
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-12 15:44:03 -04:00
Frederick Witty
f40d17df92
Update eprep based tasks to grep/awk
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-06-12 12:42:44 -04:00
Fred W.
1416780797
Merge pull request #30 from ansible-lockdown/interactive_user_update
Interactive user update
2025-05-28 12:15:41 -04:00
Mark Bolwell
2e3499ca8c
added missing square brace
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 16:47:01 +01:00
Mark Bolwell
3197252611
Merge branch 'benchmark_v2.0.0' into interactive_user_update
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 16:14:18 +01:00
Mark Bolwell
2256456f0e
align with public fixes
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 16:12:31 +01:00
Mark Bolwell
f2c03f1e68
variable networkmanager package and typo fixes
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 16:11:36 +01:00
Mark Bolwell
260005415c
Aligned with public
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 15:58:54 +01:00
Mark Bolwell
7673c2ff00
Added home directory discovery
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 15:53:41 +01:00
Mark Bolwell
97abfaf9f8
updated passwd variable
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 15:41:12 +01:00
Mark Bolwell
f29fc9088c
fixed var naming
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 10:53:32 +01:00
Mark Bolwell
a1126618a7
Added names
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-28 10:52:32 +01:00
Fred W.
029eb6768d
Merge pull request #29 from ansible-lockdown/benchmark_v2.0.0
may25_issues v2.0.0 release to latest
2025-05-23 14:04:54 -04:00
uk-bolly
73c84de639
Merge pull request #28 from ansible-lockdown/may25_issues
May25 issues
2025-05-23 16:33:53 +01:00
Frederick Witty
a16b6b96bc
Fix for #325 thank you @mindrb
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-05-23 11:14:58 -04:00
Mark Bolwell
cc48a0d0b5
Interactive user discovery improve thanks to @polski-g
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-23 15:53:03 +01:00
Mark Bolwell
4357f132a9
improved test for passwd entries
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-23 15:50:41 +01:00
Mark Bolwell
c23bce5c75
added check mode logic
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-23 14:35:50 +01:00
Mark Bolwell
b9a59b9adc
added check_mode logic
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-23 14:30:30 +01:00
Mark Bolwell
de45131085
added rhel9cis_rsyslog_ansiblemanage conditional
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-23 14:25:22 +01:00
Mark Bolwell
e9babc8e3b
added ignore comments in file
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-05-23 14:22:49 +01:00
Fred W.
bd60c0f554
Merge pull request #27 from ansible-lockdown/benchmark_v2.0.0
May 15th 2025 QA Fixes from Benchmark v2.0.0
2025-05-15 17:06:53 -04:00
Frederick Witty
23b2909073
QA Fixes
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-05-15 16:48:44 -04:00
Fred W.
ee5f604a66
Merge pull request #26 from ansible-lockdown/latest
May 2025 Alignment to latest
2025-05-09 15:31:23 -04:00
Fred W.
1d266e61a7
Merge pull request #25 from ansible-lockdown/benchmark_v2.0.0
Benchmark v2.0.0
2025-05-09 15:12:17 -04:00
Fred W.
2c35f64f38
Merge pull request #24 from ansible-lockdown/devel
May 2025 devel to latest alignment
2025-05-09 14:51:13 -04:00
Fred W.
591f99960f
Merge pull request #23 from ansible-lockdown/2025Apr_post_audit_fix
2025 April Typo Fixes
2025-04-15 16:25:00 -04:00
Frederick Witty
120207440c
Typo fixes
Signed-off-by: Frederick Witty <frederickw@mindpointgroup.com>
2025-04-15 15:22:19 -04:00
uk-bolly
5e6ccbaa18
Merge pull request #22 from ansible-lockdown/updates
Updates and alignement
2025-04-15 16:14:26 +01:00
Mark Bolwell
e5f923c9be
Merge branch 'updates' into benchmark_v2.0.0
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-04-15 14:30:05 +01:00
uk-bolly
8d002f2eee
Merge pull request #20 from ansible-lockdown/benchmark_v2.0.0
Benchmark v2.0.0 to latest
2025-04-01 14:25:09 +01:00
Mark Bolwell
a41de702f4
lint updates
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-04-01 10:00:24 +01:00
Mark Bolwell
9e40054489
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-04-01 09:57:15 +01:00
Mark Bolwell
37868f591b
updated workflows
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-04-01 09:56:51 +01:00
Mark Bolwell
7a3efd4920
added fetch and ansible facts
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-04-01 09:56:51 +01:00
uk-bolly
3eaa1b594c
Merge pull request #19 from ansible-lockdown/live_v2
Live v2
2025-03-03 14:00:31 +00:00
Stephen Williams
69e481d4fd
Merge pull request #18 from ansible-lockdown/7_2_9_logic
updated logic in 7.2.9
2025-02-07 11:38:35 -05:00
Mark Bolwell
3c7ab9f687
updated logic in 7.2.9
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2025-02-07 12:24:35 +00:00
uk-bolly
ea92aa8908
Merge pull request #14 from ansible-lockdown/benchmark_v2.0.0
Merge v2.0.0 to devel
2024-12-19 15:58:34 +00:00
uk-bolly
cd829d16ac
Merge pull request #3 from ansible-lockdown/benchmark_v2.0.0
Benchmark to devel
2024-09-10 14:11:54 +01:00
uk-bolly
51d6220eda
Merge pull request #1 from ansible-lockdown/benchmark_v2.0.0
Added ARM support for audit
2024-08-20 17:10:42 +01:00
75 changed files with 479 additions and 278 deletions

View file

@ -1,9 +1,9 @@
---
parseable: true
quiet: true
skip_list:
- 'package-latest'
- 'risky-shell-pipe'
- 'var-naming[read-only]'
use_default_rules: true
verbosity: 0

View file

@ -14,4 +14,4 @@ jobs:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/ansible-lockdown/projects/1
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.ALD_GH_PROJECT }}

View file

@ -12,8 +12,6 @@ on:
push:
branches:
- latest
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:

View file

@ -1,19 +0,0 @@
---
name: update galaxy
on:
push:
branches:
- main
jobs:
update_role:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Action Ansible Galaxy Release ${{ github.ref_name }}
uses: ansible-actions/ansible-galaxy-action@main
with:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}

View file

@ -39,14 +39,16 @@ repos:
rev: v1.5.0
hooks:
- id: detect-secrets
name: Detect Secrets test
- repo: https://github.com/gitleaks/gitleaks
rev: v8.28.0
rev: v8.30.0
hooks:
- id: gitleaks
name: Run Gitleaks test
- repo: https://github.com/ansible-community/ansible-lint
rev: v25.9.2
rev: v26.1.1
hooks:
- id: ansible-lint
name: Ansible-lint
@ -65,7 +67,7 @@ repos:
# - ansible-core>=2.10.1
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1 # or higher tag
rev: v1.38.0 # or higher tag
hooks:
- id: yamllint
name: Check YAML Lint

View file

@ -1,4 +1,5 @@
---
extends: default
ignore: |
tests/

View file

@ -7,7 +7,7 @@ Rules
2) All commits must have Signed-off-by (Signed-off-by: Joan Doe <joan.doe@email.com>) in the commit message (details in Signing section)
3) All work is done in your own branch
4) All pull requests go into the devel branch. There are automated checks for signed commits, signoff in commit message, and functional testing)
5) Be open and nice to eachother
5) Be open and nice to each other
Workflow
--------

View file

@ -1,8 +1,87 @@
# Changes to rhel9CIS
# Changes to RHEL9CIS
## 2.0.5 - Based on CIS v2.0.0
- QA Fixes
- .j2 Branding Update
- Added rhel9cis_uses_root variable definition for 5.4.2.5 root PATH integrity task
- fixed spelling and grammar across defaults/main.yml, Changelog.md, README.md, tasks/main.yml, and vars/main.yml
- Fixed incorrect product reference in vars/main.yml comment (ubtu24cis -> rhel9cis)
- Fixed broken Changelog link in README.md (case mismatch)
- Added var-naming[read-only] to ansible-lint skip list for molecule files
- Bootloader password logic updated with salt and hash options
- Added passlib dependency documentation for bootloader password hash
- Updated company title
- Tidied up comments and variables for bootloader password
- Removed scheduled tasks
- Fixed typo thanks to Eugene @Frequentis
- Unused variable audit: wired up all unused variables, removed legacy references
- Updated chrony template to use rhel9cis_chrony_server_makestep, rtcsync, and minsources variables instead of hardcoded values
- Wired up rhel9cis_authselect_custom_profile_create toggle in authselect profile creation task
- Fixed task 5.3.3.2.7/5.3.3.2.8 mislabeling: separated password quality enforce and root enforce into correct tasks
- Wired up audit_capture_files_dir in audit_only workflow for file capture to control node
- Clarified rhel9cis_root_unlock_time documentation for commented-out alternative usage
- Removed legacy rhel9cis_rule_1_1_10 from molecule converge files and is_container.yml
- Fixed wrong variable name rhel9cis_unowned_group to rhel9cis_ungrouped_group in tasks/section_7/cis_7.1.x.yml
- Added rhel9cis_install_network_manager toggle to 3.1.2 wireless interfaces task
## 2.0.4 - Based on CIS v2.0.0
addressed issue #419, thank you @aaronk1
addressed issue #418 thank you @bbaassssiiee
Added better sysctl logic to disable IPv6
Added option to disable IPv6 via sysctl (original method) or via the kernel
pre-commit updates
public issue #410 thanks to @kpi-nourman
public issue #413 thanks to @bbaassssiiee
Public issues incorporated
Workflow updates
Pre-commit updates
README latest versions
Audit improvements and max-concurrent option added
Benchmark version variable in audit template
fixed typo thanks to @fragglexarmy #393
fixed typo thanks to @trumbaut #397 & #399
updated auditd template to be 2.19 compliant
PR345 thanks to thulium-drake boot password hash - if used needs passlib module
tidy up tags on tasks/main.yml
## 2.0.3 - Based on CIS v2.0.0
- Thank you @fragglexarmy
- addressed Public issue 387
- Addressed Public issue 382 to improve regex logic on 5.4.2.4
- Improvement on crypto policy managed controls with var logic
- Thanks to @polski-g
- addressed issue 384
- update command to shell module on tasks
- Thanks to @numericillustration
- Public PR 380
- systemd_service rolled back to systemd for < ansible 2.14
- Thanks to @bgro and @Kodebach
- Public PR 371
- updated to user sudo check 5.2.4
- Thanks to @DianaMariaDDM
- Public PR 367
- updated several typos
- Thanks to @polski-g
- Public PR 364
- gdm section 1.8 improvements
- Thanks to @chrispipo
- Public PR 350
- change insert before for rsyslog setting
- Thanks to @thesmilinglord
- public issue 377
- change 1.3 from include task to import for tagging
- Thanks to @Fredouye
- public issue 372
- allow password with different locale
## 2.0.4 - Based on CIS v2.0.0
- addressed issue #419, thank you @aaronk1
- addressed issue #418 thank you @bbaassssiiee
- addressed issue #416 thank you @georgenalen and @bbaassssiiee
- addressed issue #393 thank you to @fragglexarmy
- addressed issue #394 thank you to @dbeuker
- addressed issues #390 and #391 thanks to @polski-g
@ -11,6 +90,9 @@
- work flow updates
- audit logic improvements
- auditd template 2.19 compatible
- pre-commit updates
- #410 thanks to @kpi-nourman
- #413 thanks to @bbaassssiiee
## 2.0.3 - Based on CIS v2.0.0
- addressed issue #387, thank you @fragglexarmy
@ -59,7 +141,7 @@
- updated controls 6.2.10-6.2.14
- audit
- steps moved to prelim
- update to coipy and archive logic and variables
- update to copy and archive logic and variables
- removed vars not used
- updated quotes used in mode tasks
- pre-commit update
@ -93,7 +175,7 @@
- lint updates
- .secrets updated
- file mode quoted
- updated 5.6.5 thansk to feedback from S!ghs on discord community
- updated 5.6.5 thanks to feedback from S!ghs on discord community
## 1.1.1 - Based on CIS v1.0.0
@ -125,7 +207,7 @@
## 1.0.10
- [#72](https://github.com/ansible-lockdown/RHEL9-CIS/issues/72)
- Only run check when paybook user not a superuser
- Only run check when playbook user not a superuser
- fix for 5.5.3 thanks to @nrg-fv
## 1.0.9
@ -197,7 +279,7 @@ Jan-2023 release
- updated ansible minimum to 2.10
- Lint file updates and improvements
- auditd now shows diff ater initial template added
- auditd now shows diff after initial template added
- many control rewritten
- Many controls moved ID references
- Audit updates aligned
@ -222,7 +304,7 @@ Jan-2023 release
- #209 5.6.5 rewrite umask settings
- #220 tidy up and align variables
- #226 Thanks to Thulium-Drake
-Extended the auditd config required value for auditd space left percentage (not part of CIS Benchmark but required fopr auditd to run correctly in some cases)
-Extended the auditd config required value for auditd space left percentage (not part of CIS Benchmark but required for auditd to run correctly in some cases)
- #227 thanks to OscarElits
- chrony files now RH expected locations
@ -262,9 +344,9 @@ Jan-2023 release
- not all controls work with rhel8 releases any longer
- selinux disabled 1.6.1.4
- logrotate - 4.3.x
- updated to rhel8cis v2.0 benchamrk requirements
- updated to rhel8cis v2.0 benchmark requirements
- removed iptables firewall controls (not valid on rhel9)
- added more to logrotate 4.3.x - sure to logrotate now a seperate package
- added more to logrotate 4.3.x - sure to logrotate now a separate package
- grub path now standard to /boot/grub2/grub.cfg
- 1.6.1.4 from rh8 removed as selinux.cfg doesnt disable selinux any longer
- workflow update
@ -283,7 +365,7 @@ args:
```
- update boolean values to true/false
- 3.4.2 improved checks for p[ackage presence
- 3.4.2 improved checks for package presence
- changed to assert for OS/release and ansible version
## Initial

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2025 Mindpoint Group - A Tyto Athene Company / Ansible Lockdown
Copyright (c) 2026 Mindpoint Group - A Tyto Athene Company / Ansible Lockdown
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -19,7 +19,6 @@
## Lint & Pre-Commit Tools 🔧
[![Pre-Commit.ci](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/RHEL9-CIS/pre-commit-ci.json)](https://results.pre-commit.ci/latest/github/ansible-lockdown/RHEL9-CIS/devel)
![YamlLint](https://img.shields.io/badge/yamllint-Present-brightgreen?style=flat&logo=yaml&logoColor=white)
![Ansible-Lint](https://img.shields.io/badge/ansible--lint-Present-brightgreen?style=flat&logo=ansible&logoColor=white)
@ -49,7 +48,6 @@
![Private Benchmark Version](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-RHEL9-CIS/benchmark-version.json)
[![Private Remediate Pipeline](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-RHEL9-CIS/remediate.json)](https://github.com/ansible-lockdown/Private-RHEL9-CIS/actions/workflows/main_pipeline_validation.yml)
[![Private GPO Pipeline](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-RHEL9-CIS/gpo.json)](https://github.com/ansible-lockdown/Private-RHEL9-CIS/actions/workflows/main_pipeline_validation_gpo.yml)
![Private Pull Requests](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-RHEL9-CIS/prs.json)
![Private Closed Issues](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-RHEL9-CIS/issues-closed.json)
@ -58,9 +56,9 @@
## Looking for support? 🤝
[Lockdown Enterprise](https://www.lockdownenterprise.com#GH_AL_RHEL9-CIS)
[Lockdown Enterprise](https://www.lockdownenterprise.com#GH_AL_RH9-CIS)
[Ansible support](https://www.mindpointgroup.com/cybersecurity-products/ansible-counselor#GH_AL_RHEL9-CIS)
[Ansible support](https://www.mindpointgroup.com/cybersecurity-products/ansible-counselor#GH_AL_RH9-CIS)
### Community 💬
@ -86,10 +84,10 @@ This role **will make changes to the system** which may have unintended conseque
## Coming From A Previous Release ⏪
CIS release always contains changes, it is highly recommended to review the new references and available variables. This have changed significantly since ansible-lockdown initial release.
CIS release always contains changes, it is highly recommended to review the new references and available variables. These have changed significantly since ansible-lockdown initial release.
This is now compatible with python3 if it is found to be the default interpreter. This does come with pre-requisites which it configures the system accordingly.
Further details can be seen in the [Changelog](./ChangeLog.md)
Further details can be seen in the [Changelog](./Changelog.md)
---
@ -103,7 +101,7 @@ This is managed using tags:
- level2-server
- level2-workstation
The control found in defaults main also need to reflect this as this control the testing that takes place if you are using the audit component.
The controls found in defaults/main.yml also need to reflect this, as they control the testing that takes place if you are using the audit component.
---
## Requirements ✅
@ -130,6 +128,9 @@ RHEL Family OS 9
- python-def
- libselinux-python
If you are using the option to create your own bootloader hash the ansible controller
- passlib
---
## Auditing 🔍

View file

@ -1,5 +1,6 @@
---
# defaults file for rhel9-cis
# defaults file for RHEL9-CIS
# WARNING:
# These values may be overridden by other vars-setting options(e.g. like the below 'container_vars_file'), as explained here:
# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
@ -63,7 +64,7 @@ benchmark: RHEL9-CIS
# System will reboot if false, can give better audit results
skip_reboot: true
# default value will change to true but wont reboot if not enabled but will error
# default value will change to true but won't reboot if not enabled but will error
change_requires_reboot: false
###
@ -93,17 +94,11 @@ audit_max_concurrent: 50
## Only run Audit do not remediate
audit_only: false
### As part of audit_only ###
# Path to copy the files to will create dir structure in audit_only mode
audit_capture_files_dir: /some/location to copy to on control node
#############################
## How to retrieve audit binary(Goss)
# Options are 'copy' or 'download' - detailed settings at the bottom of this file
# - if 'copy':
# - the filepath mentioned via the below 'audit_bin_copy_location' var will be used to access already downloaded Goss
# - if 'download':
# - the GitHub Goss-releases URL will be used for a fresh-download, via 'audit_bin_url' and 'audit_pkg_arch_name' vars
# How to retrieve audit binary
# Options are copy or download - detailed settings at the bottom of this file
# you will need access to either github or the file already downloaded
get_audit_binary_method: download
## if get_audit_binary_method - copy the following needs to be updated for your environment
@ -257,9 +252,8 @@ rhel9cis_rule_1_8_8: true
rhel9cis_rule_1_8_9: true
rhel9cis_rule_1_8_10: true
## Section 2 Fixes
# Section 2 rules are controlling Services (Special Purpose Services, and service clients)
# Configure Server Services
## Configure Server Services
rhel9cis_rule_2_1_1: true
rhel9cis_rule_2_1_2: true
rhel9cis_rule_2_1_3: true
@ -400,7 +394,6 @@ rhel9cis_rule_5_3_3_2_4: true
rhel9cis_rule_5_3_3_2_5: true
rhel9cis_rule_5_3_3_2_6: true
rhel9cis_rule_5_3_3_2_7: true
rhel9cis_rule_5_3_3_2_8: true
# 5.3.3.3 Configure pam_pwhistory module
# These are added as part of 5.3.2.4 using jinja2 template
rhel9cis_rule_5_3_3_3_1: true
@ -539,7 +532,7 @@ rhel9cis_rule_7_2_9: true
## Ability to enable debug on mounts to assist in troubleshooting
# Mount point changes are set based upon facts created in Prelim
# these then build the variable and options that is passed to the handler to set the mount point for the controls in section1.
# these then build the variable and options that are passed to the handler to set the mount point for the controls in section1.
rhel9cis_debug_mount_data: false
## Control 1.1.2
@ -583,14 +576,33 @@ rhel9cis_selinux_pol: targeted
rhel9cis_selinux_enforce: enforcing
## Control 1.4.1
# This variable will store the hashed GRUB bootloader password to be stored in '/boot/grub2/user.cfg' file. The default value
# must be changed to a value that may be generated with this command 'grub2-mkpasswd-pbkdf2' and must comply with
# this format: 'grub.pbkdf2.sha512.<Rounds>.<Salt>.<Checksum>'
# This variable governs whether a bootloader password should be set in '/boot/grub2/user.cfg' file.
rhel9cis_set_boot_pass: false
################### bootloader password ############################################################
#
# Two options for setting the bootloader password
#
# Option 1: Set the bootloader password and salt requires the passlib Python module
# to be available on the Ansible controller.
# Set this value to something secure to have predictable hashes,
# which will prevent unnecessary changes.
rhel9cis_bootloader_salt: ''
# This variable stores the GRUB bootloader password to be written
# to the '/boot/grub2/user.cfg' file. The default value must be changed.
rhel9cis_bootloader_password: 'password' # pragma: allowlist secret
# Option 2: Set the bootloader password hash if the salt value is empty,
# the password will be set using the variable below.
# If you are not using the bootloader hash filter, you can set it here
# in encrypted format, e.g. grub.pbkdf2.sha512.hashstring
rhel9cis_bootloader_password_hash: 'grub.pbkdf2.sha512.changethispassword' # pragma: allowlist secret
## Control 1.4.1
# This variable governs whether a bootloader password should be set in '/boot/grub2/user.cfg' file.
rhel9cis_set_boot_pass: true
######################################################################################################
## Controls 1.6.x and Controls 5.1.x
# This variable governs if current Ansible role should manage system-wide crypto policy.
@ -602,14 +614,7 @@ rhel9cis_crypto_policy_ansiblemanaged: true
# -'FUTURE': conservative security level that is believed to withstand any near-term future attacks
# -'FIPS': A level that conforms to the FIPS140-2 requirements
rhel9cis_crypto_policy: 'DEFAULT'
# This variable contains the value of the crypto policy module(combinations of policies and
# sub-policies) to be allowed as default setting. Allowed options are defined in 'vars/main.yml' file,
# using 'rhel9cis_allowed_crypto_policies_modules' variable, which currently are:
# - 'OSPP'
# - 'AD-SUPPORT'
# - 'AD-SUPPORT-LEGACY'
rhel9cis_crypto_policy_module: ''
## Controls 1.6.x
## Control 1.6
# This variable contains the value of the crypto policy module(combinations of policies and
# sub-policies) to be allowed as default setting. Allowed options are defined in 'vars/main.yml' file,
# using those listed in the 'rhel9cis_allowed_crypto_policies_modules' variable.
@ -619,7 +624,7 @@ rhel9cis_additional_crypto_policy_module: ''
# - 1.7.1 - Ensure message of the day is configured properly
# - 1.7.2 - Ensure local login warning banner is configured properly
# - 1.7.3 - Ensure remote login warning banner is configured properly
# This variable stores the content for the Warning Banner(relevant for issue, issue.net, motd).
# This variable stores the content for the Warning Banner(relevant for issue, issue.net, motd).
rhel9cis_warning_banner: Authorized users only. All activity may be monitored and reported.
# End Banner
@ -802,6 +807,8 @@ rhel9cis_tftp_client: false
## Control 3.1.1 - Ensure IPv6 status is identified
# This variable governs whether ipv6 is enabled or disabled.
rhel9cis_ipv6_required: true
# rhel9cis_ipv6_disable defines the method of disabling IPv6, sysctl vs kernel
rhel9cis_ipv6_disable_method: "sysctl"
## Control 3.1.2 - Ensure wireless interfaces are disabled
# if wireless adapter found allow network manager to be installed
@ -907,8 +914,8 @@ rhel9cis_sshd_clientalivecountmax: 3
# keep the connection alive and prevent it being terminated due to inactivity.
rhel9cis_sshd_clientaliveinterval: 15
## Control 5.1.10 - Ensure sshd DisableForwarding is enabled
# By Default this will also disablex11 forwarding
## Control 5.1.12 - disable forwarding
# By Default this will also disable X11 forwarding
# set 'yes' if x11 is required this can be changed to run in /etc/ssh/ssh_config.d/50-redhat.conf
# This variable's value is used in the `/etc/ssh/ssh_config.d/50-redhat.conf` file to
# disable X11Forwarding. If X11 is required, set this variable's value to `yes`!
@ -952,14 +959,7 @@ rhel9cis_ssh_maxsessions: 4
# This variable defines the path and file name of the sudo log file.
rhel9cis_sudolog_location: "/var/log/sudo.log"
## Control 5.2.4 - Ensure users must provide password for escalation
# The following variable specifies a list of users that should not be required to provide a password
# for escalation. Feel free to edit it according to your needs.
rhel9cis_sudoers_exclude_nopasswd_list:
- ec2-user
- vagrant
## Control 5.2.6 - Ensure sudo authentication timeout is configured correctly
## Control 5.2.x - Ensure sudo authentication timeout is configured correctly
# This variable sets the duration (in minutes) during which a user's authentication credentials
# are cached after successfully authenticating using "sudo". This allows the user to execute
# multiple commands with elevated privileges without needing to re-enter their password for each
@ -999,19 +999,38 @@ rhel9cis_authselect_default_profile_to_copy: "sssd --symlink-meta"
## Control 5.3.3.1.1 -
# This variable sets the amount of tries a password can be entered, before a user is locked.
rhel9cis_pam_faillock_deny: 5
## Control 5.3.3.2, 5.3.2.2
# - 5.3.3.1.2
# This variable sets the amount of time a user will be unlocked after the max amount of
# password failures.
rhel9cis_pam_faillock_unlock_time: 900
## Control 5.3.3.1.3 - Ensure password failed attempts lockout includes root account
# This variable is used in the task that ensures that even the root account
# is included in the password failed attempts lockout measure.
# The following variable is used in the 'regexp' field. This field is used to find the
# line in the file. If the line matches the regular expression, it will be replaced
# with the line parameter's value.
#####################################################################################################################
# 5.3.3.1.3 | Ensure pam_faillock is configured - root account lockout behavior
#
# Controls how root is handled when the failed login threshold is reached.
#################### Two mutually exclusive options #################################################################
#
# -> even_deny_root : Lock root just like any other account
# -> root_unlock_time = <n> : Lock root but auto-unlock after <n> seconds
#
# Note: The default value is set to 'even_deny_root' to align with the CIS Benchmark recommendation of locking root
# identically to regular users when the failed login threshold is reached. If you prefer to have root auto-unlock
# after a specified time, set 'rhel9cis_pamroot_lock_option' to "root_unlock_time = {{ rhel9cis_root_unlock_time }}"
# and adjust 'rhel9cis_root_unlock_time' as needed.
#
# Set ONE of the following:
#
# Option 1: root is locked identically to regular users when the failed login threshold is reached
rhel9cis_pamroot_lock_option: even_deny_root
# Option 2: root is locked but auto-unlocks after the specified seconds.
# Seconds before root is automatically unlocked (only used when rhel9cis_pamroot_lock_option includes root_unlock_time)
rhel9cis_root_unlock_time: 60
# rhel9cis_pamroot_lock_option: "root_unlock_time = {{ rhel9cis_root_unlock_time }}"
#
########################################################################################################################
## Control 5.3.3.2.1 - Ensure password number of changed characters is configured
# This variable holds the path to the configuration file that will be created (or overwritten if already existing)
# in order to implement the 'Ensure password number of changed characters is configured' control.
@ -1084,14 +1103,9 @@ rhel9cis_passwd_dictcheck_file: etc/security/pwquality.conf.d/50-pwdictcheck.con
# When set to '0', dictionary checks are disabled. CIS states that it shall always be set to '1'.
rhel9cis_passwd_dictcheck_value: 1
# This variable is used in one of the config files to ensure password quality checking is enforced
# 5.3.3.2.7 - Ensure password quality is enforced for the root user
rhel9cis_passwd_quality_enforce_file: etc/security/pwquality.conf.d/50-pwquality_enforce.conf # pragma: allowlist secret
rhel9cis_passwd_quality_enforce_value: 1
## Control 5.3.3.2.7 - Ensure password quality is enforced for the root user
# This variable holds the path to the configuration file that will be created (or overwritten if already existing)
# in order to implement the 'Ensure password quality is enforced for the root user' control.
rhel9cis_passwd_quality_enforce_root_file: etc/security/pwquality.conf.d/50-pwroot.conf # pragma: allowlist secret
# The following variable enforces that the root user must adhere to the same password quality policies as other users.
rhel9cis_passwd_quality_enforce_root_value: enforce_for_root # pragma: allowlist secret
## Control 5.3.3.3.1 - Ensure password history remember is configured
@ -1131,21 +1145,21 @@ rhel9cis_inactivelock:
# CIS requires a value of 30 days or less.
lock_days: 30
## Control 5.4.1.6 - Ensure all users last password change date is in the past
## Control 5.4.1.x - Ensure all users last password change date is in the past
# Allow ansible to expire password for account with a last changed date in the future. Setting it
# to 'false' will just display users in violation, while 'true' will expire those users passwords.
rhel9cis_futurepwchgdate_autofix: true
## Control 5.4.2.6 - Ensure root user umask is configured
# The following variable specifies the "umask" to configure for the root user.
# The user file-creation mode mask ( umask ) is used to determine the file
# permission for newly created directories and files. In Linux, the default
# permissions for any newly created directory is 0777 ( rwxrwxrwx ), and for
# any newly created file it is 0666 ( rw-rw-rw- ). The umask modifies the default
# Linux permissions by restricting (masking) these permissions. The umask is not
# simply subtracted, but is processed bitwise. Bits set in the umask are cleared
# in the resulting file mode. CIS recommends setting 'umask' to '0027' or more
# restrictive.
# 5.4.2.x
## 5.4.2.5 Root user used
# Root by default is not used unless setup by user
# The role will only run certain commands if set to true
# This allows the ability to skip tasks that may cause an issue
# With the understanding root has full access
rhel9cis_uses_root: false
## 5.4.2.6 - Ensure root home directory permissions are 750 or more restrictive
rhel9cis_root_umask: '0027' # 0027 or more restrictive
## Control 5.4.2.7 - Ensure system accounts are secured | Set nologin
@ -1162,7 +1176,7 @@ rhel9cis_shell_session_timeout: 900
# This variable specifies the path of the timeout setting file.
# (TMOUT setting can be set in multiple files, but only one is required for the
# rule to pass. Options are:
# - a file in `/etc/profile.d/` ending in `.s`,
# - a file in `/etc/profile.d/` ending in `.sh`,
# - `/etc/profile`, or
# - `/etc/bash.bashrc`.
rhel9cis_shell_session_file: /etc/profile.d/tmout.sh
@ -1190,9 +1204,8 @@ rhel9cis_aide_db_file_age: 1w
# If AIDE is already setup this variable forces a new database
# file to be created.
rhel9cis_aide_db_recreate: false
# This variable is used to check if there is already an existing database file
# created by AIDE on the target system. If it is not present, the role will generate
# a database file with the same name as the value of this variable.
# allows changing the db file; note the config needs to be adjusted too
rhel9cis_aide_db_file: /var/lib/aide/aide.db.gz
## Control 6.1.2 - Ensure filesystem integrity is regularly checked
@ -1222,12 +1235,12 @@ rhel9cis_aide_cron:
# This variable governs the day of the month when the AIDE cronjob is run.
# `*` signifies that the job is run on all days; furthermore, specific days
# can be given in the range `1-31`; several days can be concatenated with a comma.
# The specified day(s) can must be in the range `1-31`.
# The specified day(s) must be in the range `1-31`.
aide_day: '*'
# This variable governs months when the AIDE cronjob is run.
# `*` signifies that the job is run in every month; furthermore, specific months
# can be given in the range `1-12`; several months can be concatenated with commas.
# The specified month(s) can must be in the range `1-12`.
# The specified month(s) must be in the range `1-12`.
aide_month: '*'
# This variable governs the weekdays, when the AIDE cronjob is run.
# `*` signifies that the job is run on all weekdays; furthermore, specific weekdays
@ -1267,7 +1280,7 @@ rhel9cis_journald_runtimekeepfree: 100G
# Current variable governs the settings for log retention(how long the log files will be kept).
# Thus, it specifies the maximum time to store entries in a single journal
# file before rotating to the next one. Set to 0 to turn off this feature.
# The given values is interpreted as seconds, unless suffixed with the units
# The given value is interpreted as seconds, unless suffixed with the units
# `year`, `month`, `week`, `day`, `h` or `m` to override the default time unit of seconds.
# Values are Xm, Xh, Xday, Xweek, Xmonth, Xyear, for example 2week is two weeks
# ATTENTION: Uncomment the keyword below when values are set!

View file

@ -0,0 +1,73 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2025, Jeffrey van Pelt <jeff@vanpelt.one>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations
DOCUMENTATION = r"""
name: grub_hash
short_description: Generate a GRUB2 password hash
version_added: 1.0.0
author: Jeffrey van Pelt (@Thulium-Drake)
description:
- Generate a GRUB2 password hash from the input
options:
_input:
description: The desired password for the GRUB bootloader
type: string
required: true
salt:
description: The salt used to generate the hash
type: string
required: false
rounds:
description: The amount of rounds to run the PBKDF2 function
type: int
required: false
"""
EXAMPLES = r"""
- name: 'Generate hash with defaults'
ansible.builtin.debug:
msg: "{{ 'mango123!' | grub_hash }}"
- name: 'Generate hash with custom rounds and salt'
ansible.builtin.debug:
msg: "{{ 'mango123!' | grub_hash(rounds=10001, salt='andpepper') }}"
# Produces: grub.pbkdf2.sha512.10001.616E64706570706572.4C6AEA2A811B4059D4F47AEA36B77DB185B41E9F08ECC3C4C694427DB876C21B24E6CBA0319053E4F1431CDEE83076398C73B9AA8F50A7355E446229BC69A97C
"""
RETURN = r"""
_value:
description: A GRUB2 password hash
type: string
"""
from ansible.errors import AnsibleFilterError
import os
import base64
from passlib.hash import grub_pbkdf2_sha512
def grub_hash(password, rounds=10000, salt=None):
if salt is None:
# Generate 64-byte salt if not provided
salt = os.urandom(64)
# Check if the salt, when not generated, is a valid bytes value and attempt to convert if needed
if not isinstance(salt, bytes):
try:
salt = salt.encode("utf-8")
except AttributeError:
raise TypeError("Salt must be a string, not int.")
# Configure hash generator
pbkdf2_generator = grub_pbkdf2_sha512.using(rounds=rounds, salt=salt)
return pbkdf2_generator.hash(password)
class FilterModule(object):
def filters(self):
return {
'grub_hash': grub_hash
}

View file

@ -11,6 +11,7 @@
state: present
fstype: "{{ prelim_mount_point_fs_and_options[mount_point]['fs_type'] }}"
opts: "{{ prelim_mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"
become: true
listen: "Remount /tmp"
- name: "Remounting /tmp"
@ -19,6 +20,7 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
become: true
listen: "Remount /tmp"
- name: "Remounting /tmp systemd"
@ -28,6 +30,7 @@
name: tmp.mount
state: restarted
daemon_reload: true
become: true
listen: "Remount /tmp"
- name: "Adding options for /dev/shm"
@ -39,6 +42,7 @@
state: present
fstype: "{{ prelim_mount_point_fs_and_options[mount_point]['fs_type'] }}"
opts: "{{ prelim_mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"
become: true
listen: "Remount /dev/shm"
- name: "Remounting /dev/shm"
@ -47,6 +51,7 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
become: true
listen: "Remount /dev/shm"
- name: "Adding options for /home"
@ -58,6 +63,7 @@
state: present
fstype: "{{ prelim_mount_point_fs_and_options[mount_point]['fs_type'] }}"
opts: "{{ prelim_mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"
become: true
listen: "Remount /home"
- name: "Remounting /home"
@ -66,6 +72,7 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
become: true
listen: "Remount /home"
- name: "Adding options for /var"
@ -77,6 +84,7 @@
state: present
fstype: "{{ prelim_mount_point_fs_and_options[mount_point]['fs_type'] }}"
opts: "{{ prelim_mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"
become: true
listen: "Remount /var"
- name: "Remounting /var"
@ -85,6 +93,7 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
become: true
listen: "Remount /var"
- name: "Adding options for /var/tmp"
@ -96,6 +105,7 @@
state: present
fstype: "{{ prelim_mount_point_fs_and_options[mount_point]['fs_type'] }}"
opts: "{{ prelim_mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"
become: true
listen: "Remount /var/tmp"
- name: "Remounting /var/tmp"
@ -104,6 +114,7 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
become: true
listen: "Remount /var/tmp"
- name: "Adding options for /var/log"
@ -115,6 +126,7 @@
state: present
fstype: "{{ prelim_mount_point_fs_and_options[mount_point]['fs_type'] }}"
opts: "{{ prelim_mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"
become: true
listen: "Remount /var/log"
- name: "Remounting /var/log"
@ -123,6 +135,7 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
become: true
listen: "Remount /var/log"
- name: "Adding options for /var/log/audit"
@ -134,6 +147,7 @@
state: present
fstype: "{{ prelim_mount_point_fs_and_options[mount_point]['fs_type'] }}"
opts: "{{ prelim_mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"
become: true
listen: "Remount /var/log/audit"
- name: "Remounting /var/log/audit"
@ -142,6 +156,7 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
become: true
listen: "Remount /var/log/audit"
- name: "Remounting /boot/efi"
@ -150,7 +165,8 @@
ansible.posix.mount:
path: "{{ mount_point }}"
state: remounted
notify: Change_requires_reboot
notify: Set reboot required
become: true
listen: "Remount /boot/efi"
- name: Reload sysctl
@ -194,7 +210,7 @@
ansible.builtin.command: update-crypto-policies --set "{{ rhel9cis_full_crypto_policy }}"
changed_when: true
notify:
- Change_requires_reboot
- Set reboot required
- Restart sshd
- name: Restart firewalld
@ -255,19 +271,21 @@
when: discovered_auditd_immutable_check.stdout == '1'
ansible.builtin.debug:
msg: "Reboot required for auditd to apply new rules as immutable set"
notify: Change_requires_reboot
notify: Set reboot required
- name: Stop auditd process
ansible.builtin.command: systemctl kill auditd
changed_when: true
become: true
listen: Restart auditd
- name: Start auditd process
ansible.builtin.systemd:
name: auditd
state: started
become: true
listen: Restart auditd
- name: Change_requires_reboot
- name: Set reboot required
ansible.builtin.set_fact:
change_requires_reboot: true

View file

@ -1,11 +1,11 @@
---
galaxy_info:
author: "MindPoint Group"
author: "Ansible-Lockdown"
description: "Apply the RHEL 9 CIS"
company: "MindPoint Group"
company: "MindPoint Group - A Tyto Athene Company"
license: MIT
role_name: rhel9_cis
namespace: mindpointgroup
namespace: ansible-lockdown
min_ansible_version: 2.10.1
platforms:
- name: EL

View file

@ -10,7 +10,6 @@
system_is_container: true
rhel9cis_selinux_disable: true
rhel9cis_rule_5_2_4: false
rhel9cis_rule_1_1_10: false
rhel9cis_firewall: "none"
rhel9cis_rule_4_1_1_1: false
rhel9cis_rule_4_1_1_2: false

View file

@ -8,16 +8,15 @@
vars:
ansible_user: "{{ lookup('env', 'USER') }}"
system_is_container: true
rhel8cis_selinux_disable: true
rhel9cis_selinux_disable: true
role_name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
rhel8cis_rule_5_3_4: false
rhel8cis_rule_1_1_10: false
rhel8cis_rsyslog_ansiblemanaged: false
rhel8cis_rule_3_4_1_3: false
rhel8cis_rule_3_4_1_4: false
rhel8cis_rule_4_2_1_2: false
rhel8cis_rule_4_2_1_4: false
rhel8cis_rule_5_1_1: false
rhel9cis_rule_5_3_4: false
rhel9cis_rsyslog_ansiblemanaged: false
rhel9cis_rule_3_4_1_3: false
rhel9cis_rule_3_4_1_4: false
rhel9cis_rule_4_2_1_2: false
rhel9cis_rule_4_2_1_4: false
rhel9cis_rule_5_1_1: false
pre_tasks:
tasks:

View file

@ -1,7 +1,7 @@
---
- name: Apply ansible-lockdown hardening
hosts: all
hosts: "{{ hosts | default('all') }}"
become: true
roles:
- role: "{{ playbook_dir }}"

View file

@ -1,4 +1,5 @@
---
- name: Pre Audit Setup | Set audit package name
block:
- name: Pre Audit Setup | Set audit package name | 64bit

View file

@ -11,18 +11,16 @@
that: (ansible_facts.distribution != 'CentOS' and ansible_facts.os_family == 'RedHat' or ansible_facts.os_family == "Rocky") and ansible_facts.distribution_major_version is version_compare('9', '==')
fail_msg: "This role can only be run against Supported OSs. {{ ansible_facts.distribution }} {{ ansible_facts.distribution_major_version }} is not supported."
success_msg: "This role is running against a supported OS {{ ansible_facts.distribution }} {{ ansible_facts.distribution_major_version }}"
- name: "Check ansible version"
tags: always
ansible.builtin.assert:
that: ansible_version.full is version_compare(min_ansible_version, '>=')
fail_msg: "You must use Ansible {{ min_ansible_version }} or greater"
success_msg: "This role is running a supported version of ansible {{ ansible_version.full }} >= {{ min_ansible_version }}"
- name: "Setup rules if container"
when:
- ansible_connection == 'docker' or
ansible_facts.virtualization_type in ["docker", "lxc", "openvz", "podman", "container"]
when: ansible_connection == 'docker' or ansible_facts.virtualization_type in ["docker", "lxc", "openvz", "podman", "container"]
tags:
- container_discovery
- always
@ -30,34 +28,34 @@
- name: "Discover and set container variable if required"
ansible.builtin.set_fact:
system_is_container: true
- name: "Load variable for container"
ansible.builtin.include_vars:
file: "{{ container_vars_file }}"
- name: "Output if discovered is a container"
when: system_is_container
ansible.builtin.debug:
msg: system has been discovered as a container
- name: "Check crypto-policy input"
ansible.builtin.assert:
that: rhel9cis_crypto_policy in rhel9cis_allowed_crypto_policies
fail_msg: "Crypto policy is not a permitted version"
success_msg: "Crypto policy is a permitted version"
- name: "Check rhel9cis_bootloader_password_hash variable has been changed"
- name: "Check rhel9cis_bootloader_password variable has been changed"
when:
- rhel9cis_set_boot_pass
- rhel9cis_rule_1_4_1
tags: always
ansible.builtin.assert:
that: rhel9cis_bootloader_password_hash.find('grub.pbkdf2.sha512') != -1 and rhel9cis_bootloader_password_hash != 'grub.pbkdf2.sha512.changethispassword' # pragma: allowlist secret
msg: "This role will not be able to run single user password commands as rhel9cis_bootloader_password_hash variable has not been set correctly"
that: rhel9cis_bootloader_password_hash != 'grub.pbkdf2.sha512.changethispassword' or (rhel9cis_bootloader_salt != '' and rhel9cis_bootloader_password != 'password') # pragma: allowlist secret
msg: "This role will not be able to run single user password commands as rhel9cis_bootloader_password or rhel9cis_bootloader_password_hash variable has not been set correctly"
- name: "Check crypto-policy module input"
when:
- rhel9cis_rule_1_6_1
- rhel9cis_crypto_policy_ansiblemanaged
- rhel9cis_crypto_policy_module | length > 0
tags:
- rule_1.6.1
@ -67,7 +65,7 @@
that: rhel9cis_additional_crypto_policy_module in rhel9cis_allowed_crypto_policies_modules
fail_msg: "Crypto policy module is not a permitted version"
success_msg: "Crypto policy module is a permitted version"
- name: "Check password set for {{ ansible_env.SUDO_USER }}"
when:
- rhel9cis_rule_5_2_4
@ -85,12 +83,12 @@
failed_when: false
check_mode: false
register: prelim_ansible_user_password_set
- name: "Check for local account {{ ansible_env.SUDO_USER }} | Check for local account" # noqa name[template]
when: prelim_ansible_user_password_set.stdout == "not found"
ansible.builtin.debug:
msg: "No local account found for {{ ansible_env.SUDO_USER }} user. Skipping local account checks."
- name: "Check local account"
when: prelim_ansible_user_password_set.stdout != "not found"
block:
@ -102,15 +100,15 @@
or
(ansible_env.SUDO_USER in rhel9cis_sudoers_exclude_nopasswd_list)
)
fail_msg: "You have {{ sudo_password_rule }} enabled but the user = {{ ansible_env.SUDO_USER }} has no password set or or the user is not included in the exception list for rule 5.2.4 - It can break access"
fail_msg: "You have {{ sudo_password_rule }} enabled but the user = {{ ansible_env.SUDO_USER }} has no password set or the user is not included in the exception list for rule 5.2.4 - It can break access"
success_msg: "You have a password set for the {{ ansible_env.SUDO_USER }} user or the user is included in the exception list for rule 5.2.4"
- name: "Check account is not locked for {{ ansible_env.SUDO_USER }} | Assert local account not locked" # noqa name[template]
ansible.builtin.assert:
that: (not prelim_ansible_user_password_set.stdout.startswith("!")) or (ansible_env.SUDO_USER in rhel9cis_sudoers_exclude_nopasswd_list)
fail_msg: "You have {{ sudo_password_rule }} enabled but the user = {{ ansible_env.SUDO_USER }} is locked - It can break access"
success_msg: "The local account {{ ansible_env.SUDO_USER }} is not locked or included in the exception list for rule 5.2.4"
- name: "Check authselect profile is selected"
when: rhel9cis_allow_authselect_updates
tags: always
@ -119,13 +117,13 @@
ansible.builtin.assert:
that: rhel9cis_authselect_custom_profile_name != 'cis_example_profile'
fail_msg: "You still have the default name for your authselect profile"
- name: "Check authselect profile is selected | Check current profile"
ansible.builtin.command: authselect list
changed_when: false
failed_when: prelim_authselect_current_profile.rc not in [ 0, 1 ]
register: prelim_authselect_current_profile
failed_when: prelim_authselect_profile_list.rc not in [ 0, 1 ]
register: prelim_authselect_profile_list
- name: "Ensure root password is set"
when: rhel9cis_rule_5_4_2_4
tags:
@ -137,88 +135,86 @@
- rule_5.4.2.4
block:
- name: "Ensure root password is set"
ansible.builtin.shell: LC_ALL=C passwd -S root | grep -E "(Password set|Password locked)"
ansible.builtin.shell: LC_ALL=C passwd -S root | grep -E "(Alternate authentication|Password set|Password locked)"
changed_when: false
failed_when: prelim_root_passwd_set.rc not in [ 0, 1 ]
register: prelim_root_passwd_set
- name: "Ensure root password is set"
ansible.builtin.assert:
that: prelim_root_passwd_set.rc == 0
fail_msg: "You have rule 5.4.2.4 enabled this requires that you have a root password set"
success_msg: "You have a root password set"
- name: "Gather the package facts"
tags: always
ansible.builtin.package_facts:
manager: auto
- name: "Include OS specific variables"
tags: always
ansible.builtin.include_vars:
file: "{{ ansible_facts.distribution }}.yml"
- name: "Include preliminary steps"
tags:
- prelim_tasks
- always
tags: prelim_tasks
ansible.builtin.import_tasks:
file: prelim.yml
- name: "Run Section 1 tasks"
when: rhel9cis_section1
ansible.builtin.import_tasks:
file: section_1/main.yml
- name: "Run Section 2 tasks"
when: rhel9cis_section2
ansible.builtin.import_tasks:
file: section_2/main.yml
- name: "Run Section 3 tasks"
when: rhel9cis_section3
ansible.builtin.import_tasks:
file: section_3/main.yml
- name: "Run Section 4 tasks"
when: rhel9cis_section4
ansible.builtin.import_tasks:
file: section_4/main.yml
- name: "Run Section 5 tasks"
when: rhel9cis_section5
ansible.builtin.import_tasks:
file: section_5/main.yml
- name: "Run Section 6 tasks"
when: rhel9cis_section6
ansible.builtin.import_tasks:
file: section_6/main.yml
- name: "Run Section 7 tasks"
when: rhel9cis_section7
ansible.builtin.import_tasks:
file: section_7/main.yml
- name: "Run auditd logic"
when: update_audit_template
tags: always
ansible.builtin.import_tasks:
file: auditd.yml
- name: "Run post remediation tasks"
tags:
- post_tasks
- always
ansible.builtin.import_tasks:
file: post.yml
- name: "Run post_remediation audit"
when: run_audit
tags: always
ansible.builtin.import_tasks:
file: post_remediation_audit.yml
- name: Add ansible file showing Benchmark and levels applied if audit details not present
when:
- create_benchmark_facts
@ -235,7 +231,7 @@
owner: root
group: root
mode: 'u=rwx,go=rx'
- name: Create ansible facts file and levels applied if audit facts not present
ansible.builtin.template:
src: etc/ansible/compliance_facts.j2
@ -243,7 +239,7 @@
owner: root
group: root
mode: 'u-x,go=r'
- name: Fetch audit files
when:
- fetch_audit_output
@ -251,13 +247,13 @@
tags: always
ansible.builtin.import_tasks:
file: fetch_audit_output.yml
- name: "Show Audit Summary"
when: run_audit
tags: always
ansible.builtin.debug:
msg: "{{ audit_results.split('\n') }}"
- name: "If Warnings found Output count and control IDs affected"
when: warn_count != 0
tags: always

View file

@ -28,8 +28,7 @@
- name: POST | reboot system if changes require it and not skipped
when: change_requires_reboot
tags:
- always
tags: always
vars:
warn_control_id: Reboot_required
block:

View file

@ -1,10 +1,12 @@
---
# Preliminary tasks that should always be run
# List users in order to look files inside each home directory
# Preliminary tasks that should always run
# List users in order to look up files inside each home directory
- name: "PRELIM | Include audit specific variables"
when: run_audit or audit_only or setup_audit
when:
- run_audit or audit_only
- setup_audit
tags:
- setup_audit
- run_audit
@ -12,7 +14,8 @@
file: audit.yml
- name: "PRELIM | Include pre-remediation audit tasks"
when: run_audit or audit_only or setup_audit
when:
- run_audit or audit_only
tags: run_audit
ansible.builtin.import_tasks: pre_remediation_audit.yml
@ -92,6 +95,11 @@
- rhel9cis_rule_1_2_1_1
- ansible_facts.distribution != 'RedHat'
- ansible_facts.distribution != 'OracleLinux'
tags:
- level1-server
- level1-workstation
- rule_1.2.1.1
- gpg
ansible.builtin.package:
name: "{{ gpg_key_package }}"
state: latest
@ -206,14 +214,15 @@
block:
- name: "PRELIM | AUDIT | Discover is wireless adapter on system"
ansible.builtin.command: find /sys/class/net/*/ -type d -name wireless
register: discover_wireless_adapters
register: prelim_wireless_adapters
changed_when: false
check_mode: false
failed_when: discover_wireless_adapters.rc not in [ 0, 1 ]
failed_when: prelim_wireless_adapters.rc not in [ 0, 1 ]
- name: "PRELIM | PATCH | Install Network-Manager | if wireless adapter present"
when:
- discover_wireless_adapters.rc == 0
- rhel9cis_install_network_manager
- prelim_wireless_adapters.rc == 0
- "'NetworkManager' not in ansible_facts.packages"
ansible.builtin.package:
name: NetworkManager
@ -277,8 +286,7 @@
- name: "PRELIM | PATCH | Create journald config directory"
when:
- rhel9cis_syslog == 'journald'
- rhel9cis_rule_6_2_1_3 or
rhel9cis_rule_6_2_1_4
- rhel9cis_rule_6_2_1_3 or rhel9cis_rule_6_2_1_4
tags: always
ansible.builtin.file:
path: /etc/systemd/journald.conf.d

View file

@ -27,8 +27,7 @@
mode: 'go-rwx'
- name: "1.1.1.1 | PATCH | Ensure cramfs kernel module is not available | Disable cramfs"
when:
- not system_is_container
when: not system_is_container
community.general.modprobe:
name: cramfs
state: absent

View file

@ -1,4 +1,5 @@
---
- name: "1.1.2.3.1 | PATCH | Ensure /home is a separate partition"
when:
- rhel9cis_rule_1_1_2_3_1

View file

@ -13,4 +13,4 @@
ansible.builtin.package:
name: "*"
state: latest
notify: Change_requires_reboot
notify: Set reboot required

View file

@ -13,7 +13,7 @@
- NIST800-53R5_AC-3
ansible.builtin.copy:
dest: /boot/grub2/user.cfg
content: "GRUB2_PASSWORD={{ rhel9cis_bootloader_password_hash }}" # noqa template-instead-of-copy
content: "GRUB2_PASSWORD={{ rhel9_compiled_bootloader_password }}" # noqa template-instead-of-copy
owner: root
group: root
mode: 'go-rwx'

View file

@ -16,19 +16,35 @@
- rule_3.1.1
- NIST800-53R5_CM-7
block:
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | refresh"
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | Set vars for sysctl template"
when: "'sysctl' in rhel9cis_ipv6_disable_method"
ansible.builtin.set_fact:
rhel9cis_sysctl_update: true
rhel9cis_flush_ipv6_route: true
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | disable"
- name: "3.1.1 | AUDIT | Ensure IPv6 status is identified | Message out implementation info"
when: "'sysctl' in rhel9cis_ipv6_disable_method"
ansible.builtin.debug:
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-disable_ipv6.conf"
- name: "3.1.1 | AUDIT | Ensure IPv6 status is identified | Find IPv6 status"
when: "'kernel' in rhel9cis_ipv6_disable_method"
ansible.builtin.command: grubby --info=ALL
changed_when: false
failed_when: false
register: discovered_rhel9cis_3_1_1_ipv6_status
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | Disable IPV6 via Kernel"
when:
- "'kernel' in rhel9cis_ipv6_disable_method"
- "'ipv6.disable=1' not in discovered_rhel9cis_3_1_1_ipv6_status.stdout"
ansible.builtin.command: grubby --update-kernel=ALL --args="ipv6.disable=1"
changed_when: discovered_rhel9cis_3_1_1_ipv6_status.rc == 0
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled"
when:
- rhel9cis_rule_3_1_2
- discover_wireless_adapters.rc == 0
- prelim_wireless_adapters.rc == 0
tags:
- level1-server
- patch

View file

@ -411,6 +411,8 @@
path: "{{ rhel9cis_sshd_config_file }}"
regexp: '^(#)?MaxAuthTries \d'
line: 'MaxAuthTries {{ rhel9cis_ssh_maxauthtries }}'
insertbefore: "^Match"
firstmatch: true
validate: sshd -t -f %s
notify: Restart sshd
@ -431,6 +433,8 @@
path: "{{ rhel9cis_sshd_config_file }}"
regexp: (?i)^(#|)\s*MaxStartups
line: 'MaxStartups {{ rhel9cis_ssh_maxstartups }}'
insertbefore: "^Match"
firstmatch: true
validate: sshd -t -f %s
notify: Restart sshd

View file

@ -14,7 +14,7 @@
- rule_5.3.2.1
block:
- name: "5.3.2.1 | PATCH | Ensure active authselect profile includes pam modules | Create custom profiles"
when: rhel9cis_authselect_custom_profile_name not in prelim_authselect_current_profile.stdout
when: rhel9cis_authselect_custom_profile_name not in prelim_authselect_profile_list.stdout
ansible.builtin.command: "/usr/bin/authselect create-profile {{ rhel9cis_authselect_custom_profile_name }} -b {{ rhel9cis_authselect_default_profile_to_copy }}"
changed_when: false
args:
@ -93,10 +93,10 @@
loop:
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+preauth"
after: "auth\\s+required\\s+pam_env.so" # yamllint disable-line rule:colons
line: "auth required pam_faillock.so preauth silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
line: "auth required pam_faillock.so preauth silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+authfail"
before: "auth\\s+required\\s+pam_deny.so"
line: "auth required pam_faillock.so authfail silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
line: "auth required pam_faillock.so authfail silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
- regexp: "account\\s+required\\s+pam_faillock.so"
before: "account\\s+required\\s+pam_unix.so"
line: "account required pam_faillock.so" # yamllint disable-line rule:colons
@ -112,10 +112,10 @@
loop:
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+preauth"
after: "auth\\s+required\\s+pam_env.so" # yamllint disable-line rule:colons
line: "auth required pam_faillock.so preauth silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
line: "auth required pam_faillock.so preauth silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
- regexp: "auth\\s+required\\s+pam_faillock.so\\s+authfail"
before: "auth\\s+required\\s+pam_deny.so"
line: "auth required pam_faillock.so authfail silent deny=3 unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
line: "auth required pam_faillock.so authfail silent unlock_timeout={{ rhel9cis_pam_faillock_unlock_time }}" # yamllint disable-line rule:colons
- regexp: "account\\s+required\\s+pam_faillock.so"
before: "account\\s+required\\s+pam_unix.so"
line: "account required pam_faillock.so" # yamllint disable-line rule:colons

View file

@ -340,7 +340,7 @@
- system
notify: Authselect update
- name: "5.3.3.2.7 | PATCH | Ensure password quality is enforced for the root user"
- name: "5.3.3.2.7 | PATCH | Ensure password quality checking is enforced"
when: rhel9cis_rule_5_3_3_2_7
tags:
- level1-server
@ -350,8 +350,8 @@
- NIST800-53R5_IA-5
- pam
ansible.builtin.template:
src: "{{ rhel9cis_passwd_quality_enforce_root_file }}.j2"
dest: "/{{ rhel9cis_passwd_quality_enforce_root_file }}"
src: "{{ rhel9cis_passwd_quality_enforce_file }}.j2"
dest: "/{{ rhel9cis_passwd_quality_enforce_file }}"
owner: root
group: root
mode: 'o-rwx'

View file

@ -179,7 +179,7 @@
- item.stat.exists
- item.stat.isdir
- item.stat.pw_name != 'root' or item.stat.gr_name != 'root' or item.stat.woth or item.stat.wgrp
- (item != 'root') and (not rhel9cis_uses_root)
- (item != 'root') and (not rhel9cis_uses_root )
ansible.builtin.file:
path: "{{ item.stat.path }}"
state: directory

View file

@ -10,14 +10,12 @@
file: cis_5.1.x.yml
- name: "SECTION | 5.2 | Configure privilege escalation"
when:
- rhel9cis_section5_2
when: rhel9cis_section5_2
ansible.builtin.import_tasks:
file: cis_5.2.x.yml
- name: "SECTION | 5.3"
when:
- rhel9cis_section5_3
when: rhel9cis_section5_3
block:
- name: "SECTION | 5.3.1.x | Configure PAM software packages"
ansible.builtin.import_tasks:
@ -44,8 +42,7 @@
file: cis_5.3.3.4.x.yml
- name: "SECTION | 5.4"
when:
- rhel9cis_section5_4
when: rhel9cis_section5_4
block:
- name: "SECTION | 5.4.1.x | Configure shadow password suite parameters"
ansible.builtin.import_tasks:

View file

@ -25,7 +25,7 @@
- name: "6.2.2.2 | PATCH | Ensure journald ForwardToSyslog is disabled | comment out current entries"
ansible.builtin.replace:
path: /etc/systemd/journald.conf
regexp: ^(\s*ForwardToSyslog)
regexp: ^(\s*ForwardToSyslog\s*=.*)
replace: '#\1'
- name: "6.2.2.3 | PATCH | Ensure journald Compress is configured"
@ -50,7 +50,7 @@
- name: "6.2.2.3 | PATCH | Ensure journald Compress is configured | comment out current entries"
ansible.builtin.replace:
path: /etc/systemd/journald.conf
regexp: (?i)(\s*compress=)
regexp: ^(\s*Compress\s*=.*)
replace: '#\1'
- name: "6.2.2.4 | PATCH | Ensure journald Storage is configured"
@ -76,5 +76,5 @@
- name: "6.2.2.4 | PATCH | Ensure journald Storage is configured | comment out current entries"
ansible.builtin.replace:
path: /etc/systemd/journald.conf
regexp: (?i)(\s*storage=)
regexp: ^(\s*Storage\s*=.*)
replace: '#\1'

View file

@ -195,7 +195,7 @@
register: discovered_rsyslog_remote_host
notify: Restart rsyslog
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to recieve logs from a remote client"
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to receive logs from a remote client"
when: rhel9cis_rule_6_2_3_7
tags:
- level1-server
@ -208,7 +208,7 @@
- NIST800-53R5_AU-12
- NIST800-53R5_CM-6
block:
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to recieve logs from a remote client. | When not log host"
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to receive logs from a remote client. | When not log host"
when: not rhel9cis_system_is_log_server
ansible.builtin.replace:
path: /etc/rsyslog.conf
@ -221,7 +221,7 @@
- '^(module\(load="imtcp"\))'
- '^(input\(type="imtcp")'
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to recieve logs from a remote clients. | When log host"
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to receive logs from a remote clients. | When log host"
when: rhel9cis_system_is_log_server
ansible.builtin.replace:
path: /etc/rsyslog.conf

View file

@ -58,7 +58,7 @@
- level1-server
- level1-workstation
- patch
- permissionss
- permissions
- rule_7.1.4
- NIST800-53R5_AC-3
- NIST800-53R5_MP-2
@ -254,7 +254,7 @@
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ rhel9cis_unowned_owner }}"
group: "{{ rhel9cis_unowned_group }}"
group: "{{ rhel9cis_ungrouped_group }}"
with_items:
- "{{ discovered_unowned_files_flatten }}"

View file

@ -1,7 +1,7 @@
---
# Enable logrunning potential resource intensive tests
# Enable long running potential resource intensive tests
run_heavy_tests: {{ audit_run_heavy_tests }}
# Extend default command timeout for longer running tests
@ -206,6 +206,7 @@ rhel9cis_rule_2_4_2_1: {{ rhel9cis_rule_2_4_2_1 }}
rhel9cis_rule_3_1_1: {{ rhel9cis_rule_3_1_1 }}
rhel9cis_rule_3_1_2: {{ rhel9cis_rule_3_1_2 }}
rhel9cis_rule_3_1_3: {{ rhel9cis_rule_3_1_3 }}
## Network Kernel Modules
rhel9cis_rule_3_2_1: {{ rhel9cis_rule_3_2_1 }}
rhel9cis_rule_3_2_2: {{ rhel9cis_rule_3_2_2 }}
@ -291,7 +292,6 @@ rhel9cis_rule_5_3_3_2_4: {{ rhel9cis_rule_5_3_3_2_4 }}
rhel9cis_rule_5_3_3_2_5: {{ rhel9cis_rule_5_3_3_2_5 }}
rhel9cis_rule_5_3_3_2_6: {{ rhel9cis_rule_5_3_3_2_6 }}
rhel9cis_rule_5_3_3_2_7: {{ rhel9cis_rule_5_3_3_2_7 }}
rhel9cis_rule_5_3_3_2_8: {{ rhel9cis_rule_5_3_3_2_8 }}
# 5.3.3.3 Configure pam_pwhistory module
# This are added as part of 5.3.2.4 using jinja2 template
rhel9cis_rule_5_3_3_3_1: {{ rhel9cis_rule_5_3_3_3_1 }}
@ -530,6 +530,8 @@ rhel9cis_bluetooth_mask: {{ rhel9cis_bluetooth_mask }}
## 3.1 IPv6 requirement toggle
# This variable governs whether ipv6 is enabled or disabled.
rhel9cis_ipv6_required: {{ rhel9cis_ipv6_required }}
# rhel9cis_ipv6_disable defines the method of disabling IPv6, sysctl vs kernel
rhel9cis_ipv6_disable_method: {{ rhel9cis_ipv6_disable_method }}
# 3.3 System network parameters (host only OR host and router)
# This variable governs whether specific CIS rules

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
### YOUR CHANGES WILL BE LOST!
# This file contains users whose actions are not logged by auditd

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
### YOUR CHANGES WILL BE LOST!
# This template will set all of the auditd configurations via a handler in the role in one task instead of individually

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# Audit Tools
/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512
/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512

View file

@ -1,6 +1,4 @@
# CIS Hardening Carried out
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
[lockdown_details]
# Benchmark release

View file

@ -1,4 +1,4 @@
{{ ansible_managed | comment }}
{{ file_managed_by_ansible }}
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
@ -11,17 +11,19 @@ driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
makestep {{ rhel9cis_chrony_server_makestep }}
{% if rhel9cis_chrony_server_rtcsync %}
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
{% endif %}
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
minsources {{ rhel9cis_chrony_server_minsources }}
# Allow NTP client access from local network.
#allow 192.168.0.0/16

View file

@ -1,7 +1,5 @@
{{ file_managed_by_ansible }}
# Run AIDE integrity check
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
### YOUR CHANGES WILL BE LOST!
# CIS 1.3.2

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# This is a subpolicy dropping the SHA1 hash and signature support
# Carried out as part of CIS Benchmark rule 1.6.3

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# This is a subpolicy to disable all CBC mode ciphers
# for the SSH protocol (libssh and OpenSSH)
# Carried out as part of CIS Benchmark rule 1.6.5

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# This is a subpolicy to disable Encrypt then MAC
# for the SSH protocol (libssh and OpenSSH)
# Carried out as part of CIS Benchmark rule 1.6.7

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# This is a subpolicy to disable weak ciphers
# for the SSH protocol (libssh and OpenSSH)
# Carried out as part of CIS Benchmark rules combined 1.6.6 and 5.1.4

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# This is a subpolicy to disable weak macs
# Carried out as part of CIS Benchmark control 5.1.6

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# This is a subpolicy to disable weak macs
# Carried out as part of CIS Benchmark rule 1.6.4

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
# Lock desktop media-handling automount setting
/org/gnome/desktop/media-handling/automount

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
# Lock desktop media-handling settings
/org/gnome/desktop/media-handling/autorun-never

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
[org/gnome/desktop/media-handling]
automount=false

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
[org/gnome/desktop/media-handling]
autorun-never=true

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
# Specify the dconf path
[org/gnome/desktop/session]

View file

@ -1,6 +1,4 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
# Lock desktop screensaver idle-delay setting
/org/gnome/desktop/session/idle-delay

View file

@ -1,7 +1,5 @@
## Ansible controlled file
# Added as part of ansible-lockdown CIS baseline
# provided by Mindpoint Group - A Tyto Athene Company
{{ file_managed_by_ansible }}
[org/gnome/login-screen]
banner-message-enable=true
banner-message-text="{{ rhel9cis_warning_banner }}"
banner-message-text="{{ rhel9cis_warning_banner | trim | replace("\n", "\\n") }}"

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
/var/log/rsyslog/*.log {
{{ rhel9cis_rsyslog_logrotate_rotated_when }}
rotate {{ rhel9cis_rsyslog_logrotate_rotatation_keep }}

View file

@ -1,6 +1,4 @@
# Disable usage of protocol {{ item }}
# Set by ansible {{ benchmark }} remediation role
# https://github.com/ansible-lockdown
## This file is managed by Ansible, YOUR CHANGES WILL BE LOST!
{{ file_managed_by_ansible }}
## YOUR CHANGES WILL BE LOST!
install {{ item }} /bin/true

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.3 Ensure password complexity is configured
{% if rhel9cis_passwd_complex_option == 'minclass' %} # pragma: allowlist secret

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.6 Ensure password dictionary check is enabled
dictcheck = {{ rhel9cis_passwd_dictcheck_value }}

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.1 Ensure password number of changed characters is configured
difok = {{ rhel9cis_passwd_difok_value }}

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.2 Ensure minimum password length is configured
minlen = {{ rhel9cis_passwd_minlen_value }}

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.5 Ensure password maximum sequential characters is configured
maxsequence = {{ rhel9cis_passwd_maxsequence_value }}

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.7 Ensure password quality checking is enforced
enforcing = {{ rhel9cis_passwd_quality_enforce_value }}

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.4 Ensure password same consecutive characters is configured
maxrepeat = {{ rhel9cis_passwd_maxrepeat_value }}

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# CIS Configurations
# 5.3.3.2.8 Ensure password quality is enforced for the root user
# 5.3.3.2.7 Ensure password quality is enforced for the root user
{{ rhel9cis_passwd_quality_enforce_root_value }}

View file

@ -1,7 +1,11 @@
## This file is managed by Ansible, YOUR CHANGES WILL BE LOST!
{{ file_managed_by_ansible }}
## YOUR CHANGES WILL BE LOST!
# IPv6 disable
{% if rhel9cis_rule_3_1_1 and not rhel9cis_ipv6_required %}
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
{% for interface in ansible_interfaces %}
net.ipv6.conf.{{ interface }}.disable_ipv6 = 1
{% endfor %}
{% endif %}

View file

@ -1,4 +1,5 @@
## This file is managed by Ansible, YOUR CHANGES WILL BE LOST!
{{ file_managed_by_ansible }}
## YOUR CHANGES WILL BE LOST!
{% if rhel9cis_rule_1_5_1 %}
# Adress space randomise

View file

@ -1,4 +1,5 @@
## This file is managed by Ansible, YOUR CHANGES WILL BE LOST!
{{ file_managed_by_ansible }}
## YOUR CHANGES WILL BE LOST!
# IPv4 Network sysctl
{% if rhel9cis_rule_3_3_1 %}

View file

@ -1,4 +1,5 @@
## This file is managed by Ansible, YOUR CHANGES WILL BE LOST!
{{ file_managed_by_ansible }}
## YOUR CHANGES WILL BE LOST!
# IPv6 Network sysctl
{% if rhel9cis_ipv6_required %}

View file

@ -1,4 +1,4 @@
# File created for CIS benchmark
{{ file_managed_by_ansible }}
# CIS rule 6_2_2_2
[Journal]
ForwardToSyslog=no

View file

@ -1,4 +1,4 @@
# File created for CIS benchmark
{{ file_managed_by_ansible }}
# CIS rule 6_2_1_3
[Journal]
SystemMaxUse={{ rhel9cis_journald_systemmaxuse }}

View file

@ -1,4 +1,4 @@
# File created for CIS benchmark
{{ file_managed_by_ansible }}
[Journal]
{% if rhel9cis_rule_6_2_2_3 %}
# Set compress CIS rule 6_2_2_3

View file

@ -1,3 +1,4 @@
{{ file_managed_by_ansible }}
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
@ -7,7 +8,7 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
## This file is managed by Ansible, YOUR CHANGED WILL BE LOST!
## YOUR CHANGED WILL BE LOST!
[Unit]
Description=Temporary Directory (/tmp)

View file

@ -1,4 +1,5 @@
---
# OS Specific Settings
os_gpg_key_pubkey_name: gpg-pubkey-8d8b756f-629e59ec
os_gpg_key_pubkey_content: "Oracle Linux (release key 1) <secalert_us@oracle.com>"

View file

@ -2,7 +2,7 @@
# File to skip controls if container
# Based on standard image no changes
# it expected all pkgs required for the container are alreday installed
# it expected all pkgs required for the container are already installed
## controls
@ -57,7 +57,6 @@ rhel9cis_rule_1_1_6: false
rhel9cis_rule_1_1_7: false
rhel9cis_rule_1_1_8: false
rhel9cis_rule_1_1_9: false
rhel9cis_rule_1_1_10: false
# /var/log
rhel9cis_rule_1_1_11: false
# /var/log/audit

View file

@ -24,6 +24,8 @@ rhel9cis_allowed_crypto_policies_modules:
- 'NO-SSHWEAKMAC'
- 'NO-WEAKMAC'
rhel9_compiled_bootloader_password: "{% if rhel9cis_bootloader_salt != '' %}{{ (rhel9cis_bootloader_password | grub_hash(salt=rhel9cis_bootloader_salt)) }}{% else %}{{ rhel9cis_bootloader_password_hash }}{% endif %}" # noqa template-instead-of-copy
# Used to control warning summary
warn_control_list: ""
warn_count: 0
@ -39,7 +41,7 @@ gpg_key_package: "{{ ansible_facts.distribution | lower }}-gpg-keys"
## Controls 6.3.3.x - Audit template
# This variable is set to true by tasks 6.3.3.1 to 6.3.3.20. As a result, the
# audit settings are overwritten with the role's template. In order to exclude
# specific rules, you must set the variable of form `ubtu24cis_rule_6_3_3_x` above
# specific rules, you must set the variable of form `rhel9cis_rule_6_3_3_x` above
# to `false`.
update_audit_template: false
@ -50,7 +52,7 @@ update_audit_template: false
# system_is_container the true. Otherwise, the default value
# 'false' is left unchanged.
system_is_container: false
# The filename of the existing yml file in role's 'vars/' sub-directory
# The filename of the existing yml file in role's 'vars/' sub-directory
# to be used for managing the role-behavior when a container was detected:
# (de)activating rules or for other tasks(e.g. disabling Selinux or a specific
# firewall-type).
@ -74,3 +76,10 @@ audit_bins:
- /sbin/autrace
- /sbin/auditd
- /sbin/augenrules
company_title: 'MindPoint Group - A Tyto Athene Company'
file_managed_by_ansible: |-
# File managed by ansible as part of {{ benchmark }} benchmark
# As part of Ansible-lockdown
# Provided by {{ company_title }}