Skip to content
Snippets Groups Projects
Commit e4c70e59 authored by Gallenkamp, Fabian's avatar Gallenkamp, Fabian
Browse files

Make ufw incoming ssh connection ip-ranges configurable;

parent f9e86b69
No related branches found
No related tags found
No related merge requests found
...@@ -3,43 +3,32 @@ ...@@ -3,43 +3,32 @@
become: true become: true
hosts: all hosts: all
tasks: tasks:
# setup ufw ssh rules # setup ufw ssh exception/limiting rules
- name: allow ssh access from uni-hamburg ip range - name: allow ssh access from specified ip ranges
ufw: ufw:
rule: allow rule: allow
app: OpenSSH app: OpenSSH
from_ip: 134.100.0.0/16 from_ip: "{{ item }}"
with_items: "{{ ufw_ssh_allowed_from }}"
- name: allow ssh access from internal ip range a)
ufw:
rule: allow
app: OpenSSH
from_ip: 192.168.0.0/16
- name: allow ssh access from internal ip range b)
ufw:
rule: allow
app: OpenSSH
from_ip: 172.16.0.0/12
- name: rate limiting ssh access - name: rate limiting ssh access
ufw: ufw:
rule: limit rule: limit
app: OpenSSH app: OpenSSH
# setup nginx web server rule # setup nginx web server exception rule
- name: allow access of nginx webserver from everywhere - name: allow access of nginx webserver from everywhere
ufw: ufw:
rule: allow rule: allow
name: Nginx Full name: Nginx Full
# set default rules # set default deny rules
- name: deny any other incoming traffic by default - name: deny any other incoming traffic by default
ufw: ufw:
state: enabled state: enabled
default: deny default: deny
direction: incoming direction: incoming
# set default allow rule for outgoing, FIXME: do it more granulary (only http/https)
- name: allow any outgoing traffic by default - name: allow any outgoing traffic by default
ufw: ufw:
state: enabled state: enabled
......
...@@ -53,3 +53,6 @@ otree_users: ...@@ -53,3 +53,6 @@ otree_users:
ssl_certificate_path: "/etc/ssl/certs/{{ otree_domain }}.crt" ssl_certificate_path: "/etc/ssl/certs/{{ otree_domain }}.crt"
ssl_certificate_key_path: "/etc/ssl/private/{{ otree_domain }}.key" ssl_certificate_key_path: "/etc/ssl/private/{{ otree_domain }}.key"
ufw_ssh_allowed_from:
- "192.168.0.0/16"
- "172.16.0.0/12"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment