Community-VyProjects / Community-VyProjects/VyManager

Per-instance SSH key encryption (HKDF) with re-encrypt migration

Open
#465 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
TypeScript
Stars
446
Forks
65
Avg merge
52m
Merged PRs (30d)
156

Description

Seventh hardening-chain link. Instance SSH private keys are all encrypted at rest under the single global SSH_ENCRYPTION_KEY, so a leaked ciphertext plus the master exposes every instance and there is no per-instance rotation.

Change

Keys are encrypted under a per-instance key: HKDF-SHA256(SSH_ENCRYPTION_KEY, info=instanceId). The master secret is unchanged — no new configuration; per-instance domain separation means a leaked ciphertext exposes only one instance. decrypt_private_key tries the derived key and falls back to the raw master, so pre-migration ciphertexts still decrypt (graceful, reversible). A one-time scripts/migrate_ssh_keys.py re-encrypts every stored key from master to derived inside one transaction, verifying each round-trips before writing, idempotent, with --dry-run.

Tests / rehearsal

Unit tests for derivation + fallback. Rehearsed on a seeded database: master-encrypted key decrypts via fallback pre-migration; migration re-encrypts (round-trip verified); decrypts under derived after; second run is a no-op.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing decrypt_private_key flow and reviewing scripts/migrate_ssh_keys.py. Verify the derivation and fallback behavior, migration round trips, transaction safety, idempotence, and --dry-run behavior against the seeded-database rehearsal described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
backend, databases, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.