Skip to content

Commit

Permalink
Added ufw portmapper deny.
Browse files Browse the repository at this point in the history
  • Loading branch information
lefeverd committed Jul 22, 2022
1 parent 2317bf5 commit 63ed08a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions provision/ansible/roles/prepare/tasks/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,44 @@
net.bridge.bridge-nf-call-ip6tables: 1
net.ipv4.conf.default.rp_filter: 0
net.ipv4.conf.all.rp_filter: 0

- name: UFW - Allow incoming
community.general.ufw:
direction: incoming
default: allow

- name: UFW - Allow outgoing
community.general.ufw:
direction: outgoing
default: allow

- name: UFW - Limit SSH
community.general.ufw:
rule: limit
port: ssh
proto: tcp

#- name: UFW - Allow k3s
# community.general.ufw:
# rule: allow
# port: 6443
# proto: tcp

#- name: Allow all access from RFC1918 networks to this host
# community.general.ufw:
# rule: allow
# src: '{{ item }}'
# loop:
# - 10.0.0.0/8
# - 172.16.0.0/12
# - 192.168.0.0/16

- name: UFW - Deny portmapper
community.general.ufw:
rule: deny
port: '111'
proto: any

- name: Enable UFW
community.general.ufw:
state: enabled

0 comments on commit 63ed08a

Please sign in to comment.