Skip to content

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 CREATEROLE and GRANT OPTION on the target roles
  • psql available 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 ROLE

Onboarding 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 directory

Create 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 ManagerResourcesAdd 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 ManagerProfilesAdd Profile.

Configure the profile

FieldValue
NameA descriptive name (e.g., Postgres-ReadOnly)
ExpirationSet 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 myapp

Confirm 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

SymptomLikely CauseFix
Checkout failsBroker cannot reach PostgreSQLCheck network connectivity on port 5432 and pg_hba.conf rules
permission denied on checkoutAdmin user lacks CREATEROLE or GRANT OPTIONGrant required privileges to the britive_admin user
User not dropped after checkinCheckin routine error or active sessionsTerminate active sessions before checkin, or check broker logs

Next Steps

Last updated on