Getting Started
Overview
This guide walks you through configuring the Britive Access Broker to manage just-in-time access to a PostgreSQL database — creating a temporary database user with the target role at checkout and dropping it at checkin.
What you’ll accomplish:
- Deploy and configure the Britive Access Broker with connectivity to your PostgreSQL instance
- Configure checkout and checkin routines from the access-broker-examples repository
- Register the PostgreSQL database as a Resource Manager resource in Britive
- Create a Resource Manager access profile
- Check out database access and verify end-to-end
Prerequisites
Before you begin, make sure you have:
- A Britive tenant with administrator access
- A running Britive Access Broker with network access to the PostgreSQL instance (port 5432)
- A PostgreSQL superuser or a user with
CREATEROLEandGRANT OPTIONon the target roles psqlavailable on the broker host
Never hardcode credentials. Use environment variables, your secret manager, or the Britive Secrets Store.
How It Works
The Access Broker runs psql commands to create and drop temporary database users. At checkout, Britive creates a PostgreSQL user derived from the requester’s email, sets a temporary password, and grants the target role. At checkin (or on expiry), the user is dropped — no standing database accounts remain.
User → Britive Console → Access Broker → psql → CREATE ROLE / GRANT ROLE → DROP ROLEOnboarding the Application
Configure the broker for PostgreSQL access management. This is a one-time setup performed by an administrator.
Reference scripts are available in the britive/access-broker-examples repository under Postgres/permissions/.
Using the Britive Console
Deploy the Access Broker
Follow the Britive Access Broker deployment guide to install and register a broker with your Britive tenant.
Configure the broker scripts
git clone https://github.com/britive/access-broker-examples.git
# Copy Postgres/permissions/ scripts to your broker's scripts directoryCreate a PostgreSQL admin user for the broker
CREATE ROLE britive_admin WITH LOGIN PASSWORD 'strong-password' CREATEROLE;
GRANT target_role TO britive_admin WITH ADMIN OPTION;Store the credentials in the Britive Secrets Store.
Register the PostgreSQL database in Resource Manager
Navigate to Resource Manager → Resources → Add Resource. Enter the host, port, database name, and admin user details.
Verify broker connectivity
Confirm the broker can connect to PostgreSQL: psql -h <host> -U britive_admin -d <dbname> -c "\l"
Create Your First Access Profile
Using the Britive Console
Open Resource Manager
Navigate to Resource Manager → Profiles → Add Profile.
Configure the profile
| Field | Value |
|---|---|
| Name | A descriptive name (e.g., Postgres-ReadOnly) |
| Expiration | Set a max session duration (e.g., 2h) |
Associate resources
Under Associations, select the PostgreSQL resource.
Add a permission
Under Permissions, select the appropriate checkout/checkin routine (e.g., readonly role, superuser).
Add a policy
Under Policies, assign members and configure conditions.
Save and activate
Click Save.
Verify
Check out the profile
Navigate to My Access → find your profile → click Check Out. Britive returns temporary database credentials.
Connect to PostgreSQL
psql -h db.example.com -U <temp-username> -d myappConfirm access
SELECT current_user, current_role;Check in
Return to My Access → click Check In. Attempting to connect with the same credentials should fail with role does not exist.
Troubleshoot
| Symptom | Likely Cause | Fix |
|---|---|---|
| Checkout fails | Broker cannot reach PostgreSQL | Check network connectivity on port 5432 and pg_hba.conf rules |
permission denied on checkout | Admin user lacks CREATEROLE or GRANT OPTION | Grant required privileges to the britive_admin user |
| User not dropped after checkin | Checkin routine error or active sessions | Terminate active sessions before checkin, or check broker logs |