Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

November24 updates to main #435

Merged
merged 27 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c1457a2
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Oct 21, 2024
09dc296
Fixed control 6.2.11 inline with control details
uk-bolly Oct 22, 2024
13bec32
Merge pull request #422 from ansible-lockdown/pre-commit-ci-update-co…
uk-bolly Oct 22, 2024
cdcb50c
add context and default to false for 6.2.12
uk-bolly Oct 25, 2024
40cda3a
Extended and updated 6.2.11
uk-bolly Oct 25, 2024
bebb2a6
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Oct 28, 2024
c17c974
Merge pull request #423 from ansible-lockdown/pre-commit-ci-update-co…
uk-bolly Oct 29, 2024
f23ef8b
removed recursive from find command 6.2.11
uk-bolly Oct 30, 2024
ad49d8e
updated 1.2.2-1.2.5 improved regex #425
uk-bolly Nov 11, 2024
a48ca0e
updated of 6.2.10 inline with control
uk-bolly Nov 12, 2024
7e4ace8
udpated spacing in warning
uk-bolly Nov 12, 2024
8124741
Merge pull request #426 from ansible-lockdown/issue_425
uk-bolly Nov 12, 2024
e0f8a3e
Merge pull request #427 from ansible-lockdown/6_2_10
uk-bolly Nov 12, 2024
2d4d2b5
Merge pull request #428 from ansible-lockdown/rule_6_2_11
uk-bolly Nov 12, 2024
f6859f0
updated loop for 6.2.10 to use interactive users
uk-bolly Nov 14, 2024
5a41681
Updated UID discovery and var naming
uk-bolly Nov 14, 2024
3852132
realigned variable naming set in prelim
uk-bolly Nov 14, 2024
d1bf968
Merge pull request #429 from ansible-lockdown/6_2_10_improvements
uk-bolly Nov 14, 2024
6d2693e
Tidy up and improve conditionals #433
uk-bolly Nov 28, 2024
ca8dd72
removed changed_when #434
uk-bolly Nov 28, 2024
d4f45c9
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Dec 2, 2024
89166c3
Merge pull request #436 from ansible-lockdown/Nov24_logic_updates
uk-bolly Dec 3, 2024
39c3168
Merge pull request #437 from ansible-lockdown/pre-commit-ci-update-co…
uk-bolly Dec 3, 2024
37b7905
Removed nested variable naming
uk-bolly Dec 3, 2024
fa44e77
Merge pull request #438 from ansible-lockdown/variable_naming
uk-bolly Dec 4, 2024
976803f
conditionals updated 4.4.3.4.3,4.4.3.4.4 and 6.2.11\n 6.2.6 and 6.2.7…
uk-bolly Dec 5, 2024
7ead9aa
Merge pull request #439 from ansible-lockdown/dec24_updates
uk-bolly Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ repos:
- id: detect-secrets

- repo: https://github.com/gitleaks/gitleaks
rev: v8.20.1
rev: v8.21.2
hooks:
- id: gitleaks

- repo: https://github.com/ansible-community/ansible-lint
rev: v24.9.2
rev: v24.10.0
hooks:
- id: ansible-lint
name: Ansible-lint
Expand Down
145 changes: 74 additions & 71 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -663,23 +663,22 @@ rhel8cis_nft_tables_autochaincreate: true
######
## If using the allow/deny user groups options
rhel8cis_sshd_limited: false
rhel8cis_sshd:
clientalivecountmax: 3
clientaliveinterval: 15
logingracetime: 60
loglevel: INFO
macs: '-hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-sha1-96,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]'
maxauthtries: 4
maxsessions: 10
maxstartups: "10:30:60"
ciphers: '-3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,[email protected]'
kex: '-diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1'
# WARNING: make sure you understand the precedence when working with these values!!
## Only runs if value rhel8cis_sshd_limited is true
# allowusers:
# allowgroups: systems dba
# denyusers:
# denygroups:
rhel8cis_sshd_clientalivecountmax: 3
rhel8cis_sshd_clientaliveinterval: 15
rhel8cis_sshd_logingracetime: 60
rhel8cis_sshd_loglevel: INFO
rhel8cis_sshd_macs: '-hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-sha1-96,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]'
rhel8cis_sshd_maxauthtries: 4
rhel8cis_sshd_maxsessions: 10
rhel8cis_sshd_maxstartups: "10:30:60"
rhel8cis_sshd_ciphers: '-3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,[email protected]'
rhel8cis_sshd_kex: '-diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1'
# WARNING: make sure you understand the precedence when working with these values!!
## Only runs if value rhel8cis_sshd_limited is true
# rhel8cis_sshd_allowusers:
# rhel8cis_sshd_allowgroups: systems dba
# rhel8cis_sshd_denyusers:
# rhel8cis_sshd_denygroups:

# 4.3. sudo
rhel8cis_sudolog_location: "/var/log/sudo.log"
Expand Down Expand Up @@ -715,33 +714,29 @@ rhel8cis_authselect_custom_profile_name: cis_example_profile
# ```authselect list``` on the host to be configured
rhel8cis_authselect_default_profile_to_copy: "sssd --symlink-meta"

rhel8cis_pam_faillock:
attempts: 5
deny: 5
interval: 900
unlock_time: 900
root_unlock_time: 60
# Choose options below for root options
root_option: even_deny_root
# root_option: "root_unlock_time = {{ root_unlock_time }}"

rhel8cis_pam_pwquality:
difok: 2
maxrepeat: 3
maxseq: 3
minlen: 14
minclass: 4

