Relationships
#1789 Only documented non-interactive auth puts the password in argv; the safe SWAMP_API_KEY path is undocumented
Opened by randybias · 8/22/2026· Shipped 8/23/2026
The only documented way to authenticate non-interactively puts the credential on the command line; the way that avoids it is undocumented.
Measured on swamp --version 20260822.011157.0-sha.06b61472.
swamp auth login --help offers exactly one non-interactive route, and gives it as the worked example:
Non-interactive login swamp auth login --username alice --password secret --no-browserA password in argv is readable by any process on the host via /proc/<pid>/cmdline, lands in shell history, and appears in process listings. For an agent-driven or CI-driven setup — which is where non-interactive login is needed — that is the default path.
There is a safe alternative, but it is not documented anywhere I could find:
SWAMP_API_KEYworks. I found it in the binary's strings, not inswamp auth --help,swamp auth login --help, orswamp help auth(which lists onlySWAMP_CLUB_URL).swamp auth server-login --tokenexists and takes a token, but targets aswamp serveinstance (SWAMP_SERVE_URL), not swamp-club, so it does not substitute.
With SWAMP_API_KEY set from a secret store, swamp auth whoami authenticates correctly and swamp issue works. It is a good mechanism — it is simply invisible unless you go looking in the binary.
Requests, either or both:
- Document
SWAMP_API_KEYinswamp auth --help/swamp auth login --help, the same way--serverdocumentsenv: SWAMP_CLUB_URL. This alone fixes it. - Add a stdin path —
--password-stdinor--token-stdin— so the documented non-interactive example does not require argv.docker login --password-stdinis the familiar precedent.
Also worth considering: change the --help example for non-interactive login to the env-var form, so the first thing an integrator copies is the safe one. The current example is the one people will paste into CI.
Context for why this bit us: our house rule forbids credentials in argv, so the documented path was unusable and the usable path was undiscoverable without reading the binary. We came close to concluding there was no supported non-interactive auth at all.
Shipped
Click a lifecycle step above to view its details.
stack72 commented 8/23/2026, 12:02:50 AM
Thanks @randybias for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.