Skip to main content

OpenFGA (openfga)

Fine grained authorisation server (Zanzibar model) answering the relationship checks of the Control Plane.

Generated from catalog/services/openfga.yaml: do not edit by hand.

Summary​

Version1.22.1
Useinstall and configure, configure and connect
Layerfunctional (AI catalog)
CategorySecurity and policies
Installation methodsbinary, podman
External connectionno
Sandbox onlyno

Licence​

SPDX identifierApache-2.0
Licence policycore licence (MIT or Apache-2.0)
Licence exception-
Platform componentopenfga

Packages and artifacts​

A package the project of the service publishes (its image, its binary archive, its Python or OS package) carries the licence of the service; a third-party package carries the licence written on its row, read from the official upstream metadata.

KindPackageVersionLicenceDetails
container imagedocker.io/openfga/openfgav1.22.1Apache-2.0image key openfga, used by migrate, openfga-server, digest sha256:b852071314f1fda1194d341a6ebac0a4f619b3cd87a6626d2ccc7048af4ec671
binary archiveopenfga_1.22.1_linux_amd64.tar.gz1.22.1Apache-2.0https://github.com/openfga/openfga/releases/download/v1.22.1/openfga_1.22.1_linux_amd64.tar.gz, x86_64, checksum sha256

Images are pinned by tag in the descriptor, and by digest when the descriptor declares one (the offline bundle then refuses a pulled image that does not carry it); the digest is recorded in the mirror of the Manager when the offline bundle is imported, and every pull or load is checked against it.

Supported systems and architectures​

MethodOperating systemsArchitectures
binaryRHEL family (dnf), Debian family (apt), Arch Linux (pacman)x86_64 (architecture of the artifacts of the descriptor)
podmanRHEL family (dnf), Debian family (apt), Arch Linux (pacman)x86_64, aarch64 (not restricted by the descriptor)

Certified host systems: RHEL 8/9/10, Rocky Linux 8/9/10, AlmaLinux 8/9/10, Oracle Linux 8/9, CentOS Stream 9/10, Ubuntu 22.04/24.04, Debian 12, Arch Linux (rolling). The host preflight accepts these systems (other releases of a known family give a warning, end of life releases are refused) and the x86_64 and aarch64 architectures.

Prerequisites​

Host​

  • at least 512 MB of memory (blocking, memory).

Network and ports​

ComponentPort namePortOpened in the host firewall
openfga-serverhttp8080/tcpyes
openfga-servergrpc8081/tcpyes
openfga-servermetrics2112/tcpyes

Services and connections needed​

Details and resolution: see Dependencies.

Installation methods and modes​

MethodDefaultWhat the method uses
binaryyesthe binary archives of the descriptor, unpacked under the service directory
podman-the container images of the descriptor, run by Podman under systemd

Components​

ComponentKindInstallation methodsPorts
Schema migration (migrate)one shotbinary, podman-
OpenFGA server (openfga-server)masterbinary, podman8080/tcp, 8081/tcp, 2112/tcp

In memory (sandbox) (memory)​

One server, data kept in memory and lost at restart; no database.

What the mode deploys:

ComponentPlacement
migratenot used
openfga-servermin 1, max 1

Single server (standalone) (default)​

One server on PostgreSQL.

What the mode deploys:

ComponentPlacement
migratemin 1, max 1
openfga-servermin 1, max 1

Replicated (replicated)​

Several stateless servers on a shared PostgreSQL, behind the load balancer.

What the mode deploys:

ComponentPlacement
migratemin 1, max 1
openfga-servermin 2, recommended 3

Install this service​

The install wizard of the Navin Manager plans, validates and runs the installation; you need the services:install permission on the cluster.

  1. Open the wizard. In Clusters, choose the row action Install services of the target cluster. The wizard opens on its first step, Service.

  2. Choose the service. On the Service step, select OpenFGA. The card shows the licence Apache-2.0 and the dependencies the installation needs. Pick the Method among binary, podman (default binary).

  3. Choose the hosts and the mode. On the Hosts step, tick the hosts, then choose the Mode: memory, standalone (default), replicated. Each mode deploys the components listed in Installation methods and modes. With several components, place each one on its hosts in Component placement (Suggest placement proposes a placement that respects the cardinalities).

  4. Bind the dependencies. On the Bindings step, choose for each dependency (database) Install with the platform or Use an existing connection; an optional dependency can stay on No binding.

  5. Configure. On the Configure step, review the parameters (see Configuration parameters). Passwords left empty with a generated default are generated and sealed by the Manager.

  6. Review and install. On the Install step the Manager validates the plan and shows the installation order; when it says "The plan is valid. Ready to install.", choose Install. A highly available mode is installed only when its HA checks pass.

  7. Verify. The operation ends when the health checks of every instance pass (see Health checks); the service then shows as running in Services. Open the service and choose Run the smoke test in the Checks card: Creates a store and a model, writes a relation, checks it is allowed and that another one is not, then deletes the store.

