Skip to content

About

KyRecovery: central encrypted backup and restore for every Ky product, to disk or R2/S3

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

389 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KyRecovery

OpenSSF Best Practices OpenSSF Scorecard

Start here: Standalone installation. Local operator sign-in works without KyIdentity. The browser ceremony creates the recovery key and custodian cards; the server stores sealed capsules, public-key metadata and audit evidence. Stored capsules alone do not prove that a restore or off-site custody has been tested.

KyRecovery is a self-hosted blind store for the Ky Suite's encrypted backups. Products seal their own .kycap containers and deposit the ciphertext here. KyRecovery holds no recovery private key, no Shamir share and no plaintext, and there is no code path in the server that decrypts a capsule — a test, TestNothingInTheServerDecrypts, fails the build if one appears.

For supported key/TLS configuration and migration, read Strong-key configuration before upgrading an existing instance.

Quick start

v=<release version you intend to run>
mkdir kyrecovery && cd kyrecovery
curl -fsSLO "https://raw.githubusercontent.com/Busnes-app/KyRecovery-server/v$v/docker-compose.yml"

Pin the image: run the release verify-then-pin block at the top of that docker-compose.yml in this directory. It writes KYRECOVERY_IMAGE into .env. Releases up to 0.4.2 ship a compose file that forwards no settings and publishes on every interface; see Upgrading to the secure compose defaults.

Settings go in the same .env, which can hold secrets, so keep it mode 0600. The compose file passes .env to the container whole (Docker Compose 2.24 or later); an unset variable keeps its default. Single-quote a value that contains $.

chmod 600 .env
cat >> .env <<'EOF'
# KYRECOVERY_TRUSTED_PROXIES=<reverse proxy IP>
# KYRECOVERY_COOKIE_SECURE=true
# KY_ADMIN_INITIAL_PASSWORD='<password>'
EOF
docker compose up -d
curl -fsS --retry 10 --retry-all-errors --retry-delay 1 http://127.0.0.1:8095/healthz

The port is published on 127.0.0.1 only. Put a TLS reverse proxy on the same host in front of it, or set KYRECOVERY_BIND in .env to the host address your proxy reaches.

Behind a proxy, KYRECOVERY_TRUSTED_PROXIES is required, not optional. Without it every client shares the proxy's address, so a stranger's five wrong passwords lock the admin out and ten bad pairing codes block pairing for everyone. Set it to the address KyRecovery sees the proxy connect from, which with Docker is usually the network gateway (such as 172.18.0.1), not 127.0.0.1. To find it, open https://<your host>/api/installer/network through the proxy: clientIp is that address until it is trusted. The log also names it, once, when a forwarded request arrives from an untrusted peer.

On first start without KY_ADMIN_INITIAL_PASSWORD, the generated admin password is written to /app/data/initial-admin-password (0600, owned by uid 10001); the log names only the file. Read it with docker compose exec kyrecovery cat /app/data/initial-admin-password, sign in, change the password, then delete the file. Neither password is ever logged. Run the ceremony, then pair products.

The entrypoint runs as root only to chown ./data to uid 10001 on each start, then drops to that user, so ./data ends up owned by uid 10001, not your host account.

What it holds

  • kycap/3 containers exactly as deposited, plus the SHA-256 KyRecovery computed over each one at deposit.
  • The manifest fields the container declares about itself: capsule ID, service name, app version, payload hash, threshold, total shares, recovery key ID and encapsulated key. They are recorded and displayed, never acted on — the one decision taken from a manifest is whether its recovery key ID is the current one.
  • A hash-chained audit ledger over deposits, verifications, pairings and the key import, rotations and retirements, keyed outside the database.
  • The suite recovery public keys and their IDs: the current key, and any previous key still needed to open retained capsules. Custodian names, paired-app API tokens, and the server keyring for its own secrets.

License

KyRecovery is released under the MIT License.

OctoCounts

Documentation

  • Ceremony — Ceremony: creating the suite recovery keypair, and rotating it.
  • Deposits — Pairing and deposit.
  • Integrity and audit — Integrity, Audit ledger.
  • Retention — Backup retention.
  • Recovery and security — Restore, Security model, Upgrading from the previous KyRecovery.
  • Backup status — Backup status and restore planning.
  • Operations — CLI, Configuration, Verify, Upgrading to the secure compose defaults, and related procedures.
  • Verifying releases — Check a release image's signature and source commit, and rebuild its binary to the same bytes.
  • Assurance case — Threat model, trust boundaries, and why the security requirements are met.
  • Contributing — How to report bugs, propose changes, the test policy and the coding standard.

User manual

Read the online manual or browse its Markdown sources.

Build and check it with mdbook build docs and python3 docs/check-links.py, then open docs/book/index.html. The documentation workflow also provides a downloadable documentation-book artifact.

About

KyRecovery: central encrypted backup and restore for every Ky product, to disk or R2/S3

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages