Website · Documentation · Configuration · Security · Downloads
portal is one program for the web services of a lab. It opens sessions for people and guards each service. It gives keys to AI agents, answers AuthZEN questions and sends alerts to Android phones.
It is for people who run their own services behind Traefik and want one account system, one gate and one inbox. A key never has more rights than the person who owns it. A service does not manage users or keys. It gets a short identity token and asks portal what the key may do.
portal is the backend, the edge and the decision point of ProcurAuth. It has one binary, one configuration file and one database (SQLite, or PostgreSQL for several instances).
Traefik asks portal about each request. portal answers from memory with the grants of the person. For an agent, portal checks the key and gives the service an identity token. The service asks the decision point one AuthZEN question and applies the limits in the answer.
flowchart LR
P([Person]) -- session --> T[Traefik]
A([AI agent<br/>key mcp_...]) -- key --> T
T -- ForwardAuth --> G["portal :4181<br/>gate, accounts, keys"]
G -- identity token --> T
T -- request and token --> S[Service]
S -- AuthZEN question --> D{"portal PDP :4182"}
D -- decision and limits --> S
G --- DB[(SQLite or PostgreSQL)]
D --- DB
| Part | What it gives |
|---|---|
| Launcher | A page of tiles for the services of the lab. A service lists itself with a label (Docker Compose) or an annotation (Kubernetes). |
| Gate | A Traefik ForwardAuth server. A grant is an action on a node of the resource tree of a service. A new user has no grant. |
| Accounts | Argon2id passwords, opaque sessions bound to the client, a second factor (TOTP), and a log of sign-ins. |
| Keys and limits | mcp_ keys for agents and api_ keys for senders. A key follows its owner. Ceilings and budgets limit it. |
| Decision point | An AuthZEN PDP on its own port. It signs identity tokens and counts budgets. |
| Approvals | A grant can ask a person before each use by a key. The person answers on a phone or on a web page. |
| Inbox | Alerts, questions and approvals for the Android app Portal Inbox, on a Noise session. Each phone shows each alert one time. |
| Configuration | One strict HCL file. An unknown key stops the program. A secret comes only from _env or _file. |
Alice has the grant query.run.read on the host local of the service db. Her agent has a key with a ceiling max_rows of 100. The service db asks one question:
{ "subject": { "type": "user", "id": "key:9b1c5d0e" },
"action": { "name": "query.run.read" },
"resource": { "type": "database", "id": "analytics",
"properties": { "ancestors": [ { "type": "service", "id": "db" },
{ "type": "host", "id": "local" } ] } },
"context": { "usage": { "units": 1 } } }portal answers that the key may read, with the ceiling and the count of the budget:
{ "decision": true, "context": { "limits": { "max_rows": 100 }, "usage": { "units": 1 } } }When the budget is spent, the answer is { "decision": false, "context": { "reason": "budget_exceeded", "retry_after": 12 } }. The grant on the host covers the database below it. The key holds only what its owner holds.
This section gives two paths: the release binary and the Compose stack.
This path takes five minutes on Linux (amd64 or arm64). Docker is not necessary. You need curl, sha256sum, tar and openssl.
These commands download portal and check the archive. For arm64, use the archive portal_5.7.0_linux_arm64.tar.gz. The archive holds one static file, portal.
curl -fsSLO https://github.com/ProcurAuth/portal/releases/download/v5.7.0/portal_5.7.0_linux_amd64.tar.gz
curl -fsSLO https://github.com/ProcurAuth/portal/releases/download/v5.7.0/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS
tar -xzf portal_5.7.0_linux_amd64.tar.gz
./portal versionMake the secret files. The first two files hold the login and the password of the superadmin. The third file holds the key that encrypts the secrets of the second factor.
mkdir -p secrets data
echo admin > secrets/superadmin_login
openssl rand -base64 24 > secrets/superadmin_password
openssl rand -hex 32 > secrets/totp_key
chmod 600 secrets/*These commands write the configuration, check it and start portal. A path in the file must be absolute. The shell replaces $PWD with the current directory.
cat > config.hcl <<EOF
server {
listen_address = "127.0.0.1:4181"
trusted_proxies = []
}
authentication {
superadmin_login_file = "$PWD/secrets/superadmin_login"
superadmin_password_file = "$PWD/secrets/superadmin_password"
totp_key_file = "$PWD/secrets/totp_key"
}
storage {
database = "$PWD/data/portal.db"
}
EOF
./portal check-config --config config.hcl
./portal run --config config.hclcheck-config prints the value of each key and its source: file, default, or file: and the path of a secret file. It shows <hidden> in place of the values of the secret files. Its last line is configuration ok.
Open http://127.0.0.1:4181/auth/login. Use the login admin and the password in secrets/superadmin_password. Press Ctrl+C to stop portal.
The file has no keys, pdp or inbox block, and it trusts no proxy. With SQLite, the sessions stay in the memory of the process, so a restart ends them. Configuration gives each block and each default.
The stack has portal with the inbox, and PostgreSQL. You need git and Docker. The image stays on your machine.
git clone https://github.com/ProcurAuth/portal && cd portal
tools/build.sh image # builds the image on this machine
deploy/compose/init-secrets.sh # makes the secret files
docker compose up -d # starts portal and PostgreSQL on 127.0.0.1:4181Open http://127.0.0.1:4181/auth/login. Use the login and the password from the files superadmin_login and superadmin_password in deploy/compose/secrets/. The command docker compose down -v stops the stack and deletes its data.
For a stack with Traefik, example services, three users and grants, run ./demo/up.sh. See Getting started.
portal is a program of the ProcurAuth organisation. The organisation holds the open specification and the programs that follow it. The implementations page lists them, with the results of the conformance runs.
| Part | Role | Repository | Site |
|---|---|---|---|
| procurauth | The specification and the reference tools | ProcurAuth/procurauth | procurauth.github.io/procurauth |
| portal | Backend, edge and PDP | ProcurAuth/portal | procurauth.github.io/portal |
| Stowr | PEP: a browser for S3, Google Cloud Storage and folders | ProcurAuth/stowr | procurauth.github.io/stowr |
| Hune | PEP: dashboards over ClickHouse, PostgreSQL and MongoDB | ProcurAuth/hune | No public site yet |
| ClickHouse Dash | PEP and MCP server: a query console for ClickHouse | Outside this organisation | Implementations page |
To add a program to this list, open an issue in the specification repository.
The site and the docs/ folder have the same pages. The Markdown files are the source.
| Page | Content |
|---|---|
| Overview | What portal is and how it is built |
| Getting started | Compose stack, demo, first service |
| Architecture | Listeners, flows, layout of the repository |
| Authentication and sessions | Accounts, sessions, second factor |
| Grants and the gate | The resource tree, grants, the decision of the gate |
| Identity tokens and the PDP | Tokens, AuthZEN endpoints, approvals |
| Keys and limits | Key kinds, ceilings, budgets |
| Launcher and service discovery | Labels, annotations, health |
| Settings pages and history | Users, grants, keys, activity |
| Several instances | PostgreSQL and high availability |
| Traefik and TLS | The duties of the proxy |
| Inbox | Alerts, agents, approvals, the Android app |
| Configuration | Every key, generated from the code |
| Security model | Trust, invariants, hardening |
| Operations | Metrics, backups, upgrades |
| Build and release | Build, test, release |
| Reference | HTTP endpoints and error codes |
| Limitations | Known limits |
| Changelog | History of the versions |
Use Docker. Do not install Rust on your machine.
tools/dev/lint.sh # format and clippy
tools/dev/test.sh # the tests, with a throwaway PostgreSQLReport a vulnerability in private: https://github.com/ProcurAuth/portal/security/advisories/new. Do not open a public issue. Read SECURITY.md for the scope and the response times, and Security model for the model.
Read CONTRIBUTING.md and the code of conduct. The tests and the checks run in Docker with tools/dev/lint.sh and tools/dev/test.sh.
portal is licensed under either of MIT or Apache-2.0, at your option.