https://github.com/premiscale/pass-operator
A Kubernetes operator that syncs and decrypts secrets from pass store git repositories
https://github.com/premiscale/pass-operator
kubernetes operator pass python secrets
Last synced: about 1 year ago
JSON representation
A Kubernetes operator that syncs and decrypts secrets from pass store git repositories
- Host: GitHub
- URL: https://github.com/premiscale/pass-operator
- Owner: premiscale
- License: gpl-3.0
- Created: 2023-06-12T14:13:49.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-04-10T02:12:56.000Z (about 1 year ago)
- Last Synced: 2025-04-10T03:23:49.851Z (about 1 year ago)
- Topics: kubernetes, operator, pass, python, secrets
- Language: Python
- Homepage: https://github.com/premiscale/pass-operator
- Size: 1.58 MB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# `pass` secrets operator


A Kubernetes operator to sync and decrypt secrets from a password store ([pass](https://www.passwordstore.org/)) Git repository.
While this approach to secrets management on Kubernetes is more technically challenging, the primary advantage is that we don't have to rely on a 3rd party SaaS platform, such as Vault, Infisical or Doppler, to hold and secure our secrets. This approach upholds a GitOps-style of secrets management by storing encrypted secret state in Git.
Moreover, this operator may be used in an airgapped environment or private subnets (with no outbound Internet access) when paired with any self-hosted git repository that supports SSH access, so your secrets never leave your network.
## How it works
From a high level, this operator runs `git pull` on an interval to grab updates from a git repository populated with encrypted
secrets by `pass` on a local developer's machine. It maps secrets' paths to data values through the application of a [`PassSecret`](helm/operator-crds/templates/PassSecret.yaml), a [custom resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/), such as the following.
```yaml
apiVersion: secrets.premiscale.com/v1alpha1
kind: PassSecret
metadata:
name: mypasssecret
namespace: pass-operator-test
spec:
encryptedData:
mykey: premiscale/mydata
managedSecret:
metadata:
name: mysecret
namespace: mynamespace
type: Opaque
immutable: false
```
The above `PassSecret` manifest translates to the following `Secret`.
```yaml
apiVersion: v1
kind: Secret
metadata:
name: mysecret
namespace: mynamespace
stringData:
mykey:
immutable: false
type: Opaque
```
The following flowchart outlines how this operator reacts to `PassSecret`-related events and pass store updates.
## Installation
See the [chart README](https://github.com/premiscale/pass-operator/tree/master/helm/operator) for an overview of operator installation and configuration options.
## Development
### Unit tests
Run unit tests with
```shell
yarn test:unit
```
### End-to-end tests
Install [Docker BuildKit and enable it](https://docs.docker.com/build/buildkit/#getting-started).
```text
DOCKER_BUILDKIT=1
export DOCKER_BUILDKIT
```
Now, run e2e tests with
```shell
yarn test:e2e
```
This command will
1. Stand up a local 1-node minikube cluster with 4 cores, 4GiB memory and 30GiB storage. *(Modify [./scripts/minikube.sh](./scripts/minikube.sh) if these resources are unsuitable for your local development environment.)*
2. Create a `localhost` docker registry redirect container based on socat.
3. Build both e2e (hosts a git repository with encrypted pass secrets that match paths found in [./src/test/data/crd](./src/test/data/crd/)) and operator container images, as well as push these images to the local redirect for minikube to access.
4. Installs both e2e and pass-operator Helm charts.
5. Run e2e tests.
6. Tear down the cluster and local registry, as well as cleans up locally-built artifacts.