Skip to main content

gkms

gkms is a simple utility for using GCP Cloud KMS to encrypt and decrypt secrets and storing them in GCS.

Installation

pip install gkms

Setup

Please see https://googleapis.github.io/google-cloud-python/latest/core/auth.html for authentication with Google Cloud SDK.

Usage

CLI

gkms encrypt \
    --project my-project \
    --location global \
    --ring my-key-ring \
    --key my-crypto-key \
    --bucket my-bucket \
    --target my-target.txt \
    --secret my-secret.txt

gkms decrypt \
    --project my-project \
    --bucket my-bucket \
    --target my-target.txt

gkms reencrypt \
    --project my-project \
    --bucket my-bucket \
    --target my-target.txt

Python

import gkms

gkms.encrypt(
    project='my-project',
    location='global',
    keyring='my-key-ring',
    cryptokey='my-crypto-key',
    bucket='my-bucket',
    target='my-secret.txt',
    secret_name='my-secret.txt',
)

decrypted = gkms.decrypt(
    project='my-project',
    bucket='my-bucket',
    target='my-secret.txt',
)

gkms.reencrypt(
    project='my-project',
    bucket='my-bucket',
    target='my-secret.txt',
)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Getting Started

Set up your virual environment however you like.

pip install -e .[dev]

You're ready to start developing!

Running Tests

pytest

Disclaimer

gkms merely allows you to keep your secrets in GCS buckets allowing you to specify permissions via IAM roles. This does not replace projects like HashiCorp Vault! Attackers who gain access to your service accounts will have access to the secrets.

Release files for gkms 0.0.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 gkms 0.0.1
File Size Uploaded
gkms-0.0.1.tar.gz 4.4 kB Details

Built distribution (wheel)

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

Total release size: 14.4 kB

Release files / gkms-0.0.1.tar.gz

Download URL gkms-0.0.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a2ba2f2b3feb0bd41fd0515f18253ef6596fcb3a45552549dfa7a1e8079e2077
BLAKE2b-256 checksum
How to use checksums
6d77d822b67016551aa5d928531ac452cfce2f1dd6a5b2360929cb1ae75692c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / gkms-0.0.1-py3-none-any.whl

Download URL gkms-0.0.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55f76ae51f74eed566dd29bf1439d09e30b956d88d595b387e47a37d80393682
BLAKE2b-256 checksum
How to use checksums
197c34c7a9b509621da628ce46d00fcdcd8e197085690fda3cad22b2c66ea366
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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