Skip to content

Commit ddd505f

Browse files
authored
Merge pull request #71 from ansible-lockdown/March26_align
March26 align
2 parents 6c332f1 + a40f4c4 commit ddd505f

77 files changed

Lines changed: 5420 additions & 5312 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ansible-lint

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22

3-
parseable: true
43
quiet: true
54
skip_list:
6-
- 'package-latest'
7-
- 'risky-shell-pipe'
5+
- 'package-latest'
6+
- 'risky-shell-pipe'
87
use_default_rules: true
98
verbosity: 0

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ ignore*
1212
# VSCode
1313
.vscode
1414
vagrant
15+
.cursor/
16+
.claude/
17+
*report.md
18+
prompt.md
19+
plan.md
20+
history.md
21+
*recommendations.json
22+
*.pdf
1523

1624
# Byte-compiled / optimized / DLL files
1725
__pycache__/

.pre-commit-config.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@
22
##### CI for use by github no need for action to be added
33
##### Inherited
44
ci:
5-
autofix_prs: false
6-
skip: [detect-aws-credentials, ansible-lint ]
5+
autofix_prs: false
6+
skip: [detect-aws-credentials, ansible-lint ]
77

88
repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
1010
rev: v6.0.0
1111
hooks:
1212
# Safety
1313
- id: detect-aws-credentials
14+
name: Detect AWS Credentials
1415
- id: detect-private-key
16+
name: Detect Private Keys
1517

1618
# git checks
1719
- id: check-merge-conflict
20+
name: Check for merge conflicts
1821
- id: check-added-large-files
22+
name: Check for Large files
1923
- id: check-case-conflict
24+
name: Check case conflict
2025

2126
# General checks
2227
- id: trailing-whitespace
@@ -27,20 +32,23 @@ repos:
2732
types: [text]
2833
args: [--markdown-linebreak-ext=md]
2934
- id: end-of-file-fixer
35+
name: Ensure line at end of file
3036

3137
# Scan for passwords
3238
- repo: https://github.com/Yelp/detect-secrets
3339
rev: v1.5.0
3440
hooks:
3541
- id: detect-secrets
42+
name: Detect Secrets test
3643

3744
- repo: https://github.com/gitleaks/gitleaks
3845
rev: v8.30.0
3946
hooks:
4047
- id: gitleaks
48+
name: Run Gitleaks test
4149

4250
- repo: https://github.com/ansible-community/ansible-lint
43-
rev: v25.12.2
51+
rev: v26.1.1
4452
hooks:
4553
- id: ansible-lint
4654
name: Ansible-lint
@@ -51,14 +59,15 @@ repos:
5159
# https://github.com/ansible/ansible-lint/issues/611
5260
pass_filenames: false
5361
always_run: true
54-
additional_dependencies:
62+
# additional_dependencies:
5563
# https://github.com/pre-commit/pre-commit/issues/1526
5664
# If you want to use specific version of ansible-core or ansible, feel
5765
# free to override `additional_dependencies` in your own hook config
5866
# file.
59-
- ansible-core>=2.10.1
67+
# - ansible-core>=2.10.1
6068

6169
- repo: https://github.com/adrienverge/yamllint.git
62-
rev: v1.37.1 # or higher tag
70+
rev: v1.38.0 # or higher tag
6371
hooks:
6472
- id: yamllint
73+
name: Check YAML Lint

.yamllint

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
extends: default
43
ignore: |
54
tests/
@@ -8,32 +7,32 @@ ignore: |
87
.gitlab-ci.yml
98
*molecule.yml
109
rules:
11-
braces:
12-
max-spaces-inside: 1
13-
level: error
14-
brackets:
15-
max-spaces-inside: 1
16-
level: error
17-
comments:
18-
ignore-shebangs: true
19-
min-spaces-from-content: 1 # prettier compatibility
20-
comments-indentation: false
21-
empty-lines:
22-
max: 1
23-
indentation:
24-
# Requiring 2 space indentation
25-
spaces: 4
26-
# Requiring consistent indentation within a file, either indented or not
27-
indent-sequences: consistent
28-
key-duplicates: enable
29-
line-length: disable
30-
new-line-at-end-of-file: enable
31-
new-lines:
32-
type: unix
33-
octal-values:
34-
forbid-implicit-octal: true # yamllint defaults to false
35-
forbid-explicit-octal: true
36-
trailing-spaces: enable
37-
truthy:
38-
allowed-values: ['true', 'false']
39-
check-keys: true
10+
braces:
11+
max-spaces-inside: 1
12+
level: error
13+
brackets:
14+
max-spaces-inside: 1
15+
level: error
16+
comments:
17+
ignore-shebangs: true
18+
min-spaces-from-content: 1 # prettier compatibility
19+
comments-indentation: disable
20+
empty-lines:
21+
max: 1
22+
indentation:
23+
# Requiring 2 space indentation
24+
spaces: 2
25+
# Requiring consistent indentation within a file, either indented or not
26+
indent-sequences: consistent
27+
key-duplicates: enable
28+
line-length: disable
29+
new-line-at-end-of-file: enable
30+
new-lines:
31+
type: unix
32+
octal-values:
33+
forbid-implicit-octal: true # yamllint defaults to false
34+
forbid-explicit-octal: true
35+
trailing-spaces: enable
36+
truthy:
37+
allowed-values: ['true', 'false']
38+
check-keys: true

