Push validated Cerbos policies to Cerbos Hub on every merge using a GitLab CI/CD pipeline.
A single .gitlab-ci.yml file triggers policy uploads on every push to your main branch
Store Cerbos Hub credentials as protected and masked CI/CD variables, injected securely at runtime
Cerbos Hub distributes updated bundles to connected PDPs with no restarts or redeployments
Authorization policies should go through the same review and deployment rigour as application code. GitLab CI/CD lets you automate that workflow so every policy change is tested and deployed without manual steps.
Cerbos Hub stores your compiled policy bundles and distributes them to connected PDP instances. A CI/CD pipeline pushes validated policies to Cerbos Hub on every merge, and your PDPs pick up the changes automatically.
With GitLab CI/CD handling the pipeline and Cerbos Hub handling distribution, policy updates flow from pull request to production with a full audit trail and zero downtime.
.gitlab-ci.yml to your repository with a job that uses Docker-in-Docker to run the cerbosctl image.CERBOS_HUB_CLIENT_ID and CERBOS_HUB_CLIENT_SECRET as protected, masked variables in GitLab.hub store replace-files.A job uses Docker-in-Docker to run the cerbosctl image and execute `hub store replace-files`, uploading your policy directory to Cerbos Hub. Connected PDP instances pull the updated bundle automatically.
You need a Cerbos Hub client ID and client secret with Read & Write permissions, stored as protected and masked CI/CD variables in GitLab.
Either works. The pipeline uses Docker-in-Docker, which is supported by GitLab shared runners and self-hosted runners with Docker enabled.
What is Cerbos?
Cerbos is an end-to-end enterprise authorization software for Zero Trust environments and AI-powered systems. It enforces fine-grained, contextual, and continuous authorization across apps, APIs, AI agents, MCP servers, services, and workloads.
Cerbos consists of an open-source Policy Decision Point, Enforcement Point integrations, and a centrally managed Policy Administration Plane (Cerbos Hub) that coordinates unified policy-based authorization across your architecture. Enforce least privilege & maintain full visibility into access decisions with Cerbos authorization.