Hallo Claus Fischer,

21.08.26 15:59 Claus Fischer:
> I have written AdmitSSH, a fork of OpenSSH that puts a small
> cryptographic admission exchange in front of the SSH protocol. I have
> used Debian for twenty-five years and would like to maintain AdmitSSH as
> a Debian source package. Before I go further I would value your advice
> on how to get there.
> 
> The problem.
> 
> A colleague and I run test machines on the public internet. Scanning has
> grown to the point where the rate limiting meant to stop it stops us: on
> one host more than half of fresh SSH connections are refused, while
> sessions carried over an established ControlMaster remain reliable. What
> fails is connection setup, not authentication, and it makes scripted
> administration unworkable. MaxStartups, PerSourcePenalties and moving
> the port do not help, because the load is the connection attempts
> themselves; our administrators come from changing addresses, so a source
> filter is not an option either.

Have you thought about using either of:
- raising limits, allowing pubkey auth only and not caring about log spam,
  maybe also lowering LoginGraceTime
- dynamic firewalling (port knocking or something simpler)
- IPSEC AH for ssh access

> What it does.
> 
> AdmitSSH adds a short dialogue between server and client in front of the
> proper SSH protocol. The client must prove knowledge of a pre-shared
> secret before it is admitted. The secret itself never travels on the
> wire and stays secret, and a client that cannot prove it is refused at
> the cost of one read and one comparison - before any key exchange,
> before the fork, and without writing to the authentication log.
> 
> What it is not.
> 
> It is not authentication. The key is one secret shared by a group, so it
> says nothing about who is connecting; SSH still makes every decision it
> made before. What it changes is the economics of being scanned. It also
> changes what a failed login means: on an AdmitSSH host the attempt can
> only come from a client that already passed the filter, whereas on an
> ordinary host failed logins are constant and carry no information.
> 
> Maintenance.
> 
> I will track your releases as my upstream and keep AdmitSSH in step with
> them. The filter also addresses the problem that attacks begin as soon
> as a security deficiency is published: the scanning that follows a
> disclosure does not reach the daemon behind it.
> 
> Why a fork and not an option.
> 
> The admission exchange takes place before the SSH identification string,
> so a server that requires it is not speaking SSH until the client has
> been admitted. That cannot be reduced to a configuration setting in
> openssh: it would produce a daemon that is sometimes SSH and sometimes
> not, which is confusing to reason about and a poor thing to get wrong.
> AdmitSSH is therefore a complete and separate set of executables, man
> pages and configuration. It installs alongside openssh, shares nothing
> with it, and changes nothing about it; the two packages are entirely
> independent of each other.

You could also have a shim wrapper (like tcpd) around sshd in inetd mode and a 
ProxyCommand for ssh to do your pre-handshake. Benefits:
1. transparent for client tools (ansible, rsync, etc.) with a Host/Match
   section in ssh_config
2. less work: no fork needed
3. minimal dependencies: only a low-level crypto library
4. ability to implement in language of choice
5. easy migration from your variant in case you already deployed it
6. independance from next protocol: not limited to ssh

When thinking about 6.: there might already be such (but incompatible, 
defeating 5.) solutions.


Grüße
Timo

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to