Closed bgro closed 10 months ago
Describe the Issue Control 1.1.1.2 has
when: - ubtu22cis_rule_1_1_1_2 - snap_pkg_mgr.stdout | length == 0
as precondition, but this will always fail, because the wordcount is returned rather than the findings:
- name: "PRELIM | Register if snap being used" ansible.builtin.shell: df -h | grep -wc "/snap" changed_when: false failed_when: snap_pkg_mgr.rc not in [ 0, 1 ] register: snap_pkg_mgr
Fixing this however leads to an error, because Ubuntu has squashfs built in. So this is another precondition to be checked.
squashfs
Expected Behavior
Control should be executed if snap is not used and squashfs is not built in.
snap
Actual Behavior
Hence, the control is never executed, even though if snap is not used.
Control(s) Affected
Environment (please complete the following information):
Additional Notes
Possible Solution
The correct precondition is snap_pkg_mgr.stdout == '0'
snap_pkg_mgr.stdout == '0'
Also, a precondition checking whether squashfs is built in should be added.
I will provide a PR
hi @bgro
This issue was merged to devel a couple of weeks ago. I will close this Issue, if this does not resolve your issue please reopen.
Many thanks as always
uk-bolly
Describe the Issue Control 1.1.1.2 has
as precondition, but this will always fail, because the wordcount is returned rather than the findings:
Fixing this however leads to an error, because Ubuntu has
squashfs
built in. So this is another precondition to be checked.Expected Behavior
Control should be executed if
snap
is not used andsquashfs
is not built in.Actual Behavior
Hence, the control is never executed, even though if
snap
is not used.Control(s) Affected
Environment (please complete the following information):
Additional Notes
Possible Solution
The correct precondition is
snap_pkg_mgr.stdout == '0'
Also, a precondition checking whether
squashfs
is built in should be added.I will provide a PR