Bug 1282 - Log which key used for authentication
Summary: Log which key used for authentication
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All All
: P2 security
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-10 02:19 AEDT by Brian Beaudoin
Modified: 2008-04-04 09:58 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Beaudoin 2007-02-10 02:19:50 AEDT
In INFO mode, the number of the key in .ssh/authorized_keys isn't logged (though sshd does log the fact a public key was used for authentication).  The same issue occurs when a valid key is used from an invalid host (the system logs that a valid key was presented, but not which one).

The man page states that DEBUG logging level is not recommended for privacy reasons; there is a real need to audit connections based on the keys used from which hosts.  Could this logging feature be moved from DEBUG to INFO to alieviate audit concerns without the additional verbosity?
Comment 1 Damien Miller 2007-02-10 05:31:42 AEDT
Have you tried "LogLevel VERBOSE"?
Comment 2 Damien Miller 2007-06-12 21:30:58 AEST
Yes, I just reverified this - the fingerprint is definitely logged at Loglevel=verbose
Comment 3 Brian Beaudoin 2007-06-23 04:06:55 AEST
Unfortunately LogLevel VERBOSE logs the fingerprint of the private key, not the public key.  If we don't have the private key that is being abused, we still don't know which key is being abused.

LogLevel DEBUG prints which line the public key is on, but not the fingerprint of the public key itself.  If the order of this file is changed, we still wouldn't know which key to remove from the server.

The actual solution would be logging the fingerprint of the PUBLIC key.  Then if the private key is abused, we can revoke the corresponding public key in the "authorized_keys" file.
Comment 4 Damien Miller 2007-06-23 10:03:35 AEST
It *is* the public key fingerprint that is logged (it has to be, public key authentication would be completely broken security-wise if the server got to see the private key).
Comment 5 Brian Beaudoin 2007-06-24 06:23:42 AEST
The private key fingerprint is *NOT* the private key (it is an MD5 hash).  Anyway, that's neither here nor there.

I've confirmed it is the public key fingerprint that is being logged; there was some confusion about *which* fingerprint "puttygen" was displaying when a private key is opened (openssl dsa will show the proper private key fingerprint and ssh-keygen -l works correctly on public keys).
Comment 6 Damien Miller 2008-04-04 09:58:20 AEDT
Close resolved bugs after release.