infra/website/docs/blog/feast-launches-rbac.md
Feast now supports Role Based Access Controls (RBAC) so you can secure and govern your data.
If you ever wanted to securely partition your feature store across different teams, the new Feast permissions model is here to make that possible!
This powerful feature allows administrators to configure granular authorization policies, letting them decide which users and groups can access specific resources and what operations they can perform.
The default implementation is based on Role-Based Access Control (RBAC): user roles determine whether a user has permission to perform specific functions on registered resources.
Feature stores often operate on sensitive, proprietary data and we want to make sure teams are able to govern the access and control of that data thoughtfully, while benefiting from transparent code and an open source community like Feast.
That's why we built RBAC using Kubernetes RBAC and OpenID Connect protocol (OIDC), ensuring secure, fine-grained access control in Feast.
Using the Feast Permissions Model offers two key benefits:
The RBAC configuration is defined using a new Feast object type called "Permission". Permissions are registered in the Feast registry and are defined and applied like all the other registry objects, using Python code.
A permission is defined by these three components:
The resource types supported by the permission framework are those defining the customer feature store:
TIP: Check out the Permission APIs in the Feast Python API Documentation to learn more!
# This configuration grants users with the 'owner' role permissions
# to fetch resource status and read data from all the feature views
from feast.permissions.action import AuthzedAction, READ
# Note: READ is a global list including both READ_OFFLINE and
# READ_ONLINE values from AuthzedAction enum
# You do not have to specify `name_patterns`
Permission(
name="fv-owner",
types=[FeatureView],
policy=RoleBasedPolicy(roles=["owner"]),
actions=[AuthzedAction.DESCRIBE, READ],
)
# This configuration grants users with the 'lab' role permissions
# to fetch resource status and read data from all feature views
# named 'lab_stream_feature_view' or 'lab_feature_view'
from feast.permissions.action import AuthzedAction, READ
Permission(
name="lab-reader",
types=[FeatureView],
name_patterns=["lab_stream_feature_view", "lab_feature_view"],
policy=RoleBasedPolicy(roles=["lab"]),
actions=[AuthzedAction.DESCRIBE, READ],
)
# As an alternative, we can use Python regular expression patterns
# to grant the same permission to all feature views whose name
# starts by 'lab'
from feast.permissions.action import AuthzedAction, READ
Permission(
name="lab-reader",
types=[FeatureView],
name_patterns="lab.*", # Accepts both 'str' and 'list[str]' types
policy=RoleBasedPolicy(roles=["lab"]),
actions=[AuthzedAction.DESCRIBE, READ],
)
# This configuration grants users with the 'prod' role permissions
# to fetch resource status and read data from all feature views
# whose names include the '_prod_' word
from feast.permissions.action import AuthzedAction, READ
Permission(
name="prod-reader",
types=[FeatureView, FeatureService],
name_patterns=".*_prod_.*",
policy=RoleBasedPolicy(roles=["prod"]),
actions=[AuthzedAction.DESCRIBE, READ],
)
# This configuration grants permissions to write on all data sources
# tagged with 'risk_level' set to 'high', exclusively to users
# with the 'admin' or 'data_team' roles
from feast.permissions.action import WRITE
# Note: WRITE is a global list including both WRITE_OFFLINE and
# WRITE_ONLINE values from AuthzedAction enum
Permission(
name="data-writer",
types=[DataSource],
required_tags={"risk_level": "high"},
policy=RoleBasedPolicy(roles=["admin", "data_team"]),
actions=[WRITE],
)
But wait a moment—does that mean every time I access the FeatureStore API, I have to go through an authorization check?
Well, yes and no-but mostly no if you work in a development environment.
If your environment doesn't use any remote Feast service, RBAC enforcement won't take place.
Indeed, the reference architecture for the permission model feature represents a fully distributed environment:
<div class="content-image"> </div>Currently, only the following Python servers are supported in an authorized environment:
For backward compatibility, by default no authorizations are enforced. The authorization functionality must be explicitly enabled using the auth configuration section in feature_store.yaml.
Of course, all server and client applications must have a consistent configuration.
Currently, feast supports OIDC and Kubernetes RBAC authentication/authorization.
The feast CLI includes a new permissions command to list the registered permissions, with options to identify the matching resources for each configured permission and the existing resources that are not covered by any permission.
For troubleshooting purposes, it also provides a command to list all the resources and operations allowed to any managed role.
This new feature includes working examples for both supported authorization protocols. You can start by experimenting with these examples to see how they fit your own feature store and assess their benefits.
As this is a completely new functionality, your feedback will be extremely valuable. It will help us adapt the feature to meet real-world requirements and better serve our customers.