Getting Started
Overview
Britive Secrets Vault owns credential policy, versioning, rotation schedules, and access governance. Secret synchronization scripts push the current secret value to a downstream store whenever the broker executes a checkout. The Britive platform calls the broker script and injects the secret and configuration as environment variables; the script only writes to the destination — it never calls back to Britive. The downstream store always reflects the latest Britive-managed value.
What you’ll accomplish:
- Choose a script variant (CLI, curl/REST, or PowerShell) for your destination
- Wire the script as a broker checkout action
- Verify the synced value lands in the external store
How It Works
flowchart TD
Vault["Britive Secrets Vault<br/>(source of truth: rotation, versions,<br/>access governance, lifecycle)"]
Sync["sync-to-*.sh / .ps1<br/>(runs on the broker)"]
AWS["AWS Secrets Manager"]
Azure["Azure Key Vault"]
Hashi["HashiCorp Vault (KV)"]
GCP["GCP Secret Manager"]
Vault -->|"checkout triggered — Britive injects SECRET_VALUE + config"| Sync
Sync --> AWS
Sync --> Azure
Sync --> Hashi
Sync --> GCP
Each destination ships three variants:
| Variant | Tools | Use when |
|---|---|---|
| CLI | provider CLI (aws / az / vault / gcloud) | the CLI is already on the broker host |
| curl / REST | curl + jq (AWS also needs openssl+xxd) | minimal container images, no CLI |
| PowerShell | Invoke-RestMethod | Windows or mixed-OS broker hosts |
Before You Begin
- The Access Broker is deployed and connected
- A secret managed in the Britive Secrets Vault
- Write access on the destination store, scoped to the specific secret being synced
- The tools for your chosen variant installed on the broker host
Never log secret values. The scripts log destination names and status only. Scope the destination credentials tightly (write access to one secret), and prefer instance profiles, Workload Identity, and IRSA over long-lived static keys.
How the Broker Passes Values to a Script
Every broker script — sync, scan, checkout, or rotation — reads its input from environment variables. Nothing is passed on the command line. There are three sources, and knowing which one a value comes from tells you what name to read it under.
Resource attributes arrive with a RESOURCE_ prefix
A resource type defines parameters (host, region, base_dn), and each resource fills them in. When the broker runs a script for that resource, it injects every attribute upper-cased and prefixed with RESOURCE_:
| Attribute on the resource | Variable the script receives |
|---|---|
host | RESOURCE_HOST |
region | RESOURCE_REGION |
base_dn | RESOURCE_BASE_DN |
ca_cert | RESOURCE_CA_CERT |
The prefix keeps a resource attribute from colliding with an ordinary shell variable such as PATH or HOME. It applies to every action the broker runs against that resource — scan, checkout, checkin, and rotation alike.
Because the prefix is fixed, a script that must also run by hand reads its own name first and falls back to the prefixed one:
# A value set directly wins, so the script stays runnable outside the broker.
AWS_REGION="${AWS_REGION:-${RESOURCE_REGION:-}}"
AD_HOST="${AD_HOST:-${RESOURCE_HOST:-}}"Permission and rotation variables arrive under their exact name
Variables configured on the permission or on the rotation reach the script under exactly the name you typed — no prefix, no case change. Configure one called AWS_SECRET_KEY and the script reads $AWS_SECRET_KEY.
Mark a variable encrypted and the broker decrypts it in memory just before the script runs. It never appears in the broker request log, which is how a generated password reaches a script safely.
Platform-supplied variables
| Variable | Set on | Description |
|---|---|---|
SECRET_VALUE | Secret sync checkout | The value to write — injected automatically |
user | Checkout / checkin | Email address of the requesting user |
Unsure what a given action actually receives? Run a one-off script that prints variable names before values (printenv | cut -d= -f1 | sort) and read the broker log. Britive keeps only about the first 250 characters of captured output, so a name-first dump still answers the question after truncation.
Destination Configuration
Script: Secret synchronization/aws/sync-to-aws-secrets-manager.sh
| Variable | Required | Description |
|---|---|---|
AWS_SECRET_NAME | Yes | Name or ARN of the target secret |
AWS_REGION | Yes | e.g. us-east-1 |
AWS_PROFILE | No | Named CLI profile (CLI variant) |
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN | curl variant | Static / STS credentials |
export AWS_SECRET_NAME="my-app/database/password"
export AWS_REGION="us-east-1"
./sync-to-aws-secrets-manager.sh # SECRET_VALUE injected by BritiveThe CLI variant uses the standard AWS credential chain. The curl variant signs requests with AWS Signature V4 (needs openssl and xxd).
Configure in the Broker
Upload the script
In Resource Manager → Resource Types, open (or create) the resource type and add a permission. Paste the sync script as the checkout routine.
Add the destination variables
On the same permission, add AWS_SECRET_NAME and AWS_REGION (or the equivalents for your destination) as variables. SECRET_VALUE is injected by the platform — do not add it yourself.
Attach the permission to a profile
Create a resource profile, add the permission, and add a policy naming who may check it out.
Verify
Trigger a checkout
Check out the profile that runs the sync script (or rotate the source secret in the Britive vault).
Read the destination value
aws secretsmanager get-secret-value \
--secret-id "my-app/database/password" \
--query SecretString --output textThe returned value matches the current Britive-managed secret.
Confirm no secret leaked to logs
Check the broker logs — they show destination and status, never the value of SECRET_VALUE.
Troubleshoot
| Symptom | Cause | Fix |
|---|---|---|
AccessDenied writing the secret | Destination credentials too narrow or wrong | Grant write on the specific secret only; verify the role/principal |
| curl variant fails to sign (AWS) | openssl/xxd missing | Install both, or switch to the CLI variant |
| Value written but app sees old value | App caches the secret | Confirm the app re-reads on rotation; check the store’s version history |
| Empty value written | SECRET_VALUE not injected | Confirm the script runs as a Britive checkout action, not standalone |
Next Steps
Synchronization pushes a value Britive already holds. Rotation changes the value at the source and records the new one:
- Rotate AWS Secrets Manager Secrets — replace the value held in a secret, optionally changing the account behind it first
- Rotate Active Directory Accounts — reset an AD password over LDAPS and propagate it to Secrets Manager or a Windows service
Also:
- Deploy the Access Broker if you haven’t already
- Source: britive/access-broker-examples — Secret synchronization