Hacker News new | ask | show | jobs
by Bender 12 hours ago
I protect the trust of my keys more than the keys themselves as SSH keys have no concept of identity. I can append any key into any authorized keys file and become that person. The Feds will be asking that person a lot of tough questions they will be unable to answer.

Instead of the server looking in /home/$user/.ssh/authorized_keys, it looks in /etc/ssh/keys/%u, those files are set immutable and a small rust daemon watches them for changes and logs changes to syslog. Tampering with the daemon also creates syslog messages. One could also use Ansible to scan them for sha256sum changes.

The files in /etc/ssh/keys/ have CIDR block restrictions that say where my keys are valid from.

    from="10.x.x.x/x,1.x.x.x/x" ssh-ed25519 AAAA[snip...] comment
In the corporate world I put the Jira number for access to that role and username in the comment.

In the corporate world one could set the from=" " restrictions to VPN subnets that correspond to VPN LDAP/AD groups. Small numbers of trusted old timers could also have a static home IP address in the event the VPN is borked.

----------

Beyond SSH keys, if SSH Multiplexing is enabled in production, I can phish a SRE, get them to debug a program "I cant fix" that has a rookie bug, drop an obfuscated command in ~/.bashrc creating an outbound ssh tunnel to an anonymous sftp server that creates a gateway port, then I ssh to that port and I am on their laptop with no authentication. After they log into production using MFA+LDAP I can then ride a channel on their existing connection into production with no authentication or logging utilizing multiplexing (backdoor by design). No need for MFA or LDAP or malicious code. I am them. Then I can test if they have recently run sudo using 'sudo -n'. The best back-doors are those that people have been psychologically conditioned to defend.