CONTRIBUTING.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Contributing to MindPoint Group Projects
1+
Contributing to Ansible-Lockdown Projects
22
========================================
33

44
Rules
@@ -7,19 +7,20 @@ Rules
77
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)
88
3) All work is done in your own branch
99
4) All pull requests go into the devel branch. There are automated checks for signed commits, signoff in commit message, and functional testing)
10-
5) Be open and nice to eachother
10+
5) Be open and nice to each other
1111

1212
Workflow
1313
--------
1414
- Your work is done in your own individual branch. Make sure to to Signed-off and GPG sign all commits you intend to merge
1515
- All community Pull Requests are into the devel branch. There are automated checks for GPG signed, Signed-off in commits, and functional tests before being approved. If your pull request comes in from outside of our repo, the pull request will go into a staging branch. There is info needed from our repo for our CI/CD testing.
1616
- Once your changes are merged and a more detailed review is complete, an authorized member will merge your changes into the main branch for a new release
17+
1718
Signing your contribution
1819
-------------------------
1920

2021
We've chosen to use the Developer's Certificate of Origin (DCO) method
2122
that is employed by the Linux Kernel Project, which provides a simple
22-
way to contribute to MindPoint Group projects.
23+
way to contribute to Ansible-Lockdown projects.
2324

2425
The process is to certify the below DCO 1.1 text
2526
::
@@ -60,7 +61,6 @@ following text in your contribution commit message:
6061

6162
::
6263

63-
6464
This message can be entered manually, or if you have configured git
6565
with the correct `user.name` and `user.email`, you can use the `-s`
6666
option to `git commit` to automatically include the signoff message.

Changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# AMAZON2-CIS Changelog
2+
3+
Benchmark: v3.0.0. March Updates
4+
5+
## Remediation (AMAZON2-CIS)
6+
7+
- **6.1.x:** Paths and titles aligned for 6.1.3–6.1.10; 6.1.12 logic and content improved.
8+
- **Section 2:** 2.1.12 updated for correct package.
9+
- **Section 4:** 4.3.4 logic updated; 4.5.1.x var naming and controls updated (exclude connected user).
10+
- **Section 5:** 5.1.4 improved.
11+
- **Section 3:** Typo fix in 3.4.3.5; audit logic fixes.
12+
- **Titles & tags:** Titles updated; tag/level fixes; spelling/typos fixed.
13+
- **Variables:** Var naming aligned and standardised; vars moved to correct location.
14+
- **Behaviour:** `skip_reboot` set to true; tmp and wifi discovery logic updated.
15+
- **Audit/template:** Template added to auditd steps.
16+
- **Linting:** YAML spacing, layout, and lint alignment; aligned with new standards.
17+
- **Other:** Git ignore updated; handler name casing and lint updates.

LICENSE

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

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

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

defaults/main.yml

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ os_check: true
2222

2323
# Ability to stop reboot from occurring until convenient
2424
# set to true if ok to reboot
25-
skip_reboot: false
25+
skip_reboot: true
2626

2727
# Change to false if using EFI boot changes 1.1.1.4 to stop vfat
2828
amazon2cis_legacy_boot: true
@@ -543,6 +543,12 @@ amazon2cis_rule_6_2_11: true
543543

544544
## Section 1 variables
545545

546+
## Ability to enable debug on mounts to assist in troubleshooting
547+
# Mount point changes are set based upon facts created in Prelim
548+
# these then build the variable and options that is passed to the handler to set the
549+
# mount point for the controls in section1.
550+
amazon2cis_debug_mount_data: false
551+
546552
# If set true uses the tmp.mount service else using fstab configuration
547553
amazon2cis_tmp_svc: true
548554

@@ -700,6 +706,12 @@ amazon2cis_ipv6_sshd_disable: false
700706
amazon2cis_sudolog_location: "/var/log/sudo.log"
701707
amazon2cis_sudo_timestamp_timeout: 15
702708

709+
# 4.3.4 sudoers NOPASSWD
710+
# Accounts listed below will skip the NOPASSWD check and leave NOPASSWD set
711+
amazon2cis_sudoers_exclude_nopasswd_list:
712+
- ec2-user
713+
- vagrant
714+
703715
# Group to be used for su
704716
# this group needs to exists groups will not be created for remediation this is considered sys admins
705717

