Skip to content

Create and Update Secrets using the CLI

Lorens Kockum edited this page Nov 23, 2017 · 2 revisions

Prerequisite: Secrets Group

Secrets are logically grouped into Secrets Groups. If you don't already have a Secrets Group, you will need to create one (this will allocate the necessary AWS resources):

Please note that you need certain permissions to run this command

$ strongbox --region eu-west-1 group create team.project

Create

From stdin

$ strongbox --region eu-west-1 secret create --group team.project --name MySecret --value-from-stdin

From file

strongbox --region eu-west-1 secret create --group team.project  --name MySecret --value-from-file my-cert.pem

Please note: Strongbox will transparently handle the file as either text or binary data. If you later try to output binary data as text (e.g. in a JSON blob) it will be displayed as a base64 encoded string, otherwise it will be bit for bit identical to the original data.

Add a new version

$ strongbox --region eu-west-1 secret add-version --group team.project --name MySecret --value-from-stdin

Update

Update state

The state can be updated to {disabled, compromised, enabled}

$ strongbox secret update --group team.project --name MySecret --version 1 --state disabled

Update comment

$ strongbox secret update --group team.project --name MySecret --version 1 --comment "some comment"