mirror of https://github.com/istio/istio.io.git
505 lines
13 KiB
HTML
505 lines
13 KiB
HTML
---
|
|
WARNING: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT. PLEASE MODIFY THE ORIGINAL SOURCE IN THE 'https://github.com/istio/api' REPO
|
|
source_repo: https://github.com/istio/api
|
|
title: RBAC (deprecated)
|
|
description: Configuration for Role Based Access Control.
|
|
location: https://istio.io/docs/reference/config/security/istio.rbac.v1alpha1.html
|
|
layout: protoc-gen-docs
|
|
generator: protoc-gen-docs
|
|
schema: istio.rbac.v1alpha1.RbacConfig
|
|
schema: istio.rbac.v1alpha1.ServiceRole
|
|
schema: istio.rbac.v1alpha1.ServiceRoleBinding
|
|
weight: 40
|
|
aliases: [/docs/reference/config/authorization/istio.rbac.v1alpha1]
|
|
number_of_entries: 9
|
|
---
|
|
<p>Note: The v1alpha1 RBAC policy is deprecated by the v1beta1 Authorization policy.
|
|
This page is kept for migration purpose and will be removed in Istio 1.6.</p>
|
|
|
|
<p>Istio RBAC (Role Based Access Control) defines ServiceRole and ServiceRoleBinding
|
|
objects.</p>
|
|
|
|
<p>A ServiceRole specification includes a list of rules (permissions). Each rule has
|
|
the following standard fields:</p>
|
|
|
|
<ul>
|
|
<li>services: a list of services.</li>
|
|
<li>methods: A list of HTTP methods. You can set the value to <code>["*"]</code> to include all HTTP methods.
|
|
This field should not be set for TCP services. The policy will be ignored.
|
|
For gRPC services, only <code>POST</code> is allowed; other methods will result in denying services.</li>
|
|
<li>paths: HTTP paths or gRPC methods. Note that gRPC methods should be
|
|
presented in the form of “/packageName.serviceName/methodName” and are case sensitive.</li>
|
|
</ul>
|
|
|
|
<p>In addition to the standard fields, operators can also use custom keys in the <code>constraints</code> field,
|
|
the supported keys are listed in the “constraints and properties” page.</p>
|
|
|
|
<p>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.</p>
|
|
|
|
<pre><code class="language-yaml">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"]
|
|
</code></pre>
|
|
|
|
<p>A ServiceRoleBinding specification includes two parts:</p>
|
|
|
|
<ul>
|
|
<li>The <code>roleRef</code> field that refers to a ServiceRole object in the same namespace.</li>
|
|
<li>A list of <code>subjects</code> that are assigned the roles.</li>
|
|
</ul>
|
|
|
|
<p>In addition to a simple <code>user</code> field, operators can also use custom keys in the <code>properties</code> field,
|
|
the supported keys are listed in the “constraints and properties” page.</p>
|
|
|
|
<p>Below is an example of ServiceRoleBinding object “test-binding-products”, which binds two subjects
|
|
to ServiceRole “product-viewer”:</p>
|
|
|
|
<ul>
|
|
<li>User “alice@yahoo.com”</li>
|
|
<li>Services in “abc” namespace.</li>
|
|
</ul>
|
|
|
|
<pre><code class="language-yaml">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"
|
|
</code></pre>
|
|
|
|
<h2 id="AccessRule">AccessRule</h2>
|
|
<section>
|
|
<p>AccessRule defines a permission to access a list of services.</p>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="AccessRule-services">
|
|
<td><code>services</code></td>
|
|
<td><code>string[]</code></td>
|
|
<td>
|
|
<p>A list of service names.
|
|
Exact match, prefix match, and suffix match are supported for service names.
|
|
For example, the service name “bookstore.mtv.cluster.local” matches
|
|
“bookstore.mtv.cluster.local” (exact match), or “bookstore*” (prefix match),
|
|
or “*.mtv.cluster.local” (suffix match).
|
|
If set to [”*”], it refers to all services in the namespace.</p>
|
|
|
|
</td>
|
|
<td>
|
|
Yes
|
|
</td>
|
|
</tr>
|
|
<tr id="AccessRule-paths">
|
|
<td><code>paths</code></td>
|
|
<td><code>string[]</code></td>
|
|
<td>
|
|
<p>Optional. A list of HTTP paths or gRPC methods.
|
|
gRPC methods must be presented as fully-qualified name in the form of
|
|
“/packageName.serviceName/methodName” and are case sensitive.
|
|
Exact match, prefix match, and suffix match are supported. For example,
|
|
the path “/books/review” matches “/books/review” (exact match),
|
|
or “/books/*” (prefix match), or “*/review” (suffix match).
|
|
If not specified, it matches to any path.
|
|
This field should not be set for TCP services. The policy will be ignored.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="AccessRule-methods">
|
|
<td><code>methods</code></td>
|
|
<td><code>string[]</code></td>
|
|
<td>
|
|
<p>Optional. A list of HTTP methods (e.g., “GET”, “POST”).
|
|
If not specified or specified as “*”, it matches to any methods.
|
|
This field should not be set for TCP services. The policy will be ignored.
|
|
For gRPC services, only <code>POST</code> is allowed; other methods will result in denying services.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="AccessRule-constraints">
|
|
<td><code>constraints</code></td>
|
|
<td><code><a href="#AccessRule-Constraint">Constraint[]</a></code></td>
|
|
<td>
|
|
<p>Optional. Extra constraints in the ServiceRole specification.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="AccessRule-Constraint">AccessRule.Constraint</h2>
|
|
<section>
|
|
<p>Definition of a custom constraint. The supported keys are listed in the “constraint and properties” page.</p>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="AccessRule-Constraint-key">
|
|
<td><code>key</code></td>
|
|
<td><code>string</code></td>
|
|
<td>
|
|
<p>Key of the constraint.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="AccessRule-Constraint-values">
|
|
<td><code>values</code></td>
|
|
<td><code>string[]</code></td>
|
|
<td>
|
|
<p>List of valid values for the constraint.
|
|
Exact match, prefix match, and suffix match are supported.
|
|
For example, the value “v1alpha2” matches “v1alpha2” (exact match),
|
|
or “v1*” (prefix match), or “*alpha2” (suffix match).</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="RbacConfig">RbacConfig</h2>
|
|
<section>
|
|
<p>RbacConfig implements the ClusterRbacConfig Custom Resource Definition for controlling Istio RBAC behavior.
|
|
The ClusterRbacConfig Custom Resource is a singleton where only one ClusterRbacConfig should be created
|
|
globally in the mesh and the namespace should be the same to other Istio components, which usually is <code>istio-system</code>.</p>
|
|
|
|
<p>Below is an example of an <code>ClusterRbacConfig</code> resource called <code>istio-rbac-config</code> which enables Istio RBAC for all
|
|
services in the default namespace.</p>
|
|
|
|
<pre><code class="language-yaml">apiVersion: "rbac.istio.io/v1alpha1"
|
|
kind: ClusterRbacConfig
|
|
metadata:
|
|
name: default
|
|
namespace: istio-system
|
|
spec:
|
|
mode: ON_WITH_INCLUSION
|
|
inclusion:
|
|
namespaces: [ "default" ]
|
|
</code></pre>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="RbacConfig-mode">
|
|
<td><code>mode</code></td>
|
|
<td><code><a href="#RbacConfig-Mode">Mode</a></code></td>
|
|
<td>
|
|
<p>Istio RBAC mode.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="RbacConfig-inclusion">
|
|
<td><code>inclusion</code></td>
|
|
<td><code><a href="#RbacConfig-Target">Target</a></code></td>
|
|
<td>
|
|
<p>A list of services or namespaces that should be enforced by Istio RBAC policies. Note: This field have
|
|
effect only when mode is ON<em>WITH</em>INCLUSION and will be ignored for any other modes.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="RbacConfig-exclusion">
|
|
<td><code>exclusion</code></td>
|
|
<td><code><a href="#RbacConfig-Target">Target</a></code></td>
|
|
<td>
|
|
<p>A list of services or namespaces that should not be enforced by Istio RBAC policies. Note: This field have
|
|
effect only when mode is ON<em>WITH</em>EXCLUSION and will be ignored for any other modes.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="RbacConfig-Mode">RbacConfig.Mode</h2>
|
|
<section>
|
|
<table class="enum-values">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="RbacConfig-Mode-OFF">
|
|
<td><code>OFF</code></td>
|
|
<td>
|
|
<p>Disable Istio RBAC completely, Istio RBAC policies will not be enforced.</p>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr id="RbacConfig-Mode-ON">
|
|
<td><code>ON</code></td>
|
|
<td>
|
|
<p>Enable Istio RBAC for all services and namespaces. Note Istio RBAC is deny-by-default
|
|
which means all requests will be denied if it’s not allowed by RBAC rules.</p>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr id="RbacConfig-Mode-ON_WITH_INCLUSION">
|
|
<td><code>ON_WITH_INCLUSION</code></td>
|
|
<td>
|
|
<p>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.</p>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr id="RbacConfig-Mode-ON_WITH_EXCLUSION">
|
|
<td><code>ON_WITH_EXCLUSION</code></td>
|
|
<td>
|
|
<p>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.</p>
|
|
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="RbacConfig-Target">RbacConfig.Target</h2>
|
|
<section>
|
|
<p>Target defines a list of services or namespaces.</p>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="RbacConfig-Target-services">
|
|
<td><code>services</code></td>
|
|
<td><code>string[]</code></td>
|
|
<td>
|
|
<p>A list of services.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="RbacConfig-Target-namespaces">
|
|
<td><code>namespaces</code></td>
|
|
<td><code>string[]</code></td>
|
|
<td>
|
|
<p>A list of namespaces.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="RoleRef">RoleRef</h2>
|
|
<section>
|
|
<p>RoleRef refers to a role object.</p>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="RoleRef-kind">
|
|
<td><code>kind</code></td>
|
|
<td><code>string</code></td>
|
|
<td>
|
|
<p>The type of the role being referenced.
|
|
Currently, “ServiceRole” is the only supported value for “kind”.</p>
|
|
|
|
</td>
|
|
<td>
|
|
Yes
|
|
</td>
|
|
</tr>
|
|
<tr id="RoleRef-name">
|
|
<td><code>name</code></td>
|
|
<td><code>string</code></td>
|
|
<td>
|
|
<p>The name of the ServiceRole object being referenced.
|
|
The ServiceRole object must be in the same namespace as the ServiceRoleBinding object.</p>
|
|
|
|
</td>
|
|
<td>
|
|
Yes
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="ServiceRole">ServiceRole</h2>
|
|
<section>
|
|
<p>ServiceRole specification contains a list of access rules (permissions).</p>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="ServiceRole-rules">
|
|
<td><code>rules</code></td>
|
|
<td><code><a href="#AccessRule">AccessRule[]</a></code></td>
|
|
<td>
|
|
<p>The set of access rules (permissions) that the role has.</p>
|
|
|
|
</td>
|
|
<td>
|
|
Yes
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="ServiceRoleBinding">ServiceRoleBinding</h2>
|
|
<section>
|
|
<p>ServiceRoleBinding assigns a ServiceRole to a list of subjects.</p>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="ServiceRoleBinding-subjects">
|
|
<td><code>subjects</code></td>
|
|
<td><code><a href="#Subject">Subject[]</a></code></td>
|
|
<td>
|
|
<p>List of subjects that are assigned the ServiceRole object.</p>
|
|
|
|
</td>
|
|
<td>
|
|
Yes
|
|
</td>
|
|
</tr>
|
|
<tr id="ServiceRoleBinding-roleRef">
|
|
<td><code>roleRef</code></td>
|
|
<td><code><a href="#RoleRef">RoleRef</a></code></td>
|
|
<td>
|
|
<p>Reference to the ServiceRole object.</p>
|
|
|
|
</td>
|
|
<td>
|
|
Yes
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="Subject">Subject</h2>
|
|
<section>
|
|
<p>Subject defines an identity. The identity is either a user or identified by a set of <code>properties</code>.
|
|
The supported keys in <code>properties</code> are listed in “constraint and properties” page.</p>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="Subject-user">
|
|
<td><code>user</code></td>
|
|
<td><code>string</code></td>
|
|
<td>
|
|
<p>Optional. The user name/ID that the subject represents.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Subject-properties">
|
|
<td><code>properties</code></td>
|
|
<td><code>map<string, string></code></td>
|
|
<td>
|
|
<p>Optional. The set of properties that identify the subject.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|