Skip to content

Commit

Permalink
Merge pull request #208 from dev-sec/fix_207
Browse files Browse the repository at this point in the history
fix multiple match rules not working #207
  • Loading branch information
rndmh3ro authored Mar 20, 2019
2 parents a69a3ca + 20ca116 commit f0cbcc5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions templates/opensshd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ Match Group sftponly

{% for item in ssh_server_match_group %}
Match Group {{ item.group }}
{{ item.rules | indent(4) }}
{% for rule in item.rules %}
{{ rule | indent(4) }}
{% endfor %}
{% endfor %}
{% endif %}

Expand All @@ -267,6 +269,8 @@ Match Group {{ item.group }}

{% for item in ssh_server_match_user %}
Match User {{ item.user }}
{{ item.rules | indent(4) }}
{% for rule in item.rules %}
{{ rule | indent(4) }}
{% endfor %}
{% endfor %}
{% endif %}
8 changes: 6 additions & 2 deletions tests/default_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@
#ssh_server_enabled: false
ssh_server_match_group:
- group: 'root'
rules: 'AllowTcpForwarding yes'
rules:
- 'AllowTcpForwarding yes'
- 'AllowAgentForwarding no'
ssh_server_match_user:
- user: 'root'
rules: 'AllowTcpForwarding yes'
rules:
- 'AllowTcpForwarding yes'
- 'AllowAgentForwarding no'
ssh_remote_hosts:
- names: ['example.com', 'example2.com']
options: ['Port 2222', 'ForwardAgent yes']
Expand Down

0 comments on commit f0cbcc5

Please sign in to comment.