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

Jan25 updates #7

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1305,17 +1305,17 @@ deb12cis_auditd_extra_conf:
# Section 7 Vars

# 7.1.12 Ensure no files or directories without an owner and a group exist
deb12cis_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/*"'
deb12cis_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/*" \)'

# Control 7.1.12
# The value of this variable specifies the owner that will be set for unowned files and directories.
deb12cis_unowned_owner: root
deb12cis_ungrouped_group: root
# This variable is a toggle for enabling/disabling the automated
# setting of an owner (specified in variable `deb12cis_unowned_owner`)
# for all unowned files and directories.
# setting of an owner or group (specified in variable `deb12cis_unowned_owner`)
# for all unowned or ungrouped files and directories.
# Possible values are `true` and `false`.
deb12cis_ownership_adjust: true
deb12cis_ownership_adjust: false

## Control 7.1.13
# This variable is a toggle for enabling/disabling the automated removal
Expand Down
5 changes: 2 additions & 3 deletions tasks/section_5/cis_5.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
- NIST800-53R5_AU-12
ansible.builtin.lineinfile:
path: /etc/sudoers
regexp: ^(Defaults\s*)logfile=
line: \1logfile="{{ deb12cis_sudolog_location }}"
backrefs: true
regexp: ^Defaults\s*logfile=
line: Defaults logfile="{{ deb12cis_sudolog_location }}"
validate: '/usr/sbin/visudo -cf %s'

- name: "5.2.4 | PATCH | Ensure users must provide password for escalation"
Expand Down
4 changes: 2 additions & 2 deletions tasks/section_7/cis_7.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
warn_control_id: '7.1.12'
block:
- name: "7.1.12 | AUDIT | Ensure no files or directories without an owner and a group exist | Get list files or directories"
ansible.builtin.command: find ({{ deb12cis_exclude_unowned_search_path }}) {{ item.mount }} -xdev \( -nouser -o -nogroup \) -not -fstype nfs
ansible.builtin.command: find {{ item.mount }} -xdev -type f {{ deb12cis_exclude_unowned_search_path }} \( -nouser -o -nogroup \) -not -fstype nfs
changed_when: false
failed_when: false
check_mode: false
Expand Down Expand Up @@ -240,7 +240,7 @@
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ deb12cis_unowned_owner }}"
group: "{{ deb12cis_unowned_group }}"
group: "{{ deb12cis_ungrouped_group }}"
with_items:
- "{{ discovered_unowned_files_flatten }}"

Expand Down
Loading