Skip to content

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:

VariantToolsUse when
CLIprovider CLI (aws / az / vault / gcloud)the CLI is already on the broker host
curl / RESTcurl + jq (AWS also needs openssl+xxd)minimal container images, no CLI
PowerShellInvoke-RestMethodWindows 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 resourceVariable the script receives
hostRESOURCE_HOST
regionRESOURCE_REGION
base_dnRESOURCE_BASE_DN
ca_certRESOURCE_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

VariableSet onDescription
SECRET_VALUESecret sync checkoutThe value to write — injected automatically
userCheckout / checkinEmail 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

VariableRequiredDescription
AWS_SECRET_NAMEYesName or ARN of the target secret
AWS_REGIONYese.g. us-east-1
AWS_PROFILENoNamed CLI profile (CLI variant)
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKENcurl variantStatic / 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 Britive

The 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 text

The 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

SymptomCauseFix
AccessDenied writing the secretDestination credentials too narrow or wrongGrant write on the specific secret only; verify the role/principal
curl variant fails to sign (AWS)openssl/xxd missingInstall both, or switch to the CLI variant
Value written but app sees old valueApp caches the secretConfirm the app re-reads on rotation; check the store’s version history
Empty value writtenSECRET_VALUE not injectedConfirm 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:

Also:

Last updated on