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

Add ssh protocol probe (minimal, no command) #153

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

hv15
Copy link

@hv15 hv15 commented Oct 1, 2024

Hi there, I really like this project and have presented it to colleagues at work as a nice solution to trivially check on status of various machines. I've however found a limitation, that this PR tries to close. We have a lot of machines where the only network visible endpoint is the SSH port (running sshd); we also don't have ICMP activated, this is actively blocked by our firewall. Using the TCP probe is reasonable, but it causes a lot of noise in the sshd logs due to the connection not performing a suitable handshake with the daemon.

This PR provides an implementation to handle connecting to an SSH port, and resolve the handshake correctly, without needing to authenticate. This keeps the sshd logs clean, and means that the probe itself also checks that it's connecting to a working sshd. With TCP it's still possible to connect to an open port, and thus possible not report an issue, even if the listening process is in an unstable state

Note, this PR does not provide a completely new probe that supports SSH interactivity, e.g. running a command on a remote machine. Doing this is generally possible, but I think would need a more significant and careful refactoring of the probe module.

Some details:

  • provide SSH probe, can be set with ssh://<address>:22 (similar to the TCP probe)
  • built on the ssh2 crate

@valeriansaliou
Copy link
Owner

Thank you so much for the PR! I'll process it when I'm batching work on Vigil. LGTM to me checking the diff real quick.

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

Successfully merging this pull request may close these issues.

2 participants