feat(justfile): interactive SSH shorthands per Linux unit #20
Loading…
Reference in a new issue
No description provided.
Delete branch "fm/dse-security-reports-ssh-shortcuts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Reaching the Linux units meant typing a long ssh command with a config path, login name and options, or looking the endpoint up by hand.
This adds one
just ssh-<short>recipe per Linux unit that opens an interactive shell as the admin account, with every connection detail resolved at run time.The endpoint resolution was factored out of
scripts/ssh_evidence.shinto the sourced, sharedscripts/ssh_common.sh-- factoring was chosen over mirroring so the evidence collector and the shorthands resolve through exactly one implementation and can never disagree about where a machine is.What changed
scripts/ssh_common.sh(new): the shared resolution -- committed mappingsshAlias, candidate ansible ssh.cfg files in order, raw-address detection -- plus the shared option assembly (batchvsinteractive): same account, sameConnectTimeout,-F <ssh.cfg>for aliases,StrictHostKeyChecking=accept-newfor address-based connections.scripts/ssh_connect.sh(new): resolves a unit through the shared library and execs ssh interactively (deliberately noBatchMode, unlike the evidence collector which must fail rather than prompt);--print <machine>prints the command that would run without connecting,--listresolves every unit with an SSH path and prints shorthand plus endpoint; an unresolvable unit fails with a message naming the unit, never a silent no-op or a connection attempt against an empty host.scripts/ssh_evidence.sh: sources the shared library instead of its inline resolution; the assembled batch options, account, timeout and skip behavior are unchanged.Justfile: eightssh-<short>recipes (short = lowercased machine name without theASP-prefix, e.g.just ssh-dse-prod-wireguard; the WireGuard evidence-only unit is included) plusssh-list; the recipes carry only unit names -- no IP, hostname, key or config path lives in the Justfile, verified by reading the final file.README.md: two brief bullets in the pipeline map pointing at the recipes (the task explicitly asked for the docs entry in the pipeline documentation; the README is otherwise handwritten, so these two lines deserve close review).AGENTS.md: one sentence pointing at the shorthands and the shared resolution.Behaviour change
The evidence collector behaves exactly as before (same options, same skips, same cache handling); new interactive recipes open shells on the eight Linux units, and
just ssh-list/./scripts/ssh_connect.sh --print <machine>make the resolution inspectable offline.The three Windows units are out of scope by design (no Linux, no SSH path) and get no shorthand.
Verification without a live connection:
just allandjust repropass on the synthetic fixture (byte-identical PDFs);just ssh-listresolves all eight units offline (analytics and myride through their own ssh.cfg, QMS and VS by raw address withaccept-new);--printshows the exact command per unit; a unit without a resolvable endpoint (e.g.ASP-DSE-PROD-MISC) and a unit whose alias no ssh.cfg defines both fail with messages naming the unit.No render was required for this change:
reports/is untouched (concurrently owned by another task), no PDF was re-rendered and nothing was published into the artifacts dir.Instructions-PR: none