Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'sshd-39' - the value for AllowTcpForwarding parameter should be limited to either 'no' or 'local' #216

Open
MikhailAseev opened this issue Aug 21, 2024 · 0 comments · May be fixed by #217

Comments

@MikhailAseev
Copy link

MikhailAseev commented Aug 21, 2024

Description

The title for the rule 'sshd-39' is 'Server: Disable TCP forwarding'.
The description is 'If you use TCP forwarding in an uncontrolled manner then you can bypass the firewalls'.
I suggest that the value for AllowTcpForwarding SSH server parameter in this particular rule (with such title and description) should be limited to the following:

  • 'no' as it prevents all TCP forwarding;
  • 'local' as it allows local forwarding only.

This will suite the title and the description more than it is now.

Solution

I suggest removing input for AllowTcpForwarding SSH server parameter:

sshd_tcpforwarding = input('sshd_tcpforwarding', value: 'no')

And replace the line:

    its('AllowTcpForwarding') { should eq(sshd_tcpforwarding) }

with:

    its('AllowTcpForwarding') { should match(/^no|local$/) }
@MikhailAseev MikhailAseev linked a pull request Aug 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant