|
@ -1,11 +1,11 @@ |
|
|
--- |
|
|
--- |
|
|
- name: firewall | install ufw |
|
|
- name: linode_preflight | firewall | install ufw |
|
|
apt: |
|
|
apt: |
|
|
pkg: ufw |
|
|
pkg: ufw |
|
|
state: present |
|
|
state: present |
|
|
become: yes |
|
|
become: yes |
|
|
|
|
|
|
|
|
- name: firewall | Open ssh port |
|
|
- name: linode_preflight | firewall | Open ssh port |
|
|
ufw: |
|
|
ufw: |
|
|
state: enabled |
|
|
state: enabled |
|
|
rule: "{{ firewall__ssh_rule }}" |
|
|
rule: "{{ firewall__ssh_rule }}" |
|
@ -16,21 +16,21 @@ |
|
|
- 8822 |
|
|
- 8822 |
|
|
become: yes |
|
|
become: yes |
|
|
|
|
|
|
|
|
- name: firewall | deny all incoming connections |
|
|
- name: linode_preflight | firewall | deny all incoming connections |
|
|
ufw: |
|
|
ufw: |
|
|
state: enabled |
|
|
state: enabled |
|
|
policy: deny |
|
|
policy: deny |
|
|
direction: incoming |
|
|
direction: incoming |
|
|
become: yes |
|
|
become: yes |
|
|
|
|
|
|
|
|
- name: firewall | allow all outgoing connections |
|
|
- name: linode_preflight | firewall | allow all outgoing connections |
|
|
ufw: |
|
|
ufw: |
|
|
state: enabled |
|
|
state: enabled |
|
|
policy: allow |
|
|
policy: allow |
|
|
direction: outgoing |
|
|
direction: outgoing |
|
|
become: yes |
|
|
become: yes |
|
|
|
|
|
|
|
|
- name: firewall | allow all connections from localhost |
|
|
- name: linode_preflight | firewall | allow all connections from localhost |
|
|
ufw: |
|
|
ufw: |
|
|
state: enabled |
|
|
state: enabled |
|
|
from: "127.0.0.1" |
|
|
from: "127.0.0.1" |
|
@ -38,7 +38,7 @@ |
|
|
proto: any |
|
|
proto: any |
|
|
become: yes |
|
|
become: yes |
|
|
|
|
|
|
|
|
- name: firewall | Copy SSH config |
|
|
- name: linode_preflight | firewall | Copy SSH config |
|
|
template: |
|
|
template: |
|
|
src: "etc/ssh/sshd_config.j2" |
|
|
src: "etc/ssh/sshd_config.j2" |
|
|
dest: "/etc/ssh/sshd_config" |
|
|
dest: "/etc/ssh/sshd_config" |
|
@ -46,4 +46,3 @@ |
|
|
validate: '/usr/sbin/sshd -t -f %s' |
|
|
validate: '/usr/sbin/sshd -t -f %s' |
|
|
become: yes |
|
|
become: yes |
|
|
notify: restart sshd |
|
|
notify: restart sshd |
|
|
|
|
|
|
|
|