@@ -758,11 +770,10 @@ amazon2cis_inactive_whitelist:
758770
amazon2cis_user_skip_list:
759771
root
760772

761-
amazon2cis_pass:
762-
max_days: 365
763-
min_days: 1
764-
warn_age: 7
765-
inactive: 30 # should not be 0 or -1 (little details in control)
773+
amazon2cis_pass_max_days: 365
774+
amazon2cis_pass_min_days: 1
775+
amazon2cis_pass_warn_age: 7
776+
amazon2cis_pass_inactive: 30 # should not be 0 or -1 (little details in control)
766777

767778
# Session timeout setting file (TMOUT setting can be set in multiple files)
768779
# Timeout value is in seconds. (60 seconds * 10 = 600)
@@ -793,6 +804,13 @@ amazon2cis_remote_log_protocol: tcp
793804
amazon2cis_remote_log_retrycount: 100
794805
amazon2cis_remote_log_queuesize: 1000
795806

807+
808+
# 5.2.3.6 exclude listed mountpoints from the find command to locate privileged binaries
809+
# Allows operator to exclude mounted devices from being considered as within scope to find privileged binaries; mainly in the case of
810+
# external/temporary mounted USB drives.
811+
# amazon2cis_priv_command_excluded_mounts: ["/mnt/backup_disk", "/mnt/usb_external_storage"]
812+
amazon2cis_priv_command_excluded_mounts: []
813+
796814
# amazon2cis_logrotate sets the daily, weekly, monthly, yearly value for the log rotation
797815
# To conform to CIS standards this just needs to comply with your site policy
798816
amazon2cis_logrotate: "daily"
@@ -804,13 +822,12 @@ amazon2cis_audit_back_log_limit: 8192
804822
amazon2cis_max_log_file_size: 10
805823

806824
# auditd settings
807-
amazon2cis_auditd:
808-
disk_error_action: halt
809-
disk_full_action: halt
810-
action_mail_acct: root
811-
space_left_action: email
812-
admin_space_left_action: single
813-
max_log_file_action: keep_logs
825+
amazon2cis_auditd_disk_error_action: halt
826+
amazon2cis_auditd_disk_full_action: halt
827+
amazon2cis_auditd_action_mail_acct: root
828+
amazon2cis_auditd_space_left_action: email
829+
amazon2cis_auditd_admin_space_left_action: single
830+
amazon2cis_auditd_max_log_file_action: keep_logs
814831

815832
# This can be used to configure other keys in auditd.conf
816833
amazon2cis_auditd_extra_conf: {}
@@ -823,15 +840,14 @@ amazon2cis_auditd_extra_conf: {}
823840
amazon2cis_aide_scan: cron
824841
amazon2cis_config_aide: true
825842
# AIDE cron settings
826-
amazon2cis_aide_cron:
827-
cron_user: root
828-
cron_file: /etc/cron.d/cis_aide
829-
aide_job: '/usr/sbin/aide --check'
830-
aide_minute: 0
831-
aide_hour: 5
832-
aide_day: '*'
833-
aide_month: '*'
834-
aide_weekday: '*'
843+
amazon2cis_aide_cron_user: root
844+
amazon2cis_aide_cron_file: /etc/cron.d/cis_aide
845+
amazon2cis_aide_cron_job: '/usr/sbin/aide --check'
846+
amazon2cis_aide_cron_minute: 0
847+
amazon2cis_aide_cron_hour: 5
848+
amazon2cis_aide_cron_day: '*'
849+
amazon2cis_aide_cron_month: '*'
850+
amazon2cis_aide_cron_weekday: '*'
835851

836852
##
837853
## Section 6 variables
@@ -851,5 +867,14 @@ amazon2cis_ungrouped_adjust: false
851867
amazon2cis_suid_adjust: false
852868
amazon2cis_sgid_adjust: false
853869

870+
# 6.1.12
871+
# This variable is a toggle for enabling/disabling the automated
872+
# setting of an owner (specified in variable `rhel8cis_unowned_owner`)
873+
# for all unowned files and directories.
874+
# Possible values are `true` and `false`.
875+
amazon2cis_ownership_adjust: true
876+
amazon2cis_exclude_unowned_search_path: (! -path "/run/user/*" -a ! -path "/proc/*" -a ! -path "*/containerd/*" -a ! -path "*/kubelet/pods/*" -a ! -path "*/kubelet/plugins/*" -a ! -path "/sys/fs/cgroup/memory/*" -a ! -path "/var/*/private/*")
877+
amazon2cis_unowned_owner: root
878+
854879
# 6.2.12
855880
amazon2cis_dotperm_ansiblemanaged: true

0 commit comments

Comments
 (0)