Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLI
AssigneesNone

Relationships

#938 swamp serve: add @keychain=<service>/<account> indirection for secret args on macOS

Opened by stack72 · 7/3/2026

Context

`--webhook :@env=` and `--webhook :@file=` already exist as ways to pass a secret without putting it in argv. On macOS, the OS-native secret store is Keychain, reachable from a shell via:

``` security find-generic-password -s -a -w ```

Keychain items are audited, rotated through the Keychain Access UI or `security`, ACL-guarded per app, and unlocked by the login session — a better default than a `chmod 600` file mirroring the swamp vault.

Today, operators who want Keychain-backed webhook secrets still need a wrapper script that reads Keychain and either exports an env var (`@env=`) or materialises a tmpfile (`@file=`). launchd plists can't run `security` from `EnvironmentVariables`.

Ask

Add a third indirection scheme alongside `@env=` and `@file=`:

``` --webhook '/hooks/linear:linear-webhook:@keychain=hivemq.asdlc/linear-webhook-secret:linear' ```

Semantics: `@keychain=/` shells out to (or replicates) `security find-generic-password -s -a -w` at serve start (and on config reload if that lands). No-op on non-macOS platforms — swamp can either refuse the spec at parse time on Linux, or fall back to nothing and log.

Optional refinements:

  • Support the login keychain by default, with an optional `:` suffix (`@keychain=svc/acct:~/Library/Keychains/login.keychain-db`).
  • Support cache TTL so a rotated Keychain item takes effect on the next serve restart without an explicit rehandle.

Anti-goals

  • Not asking swamp to write Keychain items — read-only.
  • Not asking for cross-platform semantics beyond "no-op / clear error on non-macOS".

Impact

macOS operators can point serve directly at Keychain, drop the wrapper, and get rotation through native tooling. Complements #1738 (`@vault=`) — same feature, different backend.

Prior art

  • `@env=` / `@file=` webhook indirection (existing).
  • #1738 — `@vault=` indirection for `swamp vault`-stored secrets.

Automoved by swampadmin from https://github.com/swamp-club/swamp/issues/1739

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

7/3/2026, 11:18:10 AM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.