A Go-based Kubernetes application for reading and displaying Bitwarden secrets synced to Kubernetes.
Bitwarden Reader is a web application that reads and displays Bitwarden secrets that have been synced to Kubernetes. It provides a web UI and REST API for viewing secret information, sync status, and triggering manual syncs.
- Web UI: Modern, responsive interface for viewing secrets
- REST API: JSON API for programmatic access
- Real-time Updates: WebSocket support for live secret status updates
- Sync Management: Trigger manual syncs for Bitwarden secrets
- Sync Status: Display detailed sync information from CRDs
- Standalone Mode: Can run without Kubernetes access (limited features)
- Go 1.23 or later
- Kubernetes cluster access (optional - can run in standalone mode)
- In-cluster: Automatic when running inside Kubernetes
- Local: kubeconfig file at
~/.kube/configorKUBECONFIGenvironment variable
- Docker (for containerized builds)
The application is configured via environment variables:
| Variable | Description | Default |
|---|---|---|
PORT |
HTTP server port | 8080 |
POD_NAME |
Kubernetes pod name (from downward API) | - |
POD_NAMESPACE |
Kubernetes namespace (from downward API) | - |
SECRET_NAMES |
Comma-separated list of secret names to read | - |
APP_TITLE |
Application title | Bitwarden Secrets Reader |
APP_VERSION |
Application version | 1.0.0 |
DASHBOARD_REFRESH_INTERVAL |
WebSocket refresh interval in seconds | 5 |
SHOW_SECRET_VALUES |
Show secret values by default | false |
-
Clone the repository
-
Download dependencies:
make deps
-
Set environment variables (optional):
export POD_NAME=local-test export POD_NAMESPACE=default export SECRET_NAMES=bw-test-secret
-
Build and run:
make build ./bin/bitwarden-reader
Or run directly:
go run ./cmd/server
-
Access the web UI at
http://localhost:8080
Note: The application can run without Kubernetes access in standalone mode. In this mode:
- The web UI and API endpoints are still accessible
- Secret reading will show error messages indicating Kubernetes is unavailable
- Sync triggering will return 503 Service Unavailable
- Health endpoint works normally
make buildThe binary will be created at bin/bitwarden-reader.
make docker-buildThis creates a Docker image tagged as bitwarden-reader:latest.
make docker-runOr manually:
docker run -p 8080:8080 \
-e POD_NAME=local-test \
-e POD_NAMESPACE=default \
-e SECRET_NAMES=bw-test-secret \
bitwarden-reader:latestGET /- Web interface for viewing secrets
-
GET /api/v1/secrets- Get all secrets and sync information{ "secrets": [...], "namespace": "bitwarden-secrets", "totalFound": 2, "timestamp": "2026-01-11T12:00:00Z" } -
POST /api/v1/trigger-sync- Trigger manual sync for secrets{ "secretNames": ["bw-secret1", "bw-secret2"] } -
GET /api/v1/health- Health check endpoint{ "status": "healthy", "version": "1.0.0" }
GET /ws- WebSocket endpoint for real-time updates
.
├── cmd/server/ # Application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── k8s/ # Kubernetes client operations
│ ├── reader/ # Core reading logic
│ └── server/ # HTTP server and handlers
├── web/
│ ├── static/ # Static assets (CSS, JS)
│ └── templates/ # HTML templates
├── Dockerfile # Multi-stage Docker build
├── Makefile # Build automation
└── README.md # This file
The application supports two modes:
-
Standalone Mode: Runs without Kubernetes access
- No kubeconfig or in-cluster config required
- Limited functionality (UI accessible, but secrets cannot be read)
- Useful for development and testing UI
-
Kubernetes Mode: Full functionality with Kubernetes access
- Requires in-cluster config (when running in Kubernetes) or kubeconfig (local)
- Full secret reading and sync management capabilities
When running in Kubernetes, the application requires the following RBAC permissions:
secrets:get,listbitwardensecrets(CRD):get,patch
Use Kubernetes downward API to inject pod information:
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: SECRET_NAMES
value: "bw-secret1,bw-secret2"Run tests:
make testRun code quality checks:
make lint # Lint code
make fmt # Format codemake build- Build Go binarymake test- Run testsmake docker-build- Build Docker imagemake docker-run- Run Docker containermake clean- Clean build artifactsmake deps- Download dependenciesmake fmt- Format codemake lint- Lint codemake help- Show all available commands
MIT License - see LICENSE file for details