How ricardoleal/bastionctl works
bastionctl discovers and ranks AWS EC2 pivots, saves named connections, then checks and hands tunnel operations to the host’s sshuttle binary. The main documented path is interactive discovery through reachability checks and candidate selection, followed by SSH verification and saving; later runs manage the saved tunnel. Separate capabilities include a terminal browser, split-DNS setup, and simulated demo mode. Edges rely on README workflow statements or shown package behavior; the full main/UI implementation was not sampled, so finer call ownership is not inferred.
Main entry points: main.go CLI workflow · dnsresolver.go Split-DNS manager · aws.go AWS discovery · darwin.go macOS resolver
Components 18
Application flow
- CLI workflow
main.go
Pivot discovery
- AWS discovery
internal/awsclient/aws.go - AWS profiles
internal/awsclient/profiles.go - Candidate probing
internal/probe/probe.go - CIDR checks
internal/netcidr/netcidr.go - SSH verification
internal/sshtest/sshtest.go
Connections and DNS
- Connection store
internal/config/config.go - Split-DNS manager
internal/dnsresolver/dnsresolver.go - macOS resolver
internal/dnsresolver/darwin.go - Linux resolver
internal/dnsresolver/linux.go
Terminal and tunnel
- Connection browser
internal/ui/app.go - Interactive selection
internal/ui/select.go - Demo browser
demo.go - Tunnel control
internal/sshuttlecmd/sshuttlecmd.go
Other components
- Operator
- System sshuttle
- AWS APIs
- OS resolver
Connections 18
- Operator → CLI workflow: invokes
README.md - CLI workflow → AWS discovery: discovers
README.md - CLI workflow → AWS profiles: resolves credentials
README.md - AWS discovery → AWS APIs: queries
README.md - CLI workflow → Candidate probing: tests candidates
README.md - CLI workflow → CIDR checks: checks egress
README.md - CLI workflow → Interactive selection: presents candidates
README.md - CLI workflow → SSH verification: re-verifies target
README.md - CLI workflow → Connection store: saves connection
README.md - CLI workflow → Tunnel control: manages tunnel
README.md - Tunnel control → System sshuttle: launches
README.md - CLI workflow → Connection browser: opens browser
README.md - Operator → Demo browser: requests demo
README.md - CLI workflow → Split-DNS manager: manages split DNS
README.md - Split-DNS manager → macOS resolver: installs on macOS
internal/dnsresolver/dnsresolver.go - Split-DNS manager → Linux resolver: installs on Linux
internal/dnsresolver/dnsresolver.go - macOS resolver → OS resolver: writes resolver files
internal/dnsresolver/darwin.go - Linux resolver → OS resolver: configures network
README.md