Skip to main content

No project description provided

Project description

Azure Auth PgBouncer

Azure Auth PgBouncer is designed to make securing connections to Azure PostgreSQL databases with Entra ID a breeze.

It was inspired by the GCP Cloud SQL Auth Proxy, but instead of doing the hard work of proxying the traffic, it orchestrates PgBouncer to do it instead by rotating an access token and updating its configuration accordingly.

Installation

pip

pipx install azure-auth-pgbouncer

Usage

Locally

When starting Azure Auth PgBouncer locally, you will need to start the two processes (PgBouncer and token refresher) separately.

First, fire up the token refresher:

PID_FILE=pgbouncer.pid AUTH_FILE=users.txt PGUSER=<identity-name> azure-auth-pgbouncer

Then, once it's fetched its first token and users.txt appears in the directory, configure PgBouncer in a file named pgbouncer.ini:

[databases]
* = host=<azure-postgresql-database-host>

[pgbouncer]
pool_mode = session
listen_port = 5432
listen_addr = 127.0.0.1
auth_type = trust
auth_file = users.txt
pidfile = pgbouncer.pid
server_tls_sslmode = require # verify-full recommended

and launch it:

pgbouncer pgbouncer.ini

Docker

Due to the tight integration, PgBouncer and the token refresher come bundled in a single Docker container.

docker run -e PGUSER=<identity-name> -it ghcr.io/mmalecki/azure-auth-pgbouncer:latest

On Kubernetes

As a sidecar

As a deployment/statefulset/...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure_auth_pgbouncer-0.2.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

azure_auth_pgbouncer-0.2.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file azure_auth_pgbouncer-0.2.0.tar.gz.

File metadata

  • Download URL: azure_auth_pgbouncer-0.2.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.10 Linux/6.12.25-amd64

File hashes

Hashes for azure_auth_pgbouncer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b24501e853cb728dc878af0f5ad15633bbed187b640fc7e91663ea53154ac1f
MD5 903bf8247544efe60bd5bdc18180c8d5
BLAKE2b-256 f23e3602873334e1ad9a8622e7e520b6767c35f3bbb979cece50480cc7150438

See more details on using hashes here.

File details

Details for the file azure_auth_pgbouncer-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_auth_pgbouncer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d83e497a70c75abece5e50fab7ffb71a16c18ef462232d939bd93efc32f2ecc
MD5 939ffa9365d8df0946be5da8dfc6c3fa
BLAKE2b-256 97b3103f1fe0a05f8162d82ab5e88a805e579be13686839215dd0985dd0a0e14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page