Execution
Date
08 Dec 2025 13:40:18 +0000
Duration
00:10:06.79
Controller
aio1.openstack.local
User
root
Versions
Ansible
2.18.6
ara
1.7.4 / 1.7.4
Python
3.12.11
Summary
15
Hosts
608
Tasks
2412
Results
18
Plays
158
Files
0
Records
File: /home/zuul/src/opendev.org/openstack/ansible-hardening/tasks/rhel7stig/auditd.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | --- # Copyright 2016, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: Verify that auditd.conf exists ansible.builtin.stat: path: /etc/audit/auditd.conf register: auditd_conf check_mode: false tags: - always - name: Verify that audisp-remote.conf exists ansible.builtin.stat: path: /etc/audisp/audisp-remote.conf register: audisp_remote_conf check_mode: false tags: - always - name: V-72083 - The operating system must off-load audit records onto a different system or media from the system being audited ansible.builtin.lineinfile: dest: /etc/audisp/audisp-remote.conf regexp: "^(#)?remote_server" line: "remote_server = {{ security_audisp_remote_server }}" when: - security_audisp_remote_server is defined - audisp_remote_conf.stat.exists notify: - Restart auditd tags: - medium - auditd - V-72083 - name: V-72085 - The operating system must encrypt the transfer of audit records off-loaded onto a different system or media from the system being audited ansible.builtin.lineinfile: dest: /etc/audisp/audisp-remote.conf regexp: "^(#)?enable_krb5" line: "enable_krb5 = yes" when: - security_audisp_enable_krb5 is defined - audisp_remote_conf.stat.exists notify: - Restart auditd tags: - medium - auditd - V-72085 - name: Get valid system architectures for audit rules ansible.builtin.set_fact: auditd_architectures: "{{ (ansible_facts['architecture'] == 'ppc64le') | ternary(['ppc64'], ['b32', 'b64']) }}" check_mode: false tags: - always - name: Remove system default audit.rules file ansible.builtin.file: path: /etc/audit/rules.d/audit.rules state: absent when: - auditd_conf.stat.exists notify: - Generate auditd rules tags: - always - name: Deploy rules for auditd based on STIG requirements ansible.builtin.template: src: osas-auditd-rhel7.j2 dest: /etc/audit/rules.d/osas-auditd-rhel7.rules mode: "0644" when: - auditd_conf.stat.exists notify: - Generate auditd rules tags: - auditd - V-72167 - V-72155 - V-72139 - V-72105 - V-72097 - V-72123 - V-72183 - V-72189 - V-72107 - V-72109 - V-72099 - V-72103 - V-72119 - V-72113 - V-72133 - V-72187 - V-72153 - V-72101 - V-72121 - V-72115 - V-72171 - V-72165 - V-72125 - V-72127 - V-72129 - V-72185 - V-72149 - V-72175 - V-72177 - V-72117 - V-72199 - V-72201 - V-72141 - V-72203 - V-72135 - V-72137 - V-72111 - V-72179 - V-72159 - V-72161 - V-72169 - V-72131 - V-72173 - V-72151 - V-72205 - V-72207 - V-72157 - V-72143 - V-72163 - V-72191 - V-72193 - V-72195 - V-72197 - V-72081 - name: Adjust auditd/audispd configurations ansible.builtin.lineinfile: dest: "{{ item.config }}" regexp: "^#?{{ item.parameter }}\\s*=" line: "{{ item.parameter }} = {{ item.value }}" with_items: "{{ auditd_config }}" when: - auditd_conf.stat.exists - audisp_remote_conf.stat.exists notify: - Restart auditd tags: - high - auditd - V-72087 - V-72089 - V-72091 - V-72093 - name: Ensure auditd is running and enabled at boot time ansible.builtin.service: name: auditd state: started enabled: true when: - auditd_conf.stat.exists tags: - high - auditd - V-72079 |