diff --git a/.gitignore b/.gitignore index 6b6cafe..0078946 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,10 @@ !.env.example *.key *.pem +# Bare-hex secret files (e.g. `smirk-admin create-admin-wallet --out admin-key.hex`) +# so an operator running inside the checkout cannot commit the raw admin key. +*.hex +admin-key* *.p12 secrets/ secret_store/ diff --git a/PRIVACY.md b/PRIVACY.md new file mode 100644 index 0000000..2f969f3 --- /dev/null +++ b/PRIVACY.md @@ -0,0 +1,28 @@ +# Privacy Policy + +The canonical Smirk privacy policy lives at **https://smirk.cash/privacy** and +describes the data practices of the instance operated by Such Software LLC +(api.smirk.cash). + +## For operators who self-host + +This backend is open source and self-hostable. **If you run your own instance, you +are an independent data controller for it** and the Such Software policy does not +speak for you. What your instance receives from wallets that connect to it: + +- **Monero/Wownero view keys** (to scan for users' incoming funds; a view key + cannot spend) and their scan/registration state. +- **Public addresses** for BTC/LTC balance lookups and **signed transactions** to + broadcast. Recipient address and amount are not sent on broadcast. +- A one-way **seed fingerprint** (SHA-256) as a non-reversible wallet identifier. +- If enabled: the **username to npub** mapping published in your NIP-05 directory, + and, for the relay, encrypted message envelopes (ciphertext only). +- IP addresses only as a **salted one-way hash**, for rate-limiting. + +Private keys and seed phrases are never transmitted to the backend. + +If you offer your instance to others, publish your own privacy policy describing +how you handle this data, your retention, and your jurisdiction. The knobs that +affect retention and data exposure (login-event and audit retention, erasure, +relay retention, landing-page exposure) are documented in +[docs/operations/CONSOLE.md](docs/operations/CONSOLE.md) and the root `.env.example`. diff --git a/tools/secret-scan.sh b/tools/secret-scan.sh index 9d93b04..a5b3762 100755 --- a/tools/secret-scan.sh +++ b/tools/secret-scan.sh @@ -17,8 +17,12 @@ else mapfile -t FILES < <(find . -type f -not -path './.git/*' -not -path './target/*' -printf '%P\n') fi -# Secret shapes (not names): PEM/OpenSSH/PGP private-key blocks and seed phrases. -PATTERNS='(-----BEGIN ([A-Z ]+ )?PRIVATE KEY-----|-----BEGIN PGP PRIVATE KEY|BEGIN OPENSSH PRIVATE KEY|\b(mnemonic|seed[_ ]?phrase)\b\s*[:=])' +# Secret shapes (not names), covering the classes this backend actually handles: +# - PEM/OpenSSH/PGP private-key blocks and seed-phrase markers +# - nsec1... Nostr SECRET keys (bech32) +# - a *_PEPPER / *_SALT (or admin key/secret) assigned a 32+ hex-char value, i.e. +# an `openssl rand -hex 32` peppered secret pasted in cleartext +PATTERNS='(-----BEGIN ([A-Z ]+ )?PRIVATE KEY-----|-----BEGIN PGP PRIVATE KEY|BEGIN OPENSSH PRIVATE KEY|\b(mnemonic|seed[_ ]?phrase)\b\s*[:=]|nsec1[0-9a-z]{20,}|\b[A-Z_]*(PEPPER|SALT|INTEGRITY_SECRET)[A-Z_]*\s*=\s*[0-9a-fA-F]{32,})' fail=0 for f in "${FILES[@]}"; do