jloh.csf-ansible-role

CSF Ansible Role

GitHub version Build Status

Requirements

None

Role Variables

Variables are divided into two levels:

  • csf_global_conf
    These variables are set for all servers in a group.
  • csf_conf
    These variables are specific to each server.
  • csf_allow_ip
    IP addresses in this list will be added to the /etc/csf/csf.allow file.
  • csf_rules
    Rules defined here are taken from role_dir/files/rules/common/{{ item.rule }}.allow.
    TODO: Improve the organization.

Dependencies

None

Example Playbook

- hosts: firewalls
  roles:
     - { role: jloh.csf-ansible-role }

In group_vars/firewalls:

csf_global_conf:
  - name: CLUSTER_PORT
    config: "7786"
  - name: CLUSTER_KEY
    config: "some random cluster key"
  - name: DENY_TEMP_IP_LIMIT
    config: "200"
  - name: LF_CONSOLE_EMAIL_ALERT
    config: "1"
  - name: LF_GLOBAL
    config: "3600"
  - name: GLOBAL_DYNDNS_INTERVAL
    config: "600"
  - name: URLGET
    config: "2"

csf_allow:
 - 12.12.12.12	# office IP
 - 138.44.33.22	# monitoring
 - 198.33.22.11
 - 45.22.11.22
 
csf_ignore:
 - 12.12.12.12	# office IP
 - 138.44.33.22	# monitoring
 - 198.33.22.11
 - 45.22.11.22

csf_blocklists:
  - SPAMEDROP
  - DSHIELD
  - TOR
  - ALTTOR
  - BOGON
  - HONEYPOT
  - CIARMY
  - BFB
  - OPENBL
  - AUTOSHUN
  - MAXMIND
  - BDE
  - STOPFORUMSPAM

In host_vars/firewall-01:

csf_conf:
  - name: CLUSTER_RECVFROM
    config: "162.243.144.14,103.4.18.200,80.69.77.247"
  - name: CLUSTER_SENDTO
    config: "162.243.144.14,103.4.18.200,80.69.77.247"
  - name: TCP_IN
    config: "80,443"
  - name: TCP_OUT
    config: "25,53,80,443"
  - name: UDP_IN
    config: ""
  - name: UDP_OUT
    config: "25,123"
  - name: TCP6_IN
    config: "80,443"
  - name: TCP6_OUT
    config: "25,53,80,443"
  - name: UDP6_IN
    config: ""
  - name: UDP6_OUT
    config: "25,123"

 csf_rules:
  - rule: nagios
  - rule: munin

License

MIT

Contributors

Many! Please check out the contributors graph!

Author Information

For more roles and tech info, feel free to visit my blog.

Informazioni sul progetto

Install and configure Config Server Firewall (CSF) from scratch

Installa
ansible-galaxy install jloh.csf-ansible-role
Licenza
mit
Download
163
Proprietario
Engineer at @TryGhost