diff --git a/openssh/iptables-input.sls b/openssh/iptables-input.sls index d8414f2..fc03540 100644 --- a/openssh/iptables-input.sls +++ b/openssh/iptables-input.sls @@ -1,3 +1,7 @@ +{% from "openssh/map.jinja" import openssh with context %} +{% set openssh_pillar = pillar.get('openssh', {}) %} +{% set listen_port = openssh_pillar.get('listen_port', '22') %} + sshd.iptables.input: iptables.insert: - table: filter @@ -5,7 +9,7 @@ sshd.iptables.input: - position: 1 - match: state - connstate: NEW,ESTABLISHED - - dport: 22 + - dport: {{ listen_port }} - proto: tcp - jump: ACCEPT - save: True