File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
22
3- parseable: true
43quiet: true
54skip_list:
65 - 'package-latest'
Original file line number Diff line number Diff line change 44
55### Do not migrate
66
7+ # Jan26
8+ pre-commits
9+ #325 nopasswd for sudoers options added
10+ chrony template tidied up
11+
712# Dec 25 update
813pre-commits
914
Original file line number Diff line number Diff line change @@ -909,6 +909,12 @@ ubtu22cis_sshd_deny_groups: ""
909909# CIS recommends `sudo` or, if LDAP functionality is required, `sudo-ldap`.
910910ubtu22cis_sudo_package : " sudo"
911911
912+ # # control 5.2.4 sudoers NOPASSWD
913+ # This will leave NOPASSWD intact for these users
914+ ubtu22cis_sudoers_exclude_nopasswd_list :
915+ - ec2-user
916+ - vagrant
917+
912918# # Control 5.2.3
913919# This variable defines the path and file name of the sudo log file.
914920ubtu22cis_sudo_logfile : " /var/log/sudo.log"
Original file line number Diff line number Diff line change 5353 - sudo
5454 - rule_5.2.4
5555 - NIST800-53R5_AC-6
56- ansible.builtin.replace :
57- path : " {{ item }}"
58- regexp : ' ^([^#|{% if system_is_ec2 %}ec2-user{% endif %}].*)NOPASSWD(.*)'
59- replace : ' \1PASSWD\2'
60- validate : ' /usr/sbin/visudo -cf %s'
61- loop : " {{ prelim_sudoers_files.stdout_lines }}"
56+ block :
57+ - name : " 5.2.4 | AUDIT | Ensure users must provide password for escalation | discover accts with NOPASSWD"
58+ ansible.builtin.shell : grep -Ei '(nopasswd)' /etc/sudoers /etc/sudoers.d/* | cut -d':' -f1
59+ become : true
60+ changed_when : false
61+ failed_when : false
62+ register : discovered_sudoers_nopasswd
63+
64+ - name : " 5.2.4 | PATCH | Ensure users must provide password for escalation"
65+ when : discovered_sudoers_nopasswd.stdout | length > 0
66+ ansible.builtin.replace :
67+ path : " {{ item }}"
68+ regexp : ' ^((?!#|{% for name in ubtu22cis_sudoers_exclude_nopasswd_list %}{{ name }}{% if not loop.last -%}|{%- endif -%}{% endfor %}).*)NOPASSWD(.*)'
69+ replace : ' \1PASSWD\2'
70+ validate : ' /usr/sbin/visudo -cf %s'
71+ loop : " {{ discovered_sudoers_nopasswd.stdout_lines }}"
6272
6373- name : " 5.2.5 | PATCH | Ensure re-authentication for privilege escalation is not disabled globally"
6474 when : ubtu22cis_rule_5_2_5
Original file line number Diff line number Diff line change 11# Welcome to the chrony configuration file. See chrony.conf(5) for more
2- # information about usuable directives.
2+ # information about useable directives.
33
44# This will use (up to):
55# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled
@@ -89,5 +89,3 @@ logchange 0.5
8989# chrony postinst based on what it found in /etc/default/rcS. You may
9090# change it if necessary.
9191rtconutc
92-
93- user {{ ubtu22cis_chrony_user }}
You can’t perform that action at this time.
0 commit comments