f500.ufw
UFW
Installiere UFW (Unkomplizierte Firewall) und erstelle (oder entferne) Regeln.
Voraussetzungen
Debian Bullseye / Bookworm mit den Paketen python-pycurl und python-software-properties installiert.
Rollenvariablen
Setze die Standardrichtlinie:
ufw_default_policy:
- { direction: "incoming", policy: "deny" }
Füge Regeln hinzu oder entferne sie:
ufw_rules_to_create: []
ufw_rules_to_delete: []
Sowohl ufw_rules_to_create
als auch ufw_rules_to_delete
akzeptieren eine Liste von Dictionaries, wie folgt:
ufw_rules_to_create:
- direction: in
from_ip: 1.2.3.4
from_port: 5678
interface: eth0
proto: tcp
rule: allow
to_ip: 5.6.7.8
to_port: 1234
Beispiel-Playbook
- hosts: servers
roles:
- role: f500.ufw
ufw_rules_to_create:
- { to_port: 22 }
- { to_port: 80 }
- { to_port: 443 }
Lizenz
Copyright (C) 2017 Future500 B.V.
Autorinformationen
Jasper N. Brouwer, jasper@future500.nl
Ramon de la Fuente, ramon@future500.nl