Enterprise-Grade Secret Synchronization Pipeline
Quick Start β’ Package Docs β’ Repo Docs β’ Python Bindings β’ Examples β’ GitHub Action
SecretSync provides fully automated, enterprise-grade secret synchronization across multiple cloud providers and secret stores. Built for scale with a two-phase pipeline architecture (merge β sync), it supports inheritance, dynamic target discovery, and CI/CD-friendly diff reporting.
SecretSync is part of the Extended Data Library ecosystem - a collection of high-performance, enterprise-grade tools for data management, secret handling, and infrastructure automation.
π Python Integration: SecretSync provides Python bindings via gopy, enabling seamless integration with the extended-data library and Python-based AI agents.
π Perfect for: Multi-account AWS environments, Kubernetes deployments, CI/CD pipelines, and enterprise secret management at scale.
| Feature | SecretSync | Alternatives |
|---|---|---|
| Two-Phase Pipeline | β Merge β Sync with inheritance | β Simple 1:1 sync only |
| AWS Organizations | β Dynamic discovery with tag filtering | β Manual account management |
| Secret Versioning | β Complete audit trail with rollback | β No version tracking |
| Enhanced Diff | β Side-by-side with intelligent masking | β Basic text diff |
| Enterprise Scale | β 1000+ accounts, circuit breakers | β Limited scalability |
| CI/CD Integration | β GitHub Action + exit codes | β Manual scripting required |
- AWS Organizations Integration: Discover accounts with tag filtering, wildcards, and OU-based selection
- AWS Identity Center: Permission set discovery and account assignment mapping
- Smart Caching: Multi-level caching for optimal performance at scale
- Complete Audit Trail: Track every secret change with metadata
- S3-Based Storage: Reliable, scalable version history
- Rollback Capability: CLI support for version rollback
- Retention Policies: Configurable cleanup of old versions
- Side-by-Side Comparison: Visual diff with aligned columns and color coding
- Intelligent Masking: Automatic detection and masking of sensitive values
- Multiple Formats: Human, JSON, GitHub Actions, and compact outputs
- Rich Statistics: Detailed change counts, sizes, and timing
- Circuit Breakers: Automatic failure detection and recovery
- Prometheus Metrics: Production-ready observability with
/metricsendpoint - Request Tracking: Unique request IDs and duration tracking
- Race-Free Operations: Thread-safe with comprehensive testing
- Two-Phase Design: Merge β Sync for complex inheritance scenarios
- DeepMerge Support: List append, dict merge, scalar override
- Target Inheritance: Hierarchical configuration with circular dependency detection
- Dynamic Discovery: AWS Organizations, Identity Center, and fuzzy matching
SecretSync originated as a fork of robertlestak/vault-secret-sync (MIT License). We thank Robert Lestak for creating the original codebase.
SecretSync is an independent product with its own roadmap and development direction. It has been substantially rewritten with:
- Two-phase pipeline architecture (merge β sync)
- S3 merge store support
- Dynamic target discovery (AWS Organizations, Identity Center)
- Comprehensive diff/dry-run system with CI/CD integration
- DeepMerge semantics for secret aggregation
- Kubernetes operator with CRD support
| Store | Source | Target | Merge Store |
|---|---|---|---|
| HashiCorp Vault (KV2) | β | β | β |
| AWS Secrets Manager | β | β | β |
| AWS S3 | β | β | β |
| AWS Identity Center | Discovery | β | β |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MERGE PHASE (Optional) β
β Source1 βββ β
β Source2 βββΌβββΆ Merge Store (Vault/S3) βββΆ Aggregated Secrets β
β Source3 βββ (deepmerge, inheritance) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SYNC PHASE β
β Merge Store βββ¬βββΆ AWS Account 1 (via STS AssumeRole) β
β (or Source) ββββΆ AWS Account 2 β
β ββββΆ Vault Cluster β
β ββββΆ GCP Project β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
See Two-Phase Architecture for detailed documentation.
# Go install
go install github.com/jbcom/secrets-sync/cmd/secretsync@latest
# Or build from a local checkout
git clone https://github.com/jbcom/secrets-sync.git
cd secrets-sync
make buildSecretSync provides Python bindings via gopy, enabling integration with Python applications and AI agent frameworks.
# Install prerequisites
pip install pybindgen build
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/go-python/gopy@latest
# Build Python bindings
make python-bindings
# Install locally
make python-installThe recommended way to use SecretSync from Python is via the extended-data library:
pip install extended-data[secrets]This installs the Python connector surface. To execute the full pipeline from
Python, make sure the secretsync CLI is installed or the native bindings have
been built in the current environment.
from extended_data.secrets import SecretsConnector
# Initialize connector
connector = SecretsConnector()
# Validate configuration
is_valid, message = connector.validate_config("pipeline.yaml")
# Dry run to see what would change
result = connector.dry_run("pipeline.yaml")
print(f"Would sync {result.secrets_processed} secrets")
print(f" Add: {result.secrets_added}")
print(f" Modify: {result.secrets_modified}")
print(f" Remove: {result.secrets_removed}")
# Execute the full pipeline
result = connector.run_pipeline("pipeline.yaml")
if result.success:
print(f"Successfully synced {result.secrets_added} secrets")SecretSync tools are available for LangChain, CrewAI, and AWS Strands:
from extended_data.secrets import get_tools
# Auto-detect framework
tools = get_tools()
# Or specify framework
langchain_tools = get_tools("langchain")
crewai_tools = get_tools("crewai")# Validate configuration
secretsync validate --config pipeline.yaml
# Dry run with enhanced diff output (v1.2.0)
secretsync pipeline --config pipeline.yaml --dry-run --format side-by-side
# Full pipeline execution with metrics (v1.1.0)
secretsync pipeline --config pipeline.yaml --metrics-port 9090
# CI/CD mode (exit codes: 0=no changes, 1=changes, 2=errors)
secretsync pipeline --config pipeline.yaml --dry-run --exit-code
# Version management (v1.2.0)
secretsync versions --secret-path "app/database/password"
secretsync sync --version 5 --target production# pipeline.yaml - v1.2.0 with advanced features
vault:
address: "https://vault.example.com"
namespace: "admin"
aws:
region: "us-east-1"
execution_role_pattern: "arn:aws:iam::{account_id}:role/SecretsSync"
# Advanced discovery (v1.2.0)
discovery:
aws_organizations:
enabled: true
tag_filters:
- key: "Environment"
values: ["production", "staging"]
operator: "equals"
- key: "Team"
values: ["platform*"]
operator: "contains"
organizational_units:
- "ou-production-12345"
tag_logic: "AND"
cache_ttl: "1h"
identity_center:
enabled: true
region: "us-east-1"
cache_ttl: "30m"
# Secret versioning (v1.2.0)
versioning:
enabled: true
s3_bucket: "company-secretsync-versions"
retention_days: 90
# Observability (v1.1.0)
observability:
metrics:
enabled: true
port: 9090
address: "0.0.0.0"
merge_store:
vault:
mount: "secret/merged"
sources:
api-keys:
vault:
path: "secret/api-keys"
database:
vault:
path: "secret/database"
targets:
Staging:
imports: [api-keys, database]
account_id: "111111111111"
Production:
inherits: Staging
imports: [production-overrides]
account_id: "222222222222"SecretSync is available as a GitHub Action for seamless CI/CD integration:
- name: Sync Secrets
uses: jbcom/secrets-sync@secretssync-v2.0.2
with:
config: config.yaml
dry-run: 'false'
output-format: 'github'
env:
VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }}
VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }}Key Features:
- π Native OIDC support for AWS authentication
- π GitHub-native diff annotations in PRs
- π― Exit codes for CI/CD control flow
- π Automatic Docker multi-arch builds
- β‘ Zero configuration needed beyond config file
Quick Start:
- Add
config.yamlto your repository - Configure AWS OIDC and Vault secrets
- Use the action in your workflow
See GitHub Actions documentation for complete usage guide and examples.
- name: Validate secrets pipeline
run: |
secretsync pipeline --config pipeline.yaml --dry-run --output github --exit-code
- name: Apply secrets (on merge to main)
if: github.ref == 'refs/heads/main'
run: |
secretsync pipeline --config pipeline.yaml| Format | Use Case | Features |
|---|---|---|
human |
Interactive terminal output | Color coding, readable layout |
side-by-side |
NEW Visual comparison | Aligned columns, intelligent masking |
json |
Machine parsing, logging | Structured data with metadata |
github |
GitHub Actions annotations | PR comments, file annotations |
compact |
One-line CI status | Minimal output for scripts |
Value Masking (v1.2.0): Sensitive values are automatically masked by default. Use --show-values flag to display actual values (use with caution in CI/CD).
- π Published Package Docs - Public package overview, installation paths, and Python integration guidance
- π Getting Started Guide - Step-by-step setup tutorial
- β FAQ - Frequently asked questions
- π Examples - Complete configuration examples
- ποΈ Architecture Overview - System design and components
- π Two-Phase Pipeline - Merge β Sync architecture
- βοΈ Pipeline Configuration - Configuration reference
- π Deployment Guide - Production deployment patterns
- π Security Configuration - Security best practices
- π Observability - Monitoring and metrics
- π― GitHub Actions - CI/CD integration guide
- π Usage Reference - Complete CLI reference
- πΊοΈ Roadmap - Future development plans
- π€ Contributing - How to contribute
- π‘οΈ Security Policy - Security reporting
- π Code of Conduct - Community guidelines
# Add Helm repo
helm repo add secretsync https://jbcom.github.io/secrets-sync
# Install
helm install secretsync secretsync/secretsync \
--set vault.address=https://vault.example.com# Run with config file
docker run -v $(pwd)/config.yaml:/config.yaml \
jbcom/secrets-sync-secretssync pipeline --config /config.yaml
# Multi-arch images available: linux/amd64, linux/arm64SecretSync exposes Prometheus metrics for production monitoring and debugging.
# Enable metrics server on port 9090
secretsync pipeline --config config.yaml --metrics-port 9090
# Custom address and port
secretsync pipeline --config config.yaml --metrics-addr 0.0.0.0 --metrics-port 9090Vault Metrics:
secretsync_vault_api_call_duration_seconds- Vault API call latencysecretsync_vault_secrets_listed_total- Total secrets listed from Vaultsecretsync_vault_traversal_depth- BFS traversal depth reachedsecretsync_vault_queue_size- Current traversal queue sizesecretsync_vault_errors_total- Vault error count by operation/type
AWS Metrics:
secretsync_aws_api_call_duration_seconds- AWS API call latencysecretsync_aws_pagination_pages- Number of pagination pages processedsecretsync_aws_cache_hits_total- Cache hit countsecretsync_aws_cache_misses_total- Cache miss countsecretsync_aws_secrets_operations_total- Secret operations (create/update/delete)
Pipeline Metrics:
secretsync_pipeline_execution_duration_seconds- Pipeline phase durationsecretsync_pipeline_targets_processed_total- Targets processed by phasesecretsync_pipeline_parallel_workers- Active parallel workerssecretsync_pipeline_errors_total- Pipeline error count
S3 Metrics:
secretsync_s3_operation_duration_seconds- S3 operation latencysecretsync_s3_object_size_bytes- S3 object sizes
scrape_configs:
- job_name: 'secretsync'
static_configs:
- targets: ['localhost:9090']
metrics_path: '/metrics'The metrics server also exposes a /health endpoint:
curl http://localhost:9090/health
# Returns: OK# Clone
git clone https://github.com/jbcom/secrets-sync.git
cd secrets-sync
# Build
go build ./...
# Unit tests
go test ./...
# Integration tests (requires Docker)
make test-integration-docker
# Lint
golangci-lint runSecretSync includes comprehensive integration tests that validate the complete pipeline with real Vault and AWS Secrets Manager instances (via LocalStack).
Quick Start:
# Run complete integration test suite
make test-integration-dockerThis command:
- Starts Vault and LocalStack in Docker containers
- Seeds test data automatically
- Runs all integration tests
- Cleans up containers
Manual Testing:
# Start test environment
make test-env-up
# Export environment variables (shown in output)
export VAULT_ADDR=http://localhost:8200
export VAULT_TOKEN=test-root-token
export AWS_ENDPOINT_URL=http://localhost:4566
export AWS_ACCESS_KEY_ID=test
export AWS_SECRET_ACCESS_KEY=test
# Run tests
go test -v -tags=integration ./tests/integration/...
# Cleanup
make test-env-downFor detailed documentation, see tests/integration/README.md.
- π Documentation: Start with the published package docs and the repo-local docs folder
- π GitHub Issues: Questions, bug reports, and feature requests
- π Security: Private security vulnerability reporting
We welcome contributions! See our Contributing Guide for:
- π οΈ Development setup
- π Code style guidelines
- π§ͺ Testing requirements
- π Pull request process
- β Star the repo to show your support
- π¦ Follow updates on GitHub
- π’ Share your success stories
- π€ Contribute code, docs, or feedback
MIT License - Free for commercial and personal use
SecretSync originated as a fork of vault-secret-sync by Robert Lestak. We thank Robert for creating the original foundation.
SecretSync has evolved into an independent project with its own architecture, features, and roadmap, while maintaining the same MIT license and open-source spirit.
Current Maintainer: jbcom