rhel8cis_pam_pwhistory:
remember: 24
rhel8cis_pam_faillock_attempts: 5
rhel8cis_pam_faillock_deny: 5
rhel8cis_pam_faillock_interval: 900
rhel8cis_pam_faillock_unlock_time: 900
rhel8cis_pam_faillock_root_unlock_time: 60
# Choose options below for root options
rhel8cis_pam_faillock_root_option: even_deny_root
# root_option: "root_unlock_time = {{ root_unlock_time }}"

rhel8cis_pam_pwquality_difok: 2
rhel8cis_pam_pwquality_maxrepeat: 3
rhel8cis_pam_pwquality_maxseq: 3
rhel8cis_pam_pwquality_minlen: 14
rhel8cis_pam_pwquality_minclass: 4

rhel8cis_pam_pwhistory_remember: 24

rhel8cis_pam_pwhash: sha512

rhel8cis_pass:
inactive: 30
max_days: 365 # Max 365
min_days: 7
warn_age: 7
rhel8cis_pam_pass_inactive: 30
rhel8cis_pam_pass_max_days: 365 # Max 365
rhel8cis_pam_pass_min_days: 7
rhel8cis_pam_pass_warn_age: 7

## Set the following to true if you wish to adjust accounts greater than rhel8cis_pass['max_days']
rhel8cis_set_max_expiry: false
Expand All @@ -752,9 +747,8 @@ rhel8cis_user_skip_list:

rhel8cis_root_umask: '0027' # 0027 or more restrictive

rhel8cis_shell_session_timeout:
file: /etc/profile.d/tmout.sh
timeout: 900
rhel8cis_shell_session_file: /etc/profile.d/tmout.sh
rhel8cis_shell_session_timeout: 900

# sugroup
rhel8cis_sugroup: sugroup
Expand All @@ -773,9 +767,6 @@ rhel8cis_inactivelock:
# Allow ansible to expire password for account with a last changed date in the future. False will just display users in violation, true will expire those users passwords
rhel8cis_futurepwchgdate_autofix: true

rhel8uid_uid_start: 1000
rhel8uid_uid_stop: 60000

## Section5 vars

## Preferred method of logging
Expand All @@ -795,13 +786,31 @@ rhel8cis_remote_log_queuesize: 1000

update_audit_template: false

rhel8cis_auditd:
disk_error_action: halt
disk_full_action: halt
action_mail_acct: root
space_left_action: email
admin_space_left_action: single
max_log_file_action: keep_logs
# The audit_back_log_limit value should never be below 8192
rhel8cis_auditd_back_log_limit: 8192

# The max_log_file parameter should be based on your sites policy
rhel8cis_auditd_max_log_file_size: 10

rhel8cis_auditd_disk_error_action: halt
rhel8cis_auditd_disk_full_action: halt
rhel8cis_auditd_action_mail_acct: root
rhel8cis_auditd_space_left_action: email
rhel8cis_auditd_admin_space_left_action: single
rhel8cis_auditd_max_log_file_action: keep_logs

# UID settings for interactive users
# These are discovered via logins.def if set true
discover_int_uid: true
### Controls:
# This variable sets the minimum number from which to search for UID
# Note that the value will be dynamically overwritten if variable `discover_int_uid` has
# been set to `true`.
min_int_uid: 1000
### Controls:
# Note that the value will be dynamically overwritten if variable `discover_int_uid` has
# been set to `true`.
max_int_uid: 65533

# This can be used to configure other keys in auditd.conf
rhel8cis_auditd_extra_conf: {}
Expand Down Expand Up @@ -833,26 +842,19 @@ rhel8cis_journald_maxfilesec: 1month
# change to true if you wish to change logrotate.d conf files
allow_logrotate_conf_umask_updates: false

# The audit_back_log_limit value should never be below 8192
rhel8cis_audit_back_log_limit: 8192

# The max_log_file parameter should be based on your sites policy
rhel8cis_max_log_file_size: 10

# AIDE
# aide setup via - cron, timer
rhel8cis_aide_scan: cron
rhel8cis_config_aide: true
# AIDE cron settings
rhel8cis_aide_cron:
cron_user: root
cron_file: /etc/cron.d/cis_aide
aide_job: '/usr/sbin/aide --check'
aide_minute: 0
aide_hour: 5
aide_day: '*'
aide_month: '*'
aide_weekday: '*'
rhel8cis_aide_cron_user: root
rhel8cis_aide_cron_file: /etc/cron.d/cis_aide
rhel8cis_aide_cron_job: '/usr/sbin/aide --check'
rhel8cis_aide_cron_minute: 0
rhel8cis_aide_cron_hour: 5
rhel8cis_aide_cron_day: '*'
rhel8cis_aide_cron_month: '*'
rhel8cis_aide_cron_weekday: '*'

## Section6 vars

Expand All @@ -870,5 +872,6 @@ rhel8cis_ungrouped_adjust: false
rhel8cis_suid_adjust: false
rhel8cis_sgid_adjust: false

# 6.2.12
rhel8cis_dotperm_ansiblemanaged: true
# 6.2.11
# Allow changes to take place on system
rhel8cis_dotperm_ansiblemanaged: false
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
state: restarted

- name: Rebuild_grub
ansible.builtin.shell: "grub2-mkconfig -o {{ discovered_grub_cfg.stat.lnk_source }}"
ansible.builtin.shell: "grub2-mkconfig -o {{ prelim_grub_cfg.stat.lnk_source }}"
ignore_errors: true # noqa ignore-errors
notify: Change_requires_reboot
tags:
Expand Down
1 change: 0 additions & 1 deletion tasks/post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
- name: POST | Perform DNF package cleanup
ansible.builtin.dnf:
autoremove: true
changed_when: false

- name: POST | flush handlers
ansible.builtin.meta: flush_handlers
Expand Down
Loading