Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneesstack72

Relationships

#511 Support vault-sourced identity keys

Opened by bixu · 6/1/2026· Shipped 6/3/2026

Problem

@swamp/ssh only accepts identityFile (a filesystem path) for SSH key authentication. When the private key lives in a vault (1Password, AWS SM, etc.), users must write a wrapper workflow that:

  1. Pulls the key from the vault to a temp file
  2. Runs the SSH operation
  3. Cleans up the temp file

This is error-prone (key left on disk if cleanup fails) and adds boilerplate to every workflow that uses SSH with vault-managed keys.

Proposed solution

Add an identityKey transport option that accepts a vault expression directly:

transport:
  kind: ssh
  identityKey: \${{ vault.get('my-vault', 'node-ssh-key/private-key') }}

When identityKey is set, @swamp/ssh would:

  • Write the key to a temp file with 0o600 permissions in a 0o700 directory
  • Pass the temp path as -i to OpenSSH
  • Clean up the file after the operation completes (in a finally block)

identityFile and identityKey should be mutually exclusive.

Alternatives considered

  • Current workaround: Provision/cleanup in a wrapper workflow using a custom model. Works but adds 2 extra jobs and leaves cleanup to the user.
  • Environment variable: OpenSSH doesn't support identity keys via env vars, so this isn't viable without a temp file internally anyway.

Upstream repository: https://github.com/systeminit/swamp-extensions

Environment

  • Extension: @swamp/ssh@2026.05.29.2
  • swamp: 20260527.235818.0-sha.ed572875
  • OS: darwin (aarch64)
  • Deno: 2.7.14+19bd3d8
  • Shell: /bin/zsh
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGEDCOMPLETE

Shipped

6/3/2026, 1:00:11 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/2/2026, 5:21:43 PM
stack72 marked as blocked6/2/2026, 6:04:48 PM
stack72 linked blocked by #5316/2/2026, 6:04:56 PM
stack72 unblocked6/3/2026, 1:24:38 AM
stack72 removed blocked by #5316/3/2026, 1:24:42 AM
Editable. Press Enter to edit.

stack72 commented 6/3/2026, 12:57:12 AM

Fixed in two places:

  1. Extension fix (shipped): @swamp/ssh@2026.06.03.1materializeTempKeys() now ensures identityContent ends with a trailing newline before writing the temp file. OpenSSH rejects PEM keys without one. PR: https://git.swamp-club.com/swamp-club/swamp-extensions/pulls/25

  2. CLI fix (shipped): swamp vault put no longer strips trailing newlines from multiline stdin content (PEM keys, certificates). Single-line values still have the trailing newline stripped as before.

@bixu both fixes are published — swamp update + swamp extension pull @swamp/ssh to pick them up.

Sign in to post a ripple.