ansible-lockdown / RHEL7-STIG

Ansible role for Red Hat 7 STIG Baseline
MIT License
282 stars 144 forks source link

RHEL-07-020110 does not reference rhel_07_020110_autofs_service_status.stdout #431

Closed whitehat237 closed 1 year ago

whitehat237 commented 1 year ago

Describe the Issue The conditional check for the RHEL-07-020110 task for ansible.builtin.service (line number 1353 in tasks/fix-cat2.yml) does not reference the registered variable rhel_07_020110_autofs_service_status.stdout. The variable is referenced directly, and thus will not equal the string "loaded"

Expected Behavior rhel_07_020110_autofs_service_status.stdout is referenced by the task, and the string "loaded" is properly matched or not.

Actual Behavior rhel_07_020110_autofs_service_status is referenced without checking .stdout sub item in the returned dictionary, and thus the string comparison for "loaded" will never match.

Control(s) Affected RHEL-07-020110

Environment (please complete the following information):

Additional Notes

Possible Solution Ammend line 1353 as follows: remove: rhel_07_020110_autofs_service_status == "loaded" add: rhel_07_020110_autofs_service_status.stdout == "loaded"

I will also submit a pull request to amend as described above.

whitehat237 commented 1 year ago

PR 430 opened, includes commit to resolve this issue.