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

Added selectattr value to select only nfs mounts #41

Merged
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
9 changes: 3 additions & 6 deletions tasks/Cat2/RHEL-09-23xxxx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@
- name: "MEDIUM | RHEL-09-231065 | PATCH | RHEL 9 must prevent special devices on file systems that are imported via Network File System (NFS)."
when:
- rhel_09_231065
- ansible_facts['mounts']| selectattr('fstype', '==', 'nfs')
- "'nfs-utils' in ansible_facts.packages"
- "'nodev' not in item.options"
- rhel9stig_disruption_high
Expand All @@ -215,14 +214,13 @@
path: "{{ item.mount }}"
src: "{{ item.device }}"
state: present
loop: "{{ ansible_facts.mounts }}"
loop: "{{ ansible_facts.mounts | selectattr('fstype', 'contains', 'nfs') | list }}"
loop_control:
label: "{{ item.device }}"

- name: "MEDIUM | RHEL-09-231070 | PATCH | RHEL 9 must prevent code from being executed on file systems that are imported via Network File System (NFS)."
when:
- rhel_09_231070
- ansible_facts['mounts']| selectattr('fstype', '==', 'nfs')
- "'nfs-utils' in ansible_facts.packages"
- "'noexec' not in item.options"
- rhel9stig_disruption_high
Expand All @@ -240,14 +238,13 @@
path: "{{ item.mount }}"
src: "{{ item.device }}"
state: present
loop: "{{ ansible_facts.mounts }}"
loop: "{{ ansible_facts.mounts | selectattr('fstype', 'contains', 'nfs') | list }}"
loop_control:
label: "{{ item.device }}"

- name: "MEDIUM | RHEL-09-231075 | PATCH | RHEL 9 must prevent files with the setuid and setgid bit set from being executed on file systems that are imported via Network File System (NFS)."
when:
- rhel_09_231075
- ansible_facts['mounts']| selectattr('fstype', '==', 'nfs')
- "'nfs-utils' in ansible_facts.packages"
- "'nosuid' not in item.options"
- rhel9stig_disruption_high
Expand All @@ -265,7 +262,7 @@
path: "{{ item.mount }}"
src: "{{ item.device }}"
state: present
loop: "{{ ansible_facts.mounts }}"
loop: "{{ ansible_facts.mounts | selectattr('fstype', 'contains', 'nfs') | list }}"
loop_control:
label: "{{ item.device }}"

Expand Down