-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaide.yml
45 lines (35 loc) · 1019 Bytes
/
aide.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
# Install aide and generate the database
---
- name: Install and configure AIDE
hosts: all
become: yes
become_user: root
vars:
- baseline_file: /var/lib/aide/aide.db.gz
- scan_file: /var/lib/aide/aide.db.new.gz
tasks:
- name: Ensure AIDE is installed
yum:
name: aide
state: latest
- name: Check for previous scan
stat: path={{ scan_file }}
register: scan
- name: Check for baseline scan
stat: path={{ baseline_file }}
register: baseline
- name: Generate initial database
command: /sbin/aide -i
when:
- scan.stat.exists == False
#- baseline.stat.exists == False
- name: Move initial database to baseline
command: mv {{ scan_file }} {{ baseline_file }}
when:
- scan.stat.exists == True
- baseline.stat.exists == False
- name: Compare baseline
command: /sbin/aide --check
when:
- scan.stat.exists == True
- baseline.stat.exists == True