Connect an existing service​

Schemeshttps, http
Default port8080
Authenticationoptional
Health check/healthz
Authentication methodFieldsDescription
presharedtokenPre-shared key of OPENFGA_AUTHN_PRESHARED_KEYS (authentication method preshared), the one the platform sends.
none-Method none (default of OpenFGA): any caller that reaches it reads and writes its tuples.

Official documentation: https://openfga.dev/docs/getting-started/setup-openfga/configure-openfga

FieldTypeDefaultDescriptionNotes
Store id (store_id)string-Store id used by the platform.-

High availability​

Clusterreplicas (replication)
High availabilityexternal (external)
Failoverload balancer (load-balancer)
Replicationshared store (shared-store)
Quorumnone (none)
Discoverynone (none)
Entry pointload balancer (load-balancer)
Official documentationhttps://openfga.dev/docs/best-practices/running-in-production
Peer TLS parametertls_enabled

Prerequisites​

PrerequisiteMust be highly availableModesDescription
databaseyesmodes of level ha or clusterHighly available PostgreSQL holding the authorization model and the tuples.

Topology per mode​

ModesHighest catalog levelDistributionQuorum componentFault domainsDescription
memorystandalone (standalone)single (single)-1One server, data in memory, lost at restart.
standalonestandalone (standalone)single (single)-1One server on PostgreSQL.
replicatedha (ha)active-active (active-active)-2Several stateless servers sharing PostgreSQL, behind the load balancer.

Configuration parameters​

Network​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
HTTP port (http_port)port8080-nonoyesPort of the HTTP API and of /healthz.
gRPC port (grpc_port)port8081-nonoyesPort of the gRPC API.
Metrics port (metrics_port)port2112-nonoyesPrometheus port.
TLS (tls_enabled)boolfalse-nonoyesServe the HTTP and gRPC APIs over TLS with a certificate of the manager CA.

Security​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Preshared key (preshared_key)passwordgenerated-noyesnoBearer key of the API clients (EAI_OPENFGA_API_TOKEN of the Control Plane).

Logging​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Log level (log_level)enuminfodebug, info, warn, errornononoVerbosity of the server log.

Dependencies​

For each active dependency the Manager takes the first of: the binding chosen in the wizard; a service of the same installation that provides it; a service already installed in the cluster; the only connection of the expected type. Otherwise an optional dependency stays unbound, and a required one is added to the installation in its default mode (the column below names the catalog service added).

BindingProvided byConnection typeEndpointOptionalWhen nothing is boundDescription
database (standalone, replicated)postgresqlpostgresqlsqlnopostgresql is added to the installationDatastore of the authorisation tuples and models.

Endpoints​

EndpointSchemeComponentPortPathTLS parameterBinding parametersBinding secretsProvisioning command
httphttpopenfga-server8080 (http_port)-tls_enabled-token-
grpcgrpcopenfga-server8081 (grpc_port)-----

Client configuration files​

Files rendered for the client configuration download:

  • openfga.env (client.env.j2)

Commands​

CommandComponentTargetDescription
Migrate the schema (migrate)openfga-serverfirst hostApplies the datastore migrations (PostgreSQL modes; required before every upgrade).

Health checks​

Liveness (per instance)​

ComponentCheckDetails
openfga-serverHTTP {{ 'https' if config.tls_enabled else 'http' }}://{{ host.fqdn if config.tls_enabled else (host.ip or '127.0.0.1') }}:{{ config.http_port }}/healthzExpected 200; 30 retries; interval 1 s; timeout 3 s

Readiness (service check)​

CheckDetails
HTTP {{ 'https' if config.tls_enabled else 'http' }}://{{ host.fqdn if config.tls_enabled else (host.ip or '127.0.0.1') }}:{{ config.http_port }}/healthzExpected 200; 5 retries; interval 2 s; timeout 5 s

Smoke test​

Creates a store and a model, writes a relation, checks it is allowed and that another one is not, then deletes the store. (openfga-server: create_store, write_model, write_tuple, check_allowed, check_denied, delete_store)

Preflight checks​

CheckTypeMeaningSeverityComponents
memorymemory_mb {"min": 512}at least 512 MB of memoryblockingevery component
http_port_freeport_free {"param": "http_port"}port 8080 free on the hostblockingopenfga-server
grpc_port_freeport_free {"param": "grpc_port"}port 8081 free on the hostblockingopenfga-server

Uninstall​

Paths removed when the data is purged: {{ paths.log }}.

  • Metrics: http://{{ host.fqdn }}:{{ config.metrics_port }}/metrics

Upstream documentation​