Commit 1ea699c9c19bbd00bc9dab95f6719a0e1ded6d2c

Authored by Sergio Oliveira
1 parent 9b521d8c

Use integration as SSH gateway

cookbooks/firewall/templates/default/iptables.erb
... ... @@ -18,8 +18,8 @@
18 18  
19 19 -A INPUT -i lo -j ACCEPT
20 20  
21   -# Everybody need to accept SSH from reverseproxy
22   --A INPUT -s <%= node['peers']['reverseproxy'] %> -p tcp -m state --state NEW --dport 22 -j ACCEPT
  21 +# Everybody need to accept SSH from integration
  22 +-A INPUT -s <%= node['peers']['integration'] %> -p tcp -m state --state NEW --dport 22 -j ACCEPT
23 23  
24 24 <%= node['firewall'] %>
25 25 <%= render 'iptables-filter.erb' %>
... ...
cookbooks/firewall/templates/host-integration/iptables-filter.erb
1 1  
2 2 # Allow HTTP access
3 3 -A INPUT -s <%= node['peers']['reverseproxy'] %> -p tcp -m state --state NEW -m multiport --dports 80,443 -j ACCEPT
  4 +
  5 +# Allow SSH connections redirected from integration
  6 +-A INPUT -s <%= node['peers']['reverseproxy'] %> -p tcp -m state --state NEW --dport 22 -j ACCEPT
... ...
cookbooks/firewall/templates/host-reverseproxy/iptables-filter.erb
... ... @@ -6,4 +6,4 @@
6 6 -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
7 7  
8 8 # Real SSH connection
9   --A INPUT -p tcp -m state --state NEW --dport <%= node['config']['alt_ssh_port'] %> -j ACCEPT
  9 +-A INPUT -s <%= node['peers']['integration'] %> -p tcp -m state --state NEW --dport <%= node['config']['alt_ssh_port'] %> -j ACCEPT
... ...