--- title: RBAC description: Configuration for Role Based Access Control. location: https://istio.io/docs/reference/config/authorization/istio.rbac.v1alpha1.html layout: protoc-gen-docs generator: protoc-gen-docs number_of_entries: 8 ---
Istio RBAC (Role Based Access Control) defines ServiceRole and ServiceRoleBinding objects.
A ServiceRole specification includes a list of rules (permissions). Each rule has the following standard fields:
In addition to the standard fields, operators can also use custom keys in the constraints
field,
the supported keys are listed in the “constraints and properties” page.
Below is an example of ServiceRole object “product-viewer”, which has “read” (“GET” and “HEAD”) access to “products.svc.cluster.local” service at versions “v1” and “v2”. “path” is not specified, so it applies to any path in the service.
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRole
metadata:
name: products-viewer
namespace: default
spec:
rules:
- services: ["products.svc.cluster.local"]
methods: ["GET", "HEAD"]
constraints:
- key: "destination.labels[version]"
values: ["v1", "v2"]
A ServiceRoleBinding specification includes two parts:
roleRef
field that refers to a ServiceRole object in the same namespace.subjects
that are assigned the roles.In addition to a simple user
field, operators can also use custom keys in the properties
field,
the supported keys are listed in the “constraints and properties” page.
Below is an example of ServiceRoleBinding object “test-binding-products”, which binds two subjects to ServiceRole “product-viewer”:
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRoleBinding
metadata:
name: test-binding-products
namespace: default
spec:
subjects:
- user: alice@yahoo.com
- properties:
source.namespace: "abc"
roleRef:
kind: ServiceRole
name: "products-viewer"
AccessRule defines a permission to access a list of services.
Definition of a custom constraint. The supported keys are listed in the “constraint and properties” page.
Name | Description |
---|---|
OFF |
Disable Istio RBAC completely, any other config in RbacConfig will be ignored and Istio RBAC policies will not be enforced. |
ON |
Enable Istio RBAC for all services and namespaces. |
ON_WITH_INCLUSION |
Enable Istio RBAC only for services and namespaces specified in the inclusion field. Any other services and namespaces not in the inclusion field will not be enforced by Istio RBAC policies. |
ON_WITH_EXCLUSION |
Enable Istio RBAC for all services and namespaces except those specified in the exclusion field. Any other services and namespaces not in the exclusion field will be enforced by Istio RBAC policies. |
Target defines a list of services or namespaces.
RoleRef refers to a role object.
ServiceRole specification contains a list of access rules (permissions).
ServiceRoleBinding assigns a ServiceRole to a list of subjects.
Subject defines an identity. The identity is either a user or identified by a set of properties
.
The supported keys in properties
are listed in “constraint and properties” page.