Skip to content

feat(keyring): revocable share link for SSH public keys - #267

Merged
sh1pt-actions-fleet[bot] merged 2 commits into
masterfrom
feat/keyring-share
Oct 29, 2026
Merged

sh1pt-actions-fleet[bot] merged 2 commits into
masterfrom
feat/keyring-share

Conversation

@sh1pt-actions-fleet

Copy link
Copy Markdown
Contributor

Piece 1 of fleetbar (w3bs.org/fleet + threatcrush.com/fleet via crawlproof SSH checks).

  • Migration 009_keyring_shares (SQLite + Postgres): keyring_shares (id, user_id unique, token_hash unique, created_at, rotated_at). Only sha256(token) stored.
  • POST /api/keyring/share creates or rotates and returns { url, keys_url_text, token } once; GET returns { exists, created_at, rotated_at }; DELETE revokes. Auth: a person's Bearer lsk_ key or a browser session (session writes need the X-CSRF-Token double-submit header, since the app-wide guard skips /api). Machine keys 403.
  • Public GET /k/<lks_token>.json -> { keys: [{ name, type, public_key, fingerprint, comment }] } and /k/<token>.keys (authorized_keys). Only ssh-* entries whose public key parses (blob algorithm must match); fingerprint computed from the key as ssh-keygen prints it. Access-Control-Allow-Origin: *, Cache-Control: public, max-age=60, CORP cross-origin, no Set-Cookie (mounted before the session middleware). Unknown/revoked -> 404. Per-IP in-memory limit, 120/min -> 429.
  • /keyring: "Share public keys" box with create / copy / rotate / revoke.
  • docs/keyring.md: Share public keys section.

Tests: apps/pwa/test/keyring-share.test.mjs (auth, CSRF, create/rotate/revoke, public halves only, fingerprints, CORS, cross-user isolation, rate limit). Full PWA suite 96/96.

🤖 Generated with Claude Code

…son|.keys)

Migration 009_keyring_shares (one per user, sha256(token) only). POST/GET/DELETE
/api/keyring/share for a person key or a browser session (CSRF header on
writes; machine keys 403). Public /k/<lks_ token>.json and .keys expose only
ssh-* public halves with ssh-keygen fingerprints computed from the key, CORS *,
public max-age=60, 404 when unknown or revoked, per-IP rate limit. /keyring
gets a Share public keys box (create, copy, rotate, revoke); docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

ThreatCrush Security Scan

60 finding(s)

HIGH/CRITICAL: 6 | MEDIUM: 24 | LOW: 30

Severity Rule Location
HIGH secret-private-key apps/pwa/src/routes/keyring.mjs:32
HIGH secret-private-key packages/cli/src/keyring.ts:83
HIGH secret-private-key packages/logicsrc-mcp/src/keyring.ts:20
HIGH secret-private-key plugins/credential-sharing/src/providers/ssh.ts:129
HIGH js-host-header-trust apps/commandboard-web/server.js:27
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
MEDIUM js-unescaped-html-sink apps/commandboard-web/src/main.ts:19
MEDIUM sh-remote-script-execution apps/logicsrc-web/public/install.sh:71
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/app/[[...slug]]/page.tsx:59
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/app/layout.tsx:80
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/app/pricing/page.tsx:42
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/components/breadcrumbs.tsx:43
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/components/pit-footer.tsx:16
MEDIUM js-unescaped-html-sink apps/logicsrc-web/src/components/site-shell.tsx:36
MEDIUM js-unescaped-html-sink apps/pwa/public/keyring.js:51
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:228
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:272
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:274
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:278
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:282
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:301
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:302
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:365
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:372
MEDIUM redos-nested-quantifier packages/cli/src/rotation-catalog.ts:378
MEDIUM redos-nested-quantifier packages/opencontext/src/ids.ts:10
MEDIUM redos-nested-quantifier packages/opencontext/src/ids.ts:11
MEDIUM js-timing-unsafe-mac-compare packages/opencontext/src/validate.ts:208
MEDIUM redos-nested-quantifier packages/openerrand/src/browser.ts:34
MEDIUM redos-nested-quantifier packages/openontology/src/ids.ts:20
LOW secret-generic-credential apps/pwa/test/appbar.test.mjs:10
LOW secret-private-key apps/pwa/test/keyring.test.mjs:137
LOW secret-generic-credential apps/pwa/test/signup-profile.test.mjs:61
LOW secret-generic-credential apps/pwa/test/signup-profile.test.mjs:72
LOW secret-private-key packages/cli/src/keyring.test.ts:86
LOW secret-private-key packages/cli/src/keyring.test.ts:88
LOW secret-private-key packages/cli/src/rotate-flow.test.ts:125
LOW secret-generic-api-key packages/cli/src/rotate-flow.test.ts:177
LOW secret-generic-credential packages/cli/src/rotate-flow.test.ts:184
LOW secret-generic-api-key packages/cli/src/rotate-flow.test.ts:198
LOW secret-generic-credential packages/cli/src/rotate-flow.test.ts:204
LOW secret-generic-credential packages/cli/src/rotators.test.ts:52
LOW secret-generic-credential packages/cli/src/rotators.test.ts:75
LOW secret-generic-credential packages/cli/src/rotators.test.ts:135
LOW js-hardcoded-crypto-key packages/cli/src/rotators.test.ts:222
LOW secret-database-url packages/cli/src/rotators.test.ts:258
LOW secret-database-url packages/cli/src/vault-clean.test.ts:10
LOW secret-private-key packages/logicsrc-mcp/src/keyring.test.ts:41
LOW secret-private-key packages/logicsrc-mcp/src/keyring.test.ts:44
LOW secret-aws-access-key packages/opencontext/src/permissions.test.ts:260

…and 10 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

…eatCrush)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot merged commit d03acc0 into master Oct 29, 2026
6 checks passed
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot deleted the feat/keyring-share branch October 29, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants