Skip to content

Commit 2db75b5

Browse files
authored
make it possible to configure more then yes and no for PermitTunnel (#715)
This is a breaking change, since the default variable is now a string instead of a bool Signed-off-by: Sebastian Gumprich <[email protected]>
1 parent aea12c8 commit 2db75b5

File tree

6 files changed

+26
-9
lines changed

6 files changed

+26
-9
lines changed

Diff for: .aar_doc.yml

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ output_template: |
1919
- Description: {{ details.display_description }}
2020
- Type: {{ details.display_type }}
2121
- Required: {{ details.display_required }}
22+
{%- if details.choices %}
23+
- Choices:
24+
{%- for choice in details.choices %}
25+
- {{ choice }}
26+
{%- endfor %}
27+
{%- endif %}
2228
{%- endfor %}
2329
{%- endfor %}
2430

Diff for: molecule/ssh_hardening_custom_tests/converge.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
ssh_authorized_keys_file: '/etc/ssh/authorized_keys/%u'
3939
ssh_max_auth_retries: 10
4040
ssh_permit_root_login: "without-password"
41-
ssh_permit_tunnel: true
41+
ssh_permit_tunnel: 'yes'
4242
ssh_print_motd: true
4343
ssh_print_last_log: true
4444
ssh_banner: true

Diff for: roles/ssh_hardening/README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,15 @@ Warning: This role disables root-login on the target server! Please make sure yo
272272
- Type: str
273273
- Required: no
274274
- `ssh_permit_tunnel`
275-
- Default: `false`
276-
- Description: Set to `true` if SSH Port Tunneling is required.
277-
- Type: bool
275+
- Default: `no`
276+
- Description: Specifies whether tun(4) device forwarding is allowed. The argument must be yes, point-to-point (layer 3), ethernet (layer 2), or no. Specifying yes permits both point-to-point and ethernet.
277+
- Type: str
278278
- Required: no
279+
- Choices:
280+
- no
281+
- yes
282+
- point-to-point
283+
- ethernet
279284
- `ssh_print_debian_banner`
280285
- Default: `false`
281286
- Description: Set to `true` to print debian specific banner.

Diff for: roles/ssh_hardening/defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ ssh_client_alive_interval: 300 # sshd
6565
ssh_client_alive_count: 3 # sshd
6666

6767
# Allow SSH Tunnels
68-
ssh_permit_tunnel: false
68+
ssh_permit_tunnel: "no"
6969

7070
# Hosts with custom options. # ssh
7171
# Example:

Diff for: roles/ssh_hardening/meta/argument_specs.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,15 @@ argument_specs:
6363
before disconnecting clients.
6464
type: int
6565
ssh_permit_tunnel:
66-
default: false
67-
type: bool
68-
description: Set to `true` if SSH Port Tunneling is required.
66+
default: 'no'
67+
description: Specifies whether tun(4) device forwarding is allowed. The argument
68+
must be yes, point-to-point (layer 3), ethernet (layer 2), or no. Specifying
69+
yes permits both point-to-point and ethernet.
70+
choices:
71+
- 'no'
72+
- 'yes'
73+
- point-to-point
74+
- ethernet
6975
ssh_remote_hosts:
7076
default: []
7177
type: list

Diff for: roles/ssh_hardening/templates/opensshd.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ ClientAliveInterval {{ ssh_client_alive_interval }}
192192
ClientAliveCountMax {{ ssh_client_alive_count }}
193193

194194
# Disable tunneling
195-
PermitTunnel {{ 'yes' if (ssh_permit_tunnel|bool) else 'no' }}
195+
PermitTunnel {{ ssh_permit_tunnel }}
196196

197197
# Disable forwarding tcp connections.
198198
# no real advantage without denied shell access

0 commit comments

Comments
 (0)