Skip to main content

credkeep

credkeep is a python package that helps ease the pain of storing sensitive credentials. Credentials that are securely encrypted using AWS’s Key Management Service (KMS) can be stored in version control systems where they cannot be decrypted without access to a users encryption key on KMS.

Installation

pip install credkeep

Usage

credkeep requires you to configure your own KMS master key. This key is used to encrypt/decrypt your data and is securely stored by AWS. Your KMS master keys can be viewed at https://console.aws.amazon.com/iam/home#encryptionKeys. For information about creating new master keys, see http://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html.

Plaintext api secrets should not be stored in plain text. For example developer_secrets.json

{
    "SECRET_API_KEY": "thisismysecretkey",
    "ANOTHER_API_KEY": "anotherkey"
}

By calling credkeep.encrypt_file

{
  "SECRET_API_KEY": "CiAr4gKwrApZNibuqh1YKjlIGMj4A4GSHArF+0lCqBnqOxKfAQEBAgB4K+ICsKwKWTYm7qodWCo5SBjI+AOBkhwKxftJQqgZ6jsAAAB2MHQGCSqGSIb3DQEHBqBnMGUCAQAwYAYJKoZIhvcNAQcBMB4GCWCGSAFlAwQBLjARBAzGyPmdgqEbxzvnjKICARCAMzOd+DIaI/rUbc8dYQTxGS8aQQNjgXPt6Or0rxo7fFn0rA5/Kf6zpnui0q9XXtUatL4D3Q==",
  "ANOTHER_API_KEY": "CiAr4gKwrApZNibuqh1YKjlIGMj4A4GSHArF+0lCqBnqOxKXAQEBAgB4K+ICsKwKWTYm7qodWCo5SBjI+AOBkhwKxftJQqgZ6jsAAABuMGwGCSqGSIb3DQEHBqBfMF0CAQAwWAYJKoZIhvcNAQcBMB4GCWCGSAFlAwQBLjARBAxgB3p/zbVarLd/5a4CARCAK4w48/dCK7EvwTDELb11bpBe8TpaIhcCalfOqACQzoLoqgciAY8DuczOvRs="
}

This encrypted json file is safe to distribute via version control as it requires access to the master key on KMS. When the secrets in the file are required the file can be decrypted using credkeep.decrypt_file. This function can optionally set local environment variables with the decrypted secrets. These environment variables will not persist between shells or reboots.

Release files for credkeep 0.2.1

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

Source distribution (sdist)

Source distribution for credkeep 0.2.1
File Size Uploaded
credkeep-0.2.1.zip 11.1 kB Details

Release files / credkeep-0.2.1.zip

Download URL credkeep-0.2.1.zip
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f1f4997a351d0bb304f9be13b61a94eab9df2e420631ce08e3913e7c71069c07
BLAKE2b-256 checksum
How to use checksums
705318898ce7a9ab4efbe0a1addd80ba4e30d075ccdf67e4b15bf8d4041e6358
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file

0.2.0

1 release file

0.1.0

1 release file

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