Berglas encrypts secrets with Cloud KMS, stores them in Cloud Storage or Secret Manager, and exposes CLI and runtime helpers for Google Cloud apps.
Overview
Berglas is a command-line tool and Go library for storing and retrieving secrets on Google Cloud. Secrets are encrypted with Cloud KMS and stored in Cloud Storage, with an interoperable path for Secret Manager as well.
The CLI automates encrypting, decrypting, granting access, spawning child processes with resolved environment values, and bootstrapping buckets plus KMS keys. Library usage can replace berglas:// environment references with decrypted values at process start.
Integrations cover App Engine Flex and Cloud Run via container entrypoints, Cloud Build with volume-mounted secrets, Kubernetes via a mutating webhook, and arbitrary processes wrapped with berglas exec. Go apps on App Engine Standard and Cloud Functions can import an auto package for reference resolution.
Cloud Storage storage uses per-secret envelope encryption with AES-256-GCM data keys and KMS-wrapped key encryption keys. Berglas is not an officially supported Google product but wraps both legacy Cloud Storage secrets and Secret Manager workflows.
Key features
- CLI create, grant, and access secrets
- Cloud KMS plus Cloud Storage storage
- Secret Manager interoperability
- berglas:// environment references
- berglas exec for subprocess env injection
- Bootstrap bucket and KMS setup
- App Engine and Cloud Run hooks
- Go library auto-parsing option
Use cases
- Storing API keys on Google Cloud
- Injecting secrets into Cloud Run jobs
- Kubernetes pod secret mutation
- Local dev with application default credentials
- Managing IAM access to secret blobs