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

TCPKeepAlive no or yes? #120

Closed
rilindo opened this issue Feb 8, 2016 · 8 comments
Closed

TCPKeepAlive no or yes? #120

rilindo opened this issue Feb 8, 2016 · 8 comments

Comments

@rilindo
Copy link

rilindo commented Feb 8, 2016

I see that Lynis is flagging TCPKeepAlive if is set to no:

[17:44:59] Test: Checking TCPKeepAlive in /etc/ssh/sshd_config
[17:44:59] Result: Option TCPKeepAlive found in /etc/ssh/sshd_config
[17:44:59] Result: Option TCPKeepAlive value is NO
[17:44:59] Result: SSH option TCPKeepAlive is in a weak configuruation state and should be fixed
[17:44:59] Suggestion: Consider hardening SSH configuration [test:SSH-7408] [details:TCPKeepAlive (NO --> YES)] [solution:-]

Why would we want to turn it on? TCPKeepAlive apparently has spoofing issues, so it is recommend that be turn off:

https://drupal.star.bnl.gov/STAR/comp/sofi/facility-access/ssh-stable-con

@rhyven
Copy link
Contributor

rhyven commented Feb 8, 2016

Thanks for bringing that to my attention, @rilindo. You're quite right. It seems that there's no actual exploitable vulnerability with TCPKeepAlive(1) -- yet. But let's fix this.

After a bit of reading this morning (thanks again), I've found:

TCPKeepAlive: This option only uses TCP keepalives (as opposed to using ssh level keepalives)

vs

ServerAliveInterval: The server alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable.

(Ref: man page for ssh_config)

It appears much more appropriate for Lynis to:

  • Ensure TCPKeepAlive is set to No
  • Suggest that ServerAliveInterval could be set to a value greater than zero (2)

@mboelen @kboratynski -- sound good?

(1) http://unix.stackexchange.com/questions/208055/is-sshd-config-tpckeepalive-still-using-unencrypted-channel-and-therefore-vulner

(2) http://unix.stackexchange.com/questions/34004/how-does-tcp-keepalive-work-in-ssh

@mboelen
Copy link
Member

mboelen commented Feb 9, 2016

Implemented. @rilindo and @rhyven: can you test if the changes give the expected on your system as well?

@rilindo
Copy link
Author

rilindo commented Feb 9, 2016

For the TCPKeepAlive, that worked. Yay! Thank you!

For ServerAliveInterval, not so much:

- SSH option: ServerAliveInterval [ NOT FOUND ]

And I did confirm that it is set:

vagrant@vagrant-ubuntu-trusty-64:~$ grep ServerAliveInterval /etc/ssh/ssh_config ServerAliveInterval 2

@mboelen
Copy link
Member

mboelen commented Feb 9, 2016

Thanks @rilindo. I've added the missing value. Does it now work for you?

@rilindo
Copy link
Author

rilindo commented Feb 9, 2016

It appears that lynis is look for the ServerAliveInterval parameter in /etc/ssh/sshd_config. ServerAliveInterval is actually a parameter that is set in /etc/ssh/ssh_config (which I confirmed in the man pages).

@rhyven
Copy link
Contributor

rhyven commented Feb 9, 2016

@mboelen new PR for you ;-) I've just arrived at work so I'm about to give this a spin here too.

@ghost
Copy link

ghost commented Feb 9, 2016

@rhyven It's OK for me. @mboelen -- I have to agree totally.

-- K.

@rhyven
Copy link
Contributor

rhyven commented Mar 4, 2016

@mboelen - pretty sure these have been addressed. OK to close I reckon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants