Skip to content

Commit

Permalink
Add whitelisting of controller
Browse files Browse the repository at this point in the history
  • Loading branch information
astsu777 committed Apr 14, 2018
1 parent 2545155 commit 9530974
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Ansible Role: OSSEC-HIDS

This role installs and configures OSSEC-HIDS in local mode. Depending on the defined variables, it is possible to choose the protections and also if email notifications are enabled.

**Note**: the Ansible controller IP address will automatically be whitelisted (to avoid being disconnected by mistake). This IP needs to be defined in a variable (see below).

Requirements
------------

Expand All @@ -28,6 +30,7 @@ ossec_integritycheck_daemon: y
ossec_rootkit_engine: y
ossec_active_response: y
ossec_firewalldrop_response: y
ansible_controller_ip: 192.168.0.1
```


Expand All @@ -43,6 +46,7 @@ ossec_integritycheck_daemon: y
ossec_rootkit_engine: y
ossec_active_response: y
ossec_firewalldrop_response: y
ansible_controller_ip: 192.168.0.1
```

These variables should be defined in either group_vars or host_vars.
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ossec_integritycheck_daemon: y
ossec_rootkit_engine: y
ossec_active_response: y
ossec_firewalldrop_response: y
ansible_controller_ip: 192.168.1.1

# OSSEC installation questions (without email notification)
#ossec_dir: /var/ossec
Expand Down
7 changes: 7 additions & 0 deletions tasks/ossec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@
service:
name: ossec
state: started

- name: (OSSEC) Whitelist Ansible Controller IP address
lineinfile:
path: /var/ossec/etc/ossec.conf
insertafter: '</white_list>'
state: present
line: " <white_list>{{ ansible_controller_ip }}</white_list>"

0 comments on commit 9530974

Please sign in to comment.