Authorization
This document describes how to configure Flipt’s authorization mechanisms.
Once authorization has been set to required: true
all management API routes will require a valid authentication session as well.
The UI will require a session-compatible authentication method (e.g. OIDC) to be enabled.
Flipt supports the ability to secure its core API routes by setting the required
field to true
on the authorization
configuration object.
When authorization is set to required
, the API will ensure valid credentials are present on all management API requests.
See the Authorization: Overview documentation for more details on Flipt’s API authorization handling.
Backends
Flipt uses Open Policy Agent (OPA) to enforce authorization policies. OPA is a general-purpose policy engine that can be used to enforce policies across the stack.
Flipt supports sourcing policies and external data from various backends. Currently, Flipt supports the following backends:
Local
Flipt supports loading policy and external data from the local filesystem.
Policies
For configuring policies, the files must be valid Rego files.
You can specify the path to the policy file in the policy
object in the authorization
configuration object.
The policy must have the following package declaration:
You can learn more about policies in our Authorization: Overview documentation.
Polling Interval
Flipt will poll the policy file for changes at a regular interval. By default, Flipt will poll the policy file every 5 minutes. You can adjust this interval by setting the poll_interval
field in the policy
object.
External Data
In addition to policies that can be used to enforce authorization rules, Flipt also provides a way to pass external data to the policy evaluation from the local filesystem. These data objects must be valid JSON objects.
This can be done by setting the data
object in the authorization
configuration object.
You can learn more about using data with policies in our Authorization: Overview documentation.
Polling Interval
Like policies, Flipt will poll data files for changes at a regular interval. By default, Flipt will poll the data file every 30 seconds. You can adjust this interval by setting the poll_interval
field in the data
object.
Bundle
Flipt supports loading policy and external data from OPA bundles. Bundles are a way to package policy and data files together as a single unit.
You can read more about creating and using OPA bundles in the OPA documentation.
Bundles can be hosted on a remote server and downloaded by Flipt at regular intervals. Some of the services that OPA bundles support out of the box include:
Bundle support is enabled by setting the backend
field to bundle
in the authorization
configuration object.
The bundle
backend requires a valid configuration
object to be set. This configuration definition is the same as the OPA bundle service configuration.
Object
Similar to our object storage support for Flipt flag data, Flipt also supports loading policy and external data from object storage.
Technically, this is a subset of the bundle backend, but it is useful for those who want to provide a simplified configuration for loading policy and data from object storage, without the need to configure the bundle service directly.
The object
backend requires a valid type
to be configured. This is similar to the object storage configuration for Flipt flag data as it also requires valid credentials to access the object storage service.
The credentials are read from environment variables at Flipt start time.
Currently, Flipt only supports the s3
object storage type directly. If you require support for other object storage types, please let us know.
Alternatively, as a workaround, you can use the bundle backend to load policy and data from other object storage types. Follow the OPA bundle documentation for more information.
Was this page helpful?