Skip to main content

secretctl

CirclecI Test Coverage Maintainability PyPI version License Command-line tool for working with aws secrets manager.

Installing

secretctl is a python package.

$ pip install secretctl

Authenticating

'secretctl' requires an authenticated AWS user with permissions to use the Secrets Manager, as resolved by boto3. The primary example being identity settings in ~/.aws/credentials. A recommended way to do this is using aws-vault, as in:

$ aws-vault exec prod -- secretctl ..

Usage

Creating and Updating Secrets

$ secretctl create <path/key> <value | ->

This command will write a secret into the Secret Managers. If - is provided as the value argument, the value will be read from standard input. A description can be added using the --description flag. Tags are added using the --tags flag and flag values in the tag=value format.

$ secretctl create <path/key> <value> --description <STRING> --tags <tag>=<value>, ..

If the path/key already exists, the process will fail. Use update to change the value of a secret.

$ cat <filename> | secretctl update myapp/dev/public-key -

Use secretctl tag and secretctl untag to add/remove/modify tags.

Reading Secrets

$ secretctl read myapp/dev/docker_login

   Path/Key                   Version   Value
   myapp/dev/docker_login     1         mydockerlogin

Use --quiet to return only the secret value.

Listing Secrets

$ secretctl list --path di/dev/

Path/Key                Description                             Tags
di/dev/docker_username  access credentials for private regis..  team=di, circleci-context=team-di
di/dev/docker_password  access credentials for private regis..  team=di, circleci-context=team-di
di/dev/vault_token      team vault token                        team=di, circleci-context=team-di
Found 3 secrets.

If no --path is provided, all secrets will be listed. Use the --tags to filter for secrets where tags or values match STRING.

Exporting

$ secretctl export di/dev/

docker_username=mydockerlogin
docker_password=mydockerpassword
vault_token=myvaulttoken

Example use in a deploy pipeline:

$ secretctl export di/dev/ > local.env
$ source local.env

export can export secrets in various file formats. The following file formats are supported:

  • tfvars (default)
  • json
  • csv

under development

sercretctl does not yet support: custom KMS key binary secret value type (unit testing) no moto support for testing descriptions or resource tags

Metadata

Release files for secretctl 0.0.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for secretctl 0.0.19
File Size Uploaded Provenance
secretctl-0.0.19.tar.gz 8.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for secretctl 0.0.19
File Interpreter ABI Platform
secretctl-0.0.19-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / secretctl-0.0.19.tar.gz

Download URL secretctl-0.0.19.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4005a6657f01b236ac3c88889bbe8f3289ca6f2eb5099e977e60d4c69f653e7e
BLAKE2b-256 checksum
How to use checksums
4b400eba831bc04b7f9c907d42b9ec6693531fd39c8878469fdaf4c61b1f2f55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

Release files / secretctl-0.0.19-py3-none-any.whl

Download URL secretctl-0.0.19-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95f5603a0ea720017c50ed979334a232f6e750d4438f7cd13ce7b7bfd65fe304
BLAKE2b-256 checksum
How to use checksums
23e0920e71a32ef414b2d27dac41c4d48f04e2a1bdd17c00f7e6d702a815fb8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

Security for secretctl 0.0.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page