Skip to main content

pass secrets operator

GitHub Release PyPI - License

A Kubernetes operator to sync and decrypt secrets from a password store (pass) 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, a custom resource, such as the following.

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.

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
  namespace: mynamespace
stringData:
  mykey: <decrypted contents of premiscale/mydata>
immutable: false
type: Opaque

The following flowchart outlines how this operator reacts to PassSecret-related events and pass store updates.

pass operator flow diagram

Installation

See the chart README for an overview of operator installation and configuration options.

Development

Unit tests

Run unit tests with

yarn test:unit

End-to-end tests

Run e2e tests against a live (local) environment with

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 if these resources are unsuitable for your local development environment.)
  2. Create a localhost docker registry redirect container.
  3. Build both e2e (hosts a git repository with encrypted pass secrets that match paths found in ./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.

Coverage

Test coverage against the codebase with

poetry run coverage run -m pytest
poetry run coverage report -m pytest

Metadata

Release files for pass-operator 0.4.8

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

Source distribution (sdist)

Source distribution for pass-operator 0.4.8
File Size Uploaded
pass_operator-0.4.8.tar.gz 26.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pass-operator 0.4.8
File Interpreter ABI Platform
pass_operator-0.4.8-py3-none-any.whl Python 3 none any Details

Total release size: 66.2 kB

Release files / pass_operator-0.4.8.tar.gz

Download URL pass_operator-0.4.8.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2d5439da4db1baded55b8b67e249e898ecae76da4a344f928b18a3a15da847bc
BLAKE2b-256 checksum
How to use checksums
35271d25b4a28a4059e59986a19c85679443eee959c51ab7d3dfbbcd9aa42f86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release files / pass_operator-0.4.8-py3-none-any.whl

Download URL pass_operator-0.4.8-py3-none-any.whl
Size 39.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b776e8a2e02206e43c9d651750ff9bdecd8548049f9f26df10a8a662dc222bb3
BLAKE2b-256 checksum
How to use checksums
90c82f10432b51a84aba36611418758a3f4e6533e990fdd79fd6ad960d3d1a29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.4.8 This release

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

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