rskey is designed specifically for managing secrets in Posit product deployments. It generates key files compatible with the internal formats used by Connect, Package Manager, and Workbench, and produces encrypted values that those products can decrypt at startup. Understanding the security model is essential before using rskey in production infrastructure.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rstudio/rskey/llms.txt
Use this file to discover all available pages before exploring further.
Key security
The key file is the single secret that protects all encrypted values. Anyone with access to the key file can decrypt every value encrypted with it.-
File permissions: Set key files to
0600(owner read/write only). Posit products enforce this as well. - Never commit key files to version control. A key file checked into a repository — even briefly — should be considered compromised and rotated immediately.
-
Do not pass key content in environment variables. Environment variables are visible to all processes running as the same user and may be logged by process supervisors. Pass the file path to the key instead:
- Key length: Connect and Package Manager keys are 512 bytes (4096 bits) of cryptographically secure random data. Only the first 32 bytes are used as key material by the encryption algorithms; the remaining bytes provide defense in depth against key derivation attacks.
Algorithm security properties
NaCl Secretbox (default, Connect and Package Manager)
NaCl Secretbox combines XSalsa20 stream encryption with a Poly1305 MAC. It provides authenticated encryption: decryption fails withErrFailedToDecrypt if the ciphertext has been tampered with or was encrypted with a different key. A fresh 192-bit random nonce is generated for every encryption call, ensuring that identical plaintexts produce different ciphertexts.
AES-256-GCM (FIPS mode, Connect and Package Manager)
AES-256-GCM is an AEAD (Authenticated Encryption with Associated Data) mode and an Approved Security Function under FIPS 140-3. Like NaCl Secretbox, it provides both confidentiality and integrity guarantees. The 96-bit random nonce ensures ciphertext uniqueness across encryptions of the same value. The GCM authentication tag is 128 bits. Select this algorithm when your environment mandates FIPS 140-3 compliance:AES-128-CBC (Workbench)
AES-128-CBC provides confidentiality only — no authentication. Integrity is protected by a CRC32 checksum embedded in the ciphertext, which is not a cryptographic MAC. CRC32 can detect accidental corruption but does not protect against deliberate tampering by an attacker who also has the key.The AES-128-CBC implementation intentionally preserves compatibility with
rstudio-server’s internal format, including its non-standard 32-byte IV allocation (only the first 16 bytes are used). Do not use Workbench mode for anything other than Workbench secret management.Binary verification
Release binaries are signed using Sigstore with Cosign in keyless mode. Keyless signing uses short-lived ephemeral certificates issued by Sigstore’s Certificate Authority. The signer (GitHub Actions for this repository) authenticates via an OpenID Connect token. There is no long-lived private signing key to protect or rotate; the identity is bound to the GitHub repository at release time and recorded in Sigstore’s public transparency log. To verify a release binary before use:0.5.0 and linux_amd64 with the version and platform you downloaded. The cosign tool is available from sigstore/cosign.
Cosign’s keyless verification checks the Sigstore transparency log to confirm that the signature was produced by a GitHub Actions workflow in the
rstudio/rskey repository. This ties the binary to a specific source code commit.Key rotation
Regular key rotation limits the exposure window if a key is ever compromised. rskey provides a fingerprint command to help track which key encrypted a given secret.Identifying the active key
Rotation procedure
Record the current fingerprint
Re-encrypt all secrets
For each encrypted value in your product configuration, decrypt it with the old key and re-encrypt with the new key:Update the product configuration files with the new encrypted values.
Replace the key file and restart