cargoship vault encrypt
Encrypts a value with Ansible Vault or age, for use in a registry’s user/pass/token fields
Synopsis
Encrypts VALUE, producing a string that cargoship decrypts automatically at apply time when placed in a registry’s user/pass/token field. With –age-recipient or –age-recipients-file the output is armored age ciphertext beginning with —–BEGIN AGE ENCRYPTED FILE—–; otherwise it is Ansible Vault ciphertext beginning with $ANSIBLE_VAULT. If VALUE is omitted, it is read from stdin, or prompted for with hidden input when stdin is a terminal.
cargoship vault encrypt [VALUE] [flags]
Examples
# Encrypt a registry password for a config file's user/pass/token field
$ cargoship vault encrypt my-registry-password --vault-password-file ./vault-pass.txt
# Omit the value to be prompted for it, with the input hidden
$ cargoship vault encrypt --vault-password-file ./vault-pass.txt
# Encrypt a value piped in on stdin
$ printf my-registry-password | cargoship vault encrypt --vault-password-file ./vault-pass.txt
# Encrypt the contents of a file
$ cargoship vault encrypt --vault-password-file ./vault-pass.txt < ./registry-token.txt
# Encrypt to age public keys instead, so no shared password has to be handed around
$ cargoship vault encrypt my-registry-password --age-recipient age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
# Encrypt to every key a team keeps in one file, each of whom can decrypt on their own
$ cargoship vault encrypt my-registry-password --age-recipients-file ./recipients.txt
Options
--age-identity-file stringArray Path to an age identity file holding the private keys that decrypt registry credentials, or to an SSH private key such as ~/.ssh/id_ed25519. A leading ~ is expanded to your home directory wherever the path comes from. Repeatable; also settable as age.identity_files in the cargoship config file, or as a single path in CARGOSHIP_AGE_IDENTITY_FILE.
--age-recipient stringArray A public key to encrypt registry credentials to: either an age recipient such as age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p, or an SSH public key such as 'ssh-ed25519 AAAAC3Nza...'. Repeatable; also settable as age.recipients in the cargoship config file, or space-separated in CARGOSHIP_AGE_RECIPIENTS. Giving any recipient makes cargoship write age ciphertext instead of Ansible Vault.
--age-recipients-file stringArray Path to a file holding public keys, one per line, which may mix age recipients and SSH public keys; an authorized_keys file works as it is. A leading ~ is expanded to your home directory wherever the path comes from. Repeatable; also settable as age.recipients_files in the cargoship config file.
-h, --help help for encrypt
--vault-password-file string Path to a file containing the Ansible Vault password. Falls back to the CARGOSHIP_VAULT_PASSWORD, then ANSIBLE_VAULT_PASSWORD, environment variable.
Options inherited from parent commands
--log-file Always write a full-verbosity debug log to a file, regardless of --log-level.
-L, --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console")
-l, --log-level string Log level when running cargoship. Valid options are: warn, info, debug, trace (default "info")
--no-color Disable terminal color codes in logging and stdout prints.
SEE ALSO
- cargoship vault - Encrypts and decrypts cluster configuration values with Ansible Vault or age