Jiri Podivin 9b2bddbab8 New validation for checking presence of running rsyslog service.
Necessity of proper logging is described in depth by NIST SP 800-171
as well as by the Red Hat Openstack Security and Hardening Guide.

New validation group `security` consists only of check-rsyslog and
check-selinux-mode validations at this time.

Further security related validations should be included
in this group, in addition to other groups as needed.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I53f31f6fd30a15698328cada54c96d7d902e0155
2022-01-25 11:28:39 +01:00

14 lines
404 B
YAML

---
- name: Get active rsyslog service
shell: >
systemctl list-units "rsyslog.service" --state=active --no-legend --plain --no-pager
register: rsyslog_state
changed_when: false
- name: Fails if we don't find active rsyslog
assert:
that:
- rsyslog_state.stdout_lines|length != 0
fail_msg: "The the rsyslog service isn't in an active state."
success_msg: "rsyslog is active"