Repository navigation
feat(ssh-grant): one tap for SSH logins to a list of hosts - #64
Merged
Merged
Conversation
nodkey ssh-grant asks once for logins as one user to listed hosts for N minutes; grants end at the second the message shows. Closes #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
nodkey ssh-grant --key NAME --user USER --host NAME... --for DURATION [--reason TEXT]: one tap pre-approves SSH logins as one user to a list of hosts for N minutes, for example one Ansible run (DESIGN.md section 13, decision 4).nodkey ssh-agentto exactly those hosts (all their host keys), as that user, with that key, need no further tap until the end shown. Other hosts, users, keys and clients still ask.window;--forlonger than the key's window; a host not inknown_hostsor not in the key'shosts; 0 or more than 20 hosts; an unknown key or one the client may not use.nodkey run; its last line is, for example,nodkey: SSH logins as deploy to 2 hosts allowed until 14:20 (exit 0).Tests
Against the real broker service over mutual TLS with the fake approver: approve (then logins to the listed hosts are signed without a tap and others ask), deny, expiry, cancel, signals, every broker refusal (also raw requests the client would never send), look-alike host names, duplicates, a reason that tries to fake verified lines, a Deny that ends the grants, the end time to the second, a hang-up after the tap; golden tests of the message. Stress runs pass on Go 1.27 and 1.26. Also fixes two flaky tests (
TestRunInterrupted,TestHangUpBeforeSign).Docs
DESIGN.md sections 9, 13 and 15; THREAT-MODEL.md T1 and T8; AGENTS.md layout.
Review
Two rounds with the security-reviewer agent; the last said "ready to commit". No grant reaches another host, user, key or client, lasts longer than shown, or survives a Deny.
Closes #14