ansible-base/roles/ufw/tasks/main.json
Marius Melzer 65b00c8840 Add ufw role
- Enable ufw and by default deny incoming traffic
- in other roles: if ufw (role) is enabled, then allow necessary ports
2024-04-20 17:08:39 +02:00

41 lines
555 B
JSON

[
{
"name": "install ufw",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"ufw"
]
}
},
{
"name": "ufw deny incoming",
"ufw": {
"direction": "incoming",
"proto": "any",
"policy": "deny"
}
},
{
"name": "ufw allow outgoing",
"ufw": {
"direction": "outgoing",
"proto": "any",
"policy": "allow"
}
},
{
"name": "ufw allow and rate-limit ssh",
"ufw": {
"rule": "limit",
"name": "ssh"
}
},
{
"name": "enable ufw service",
"ufw": {
"state": "enabled"
}
}
]