-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
fix(ssh): Support authless connection #723
Comments
if I understand correctly @jinnatar , you suggest trying to preform health checks by connecting to address and checking for a banner? |
That was my initial idea of what would be a reasonable check if auth won't even be attempted. It could however just as well be a standlone TCP check with config options for command to send and allowlist & denylist matching for banner content. As an example of a second use case, just now I'm trying to monitor an uppity NUT daemon that occasionally just stops communicating with the UPS which is obvious from a very basic call So long answer short, it may not make sense to modify the ssh check, but instead modify the tcp check which would solve a whole class of similar issues. |
@jinnatar maybe it should be opened as a separate issue since it seems that a generalized solution will be more complex, however the "no auth attempt" use case might be common enough that it will be worth to implement, even if it will be removed in a different update. |
Hm, would it be possible to use the no-auth approach automatically if no username/password are provided? |
@TwiN I think we could, gatus/config/endpoint/endpoint.go Lines 365 to 376 in b650518
since we wouldn't be connected to it, we wouldn't be able to execute commands inside the shell, meaning we would have to check for username and password early and handle a health check to the endpoint and return. |
I wonder how nice this would play with something like Fail-2-Ban. You might get failures because its banned the IP you check from. |
A quick scan through some fail2ban discussions seems to indicate a closed connection without auth would not trip by default, but probably would trip if set to agressive mode. I'd say it would be worth a caution line in documentation that agressive fail2ban configs may be tripped by testing that does not attempt to auth. |
that said too, if the IP is also known for the Gatus checking server a white list could be added if they are in |
@jinnatar @stuartskelton I wouldn't mind adding to the documentation on my PR, as I am not familiar with fail2ban, is it something that justifies a note on the docs? |
I think something in the docs to remind people SSH limiting and Tar pitting is a still a thing. UFW (the firewall in Ubuntu) can also apply |
Describe the feature request
A mode of the SSH check that would only check for a valid SSH connection banner. It's an upgrade from a plain TCP check but lighter weight than a full SSH check as done today.
An example of a borked OpenSSH server that passes a TCP check:
... After which the connection terminates.
An example of a functioning OpenSSH server:
... After which the connection terminates.
Why do you personally want this feature to be implemented?
While the current SSH check does allow checking an SSH endpoint it has limitations that I'd love to overcome:
How long have you been using this project?
1y
Additional information
The banner check is just the first idea I was able to confirm in a real scenario. If someone knows a bit more of the protocol then perhaps there's more quick wins a bit deeper. But, then again a quick "does the server send any banner after TCP open would already be a big improvement.
The text was updated successfully, but these errors were encountered: