scrt
website·Indexed 32 days ago
https://scrt.runA secret manager for the command line that allows users to encrypt and decrypt secrets without requiring a background process or daemon. It supports multiple storage types, including local filesystem, Git repositories, and AWS S3 or compatible object storage.
What's inside scrt
- scrt is a command-line tool for secure secret management that requires no background service or daemon installation. It performs all encryption and decryption locally on the client machine using AES-256 encryption and Argon2id key derivation, ensuring that passwords, keys, and plaintext data are never transmitted over the internet. It supports multiple storage backends, including the local filesystem, AWS S3 (or S3-compatible storage), and git repositories.
Overview of scrt secret management
scrt is a command-line secret manager designed for developers, sysadmins, and DevOps. It allows users to encrypt and decrypt secrets using a 'store'—a single encrypted file that can be kept locally or hosted remotely (e.g., AWS S3 or a Git repository).
Technical specifications:
- Encryption: Uses AES-256 symmetric encryption.
- Key Derivation: Uses Argon2id to derive 256-bit keys from a user-provided password.
- Key Rotation: A new key is derived from the password every time the store is re-encrypted to prevent key re-use.
- Data Format: Each secret is referenced by a name and can be an arbitrary string of bytes of any length.
Use the scrt command-line secret manager
Thescrttool is a secret manager for the command-line. It allows users to initialize stores, manage key-value pairs, and configure storage types. Usescrt --helpto output the full help message.scrt [command]Use Git as a storage backend for scrt
Thegitstorage type allowsscrtto create and access a store within a git repository. When configured,scrtclones the repository in memory, checks out the specified branch, and reads the store from the designated file path. Any modifications made to the store are automatically committed and pushed back to the remote repository. If no existing repository can be cloned,scrtwill initialize a new one.Manage scrt configuration precedence
The
scrtCLI determines configuration settings based on a specific order of precedence. Settings defined in a more explicit method override those in less explicit methods. The order from highest to lowest precedence is:- Command-line flags
- Environment variables
- Configuration file
Understand scrt's security and privacy model
scrtimplements a zero-trust security model: it does not store encryption keys in the store and never transfers plaintext data over the network. All encryption and decryption processes occur locally on the user's machine during runtime. Because of this architecture, the entire store must be loaded into memory and decrypted every time the program is run. For very large stores, users are advised to either split the data into multiple stores or download the store to the local filesystem before execution.Initialize a new scrt store with local storage
Initialize a new encrypted store using thescrt initcommand. When using local storage, the store is created as a file encrypted with a key derived from the provided password. Note: If the password is lost, the secrets cannot be recovered.scrt init --storage=local \ --password=p4ssw0rd \ --local-path=store.scrtInstall scrt on RHEL, CentOS, or Rocky Linux using yum
Create a repository configuration file at/etc/yum.repos.d/scrt.repowith the specified repository details, then install thescrtpackage.# /etc/yum.repos.d/scrt.repo [scrt] name=scrt baseurl=https://yum.scrt.run repo_gpgcheck=1 gpgcheck=1 enabled=1 gpgkey=https://yum.scrt.run/key.gpg sslverify=1 metadata_expire=300sudo yum update sudo yum install scrtInstall scrt using go get
Use the Go toolchain to download and build the latest version of scrt. The resulting binary will be located in the binaries directory of your GOPATH.go get github.com/loderunner/scrtManage secrets using the scrt CLI
Use thescrtcommand-line interface to manage secrets using a key-value pattern. You must provide a store password via theSCRT_PASSWORDenvironment variable to authenticate operations. Usesetto add a secret,getto retrieve one, andunsetto remove one.# Set store password in environment export SCRT_PASSWORD=******* # Add a secret to the store scrt set greeting 'Good news, everyone!' # Retrieve the secret from the store scrt get greeting # Output: Good news, everyone!Install scrt via binary release
Download the latest binary release for your platform from the GitHub releases page, decompress the archive, and move the binary to a directory in your system PATH (e.g., /usr/local/bin).tar xzvf scrt_0.3.3_linux_x86_64.tar.gz sudo cp scrt_0.3.3_linux_x86_64/scrt /usr/local/bin/scrtInstall scrt on macOS using Homebrew
Add theloderunner/scrttap to Homebrew and install thescrtpackage.brew tap loderunner/scrt brew install scrt