public static final class RBAC.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder> implements RBACOrBuilder
Role Based Access Control (RBAC) provides service-level and method-level access control for a
service. RBAC policies are additive. The policies are examined in order. Requests are allowed
or denied based on the `action` and whether a matching policy is found. For instance, if the
action is ALLOW and a matching policy is found the request should be allowed.
RBAC can also be used to make access logging decisions by communicating with access loggers
through dynamic metadata. When the action is LOG and at least one policy matches, the
`access_log_hint` value in the shared key namespace 'envoy.common' is set to `true` indicating
the request should be logged.
Here is an example of RBAC configuration. It has two policies:
* Service account "cluster.local/ns/default/sa/admin" has full access to the service, and so
does "cluster.local/ns/default/sa/superuser".
* Any user can read ("GET") the service at paths with prefix "/products", so long as the
destination port is either 80 or 443.
.. code-block:: yaml
action: ALLOW
policies:
"service-admin":
permissions:
- any: true
principals:
- authenticated:
principal_name:
exact: "cluster.local/ns/default/sa/admin"
- authenticated:
principal_name:
exact: "cluster.local/ns/default/sa/superuser"
"product-viewer":
permissions:
- and_rules:
rules:
- header: { name: ":method", exact_match: "GET" }
- url_path:
path: { prefix: "/products" }
- or_rules:
rules:
- destination_port: 80
- destination_port: 443
principals:
- any: true
Protobuf type envoy.config.rbac.v4alpha.RBAC| Modifier and Type | Method and Description |
|---|---|
RBAC.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
RBAC |
build() |
RBAC |
buildPartial() |
RBAC.Builder |
clear() |
RBAC.Builder |
clearAction()
The action to take if a policy matches.
|
RBAC.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
RBAC.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
RBAC.Builder |
clearPolicies() |
RBAC.Builder |
clone() |
boolean |
containsPolicies(String key)
Maps from policy name to policy.
|
RBAC.Action |
getAction()
The action to take if a policy matches.
|
int |
getActionValue()
The action to take if a policy matches.
|
RBAC |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
Map<String,Policy> |
getMutablePolicies()
Deprecated.
|
Map<String,Policy> |
getPolicies()
Deprecated.
|
int |
getPoliciesCount()
Maps from policy name to policy.
|
Map<String,Policy> |
getPoliciesMap()
Maps from policy name to policy.
|
Policy |
getPoliciesOrDefault(String key,
Policy defaultValue)
Maps from policy name to policy.
|
Policy |
getPoliciesOrThrow(String key)
Maps from policy name to policy.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapField |
internalGetMapField(int number) |
protected com.google.protobuf.MapField |
internalGetMutableMapField(int number) |
boolean |
isInitialized() |
RBAC.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
RBAC.Builder |
mergeFrom(com.google.protobuf.Message other) |
RBAC.Builder |
mergeFrom(RBAC other) |
RBAC.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
RBAC.Builder |
putAllPolicies(Map<String,Policy> values)
Maps from policy name to policy.
|
RBAC.Builder |
putPolicies(String key,
Policy value)
Maps from policy name to policy.
|
RBAC.Builder |
removePolicies(String key)
Maps from policy name to policy.
|
RBAC.Builder |
setAction(RBAC.Action value)
The action to take if a policy matches.
|
RBAC.Builder |
setActionValue(int value)
The action to take if a policy matches.
|
RBAC.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
RBAC.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
RBAC.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapField internalGetMapField(int number)
internalGetMapField in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>protected com.google.protobuf.MapField internalGetMutableMapField(int number)
internalGetMutableMapField in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic RBAC build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic RBAC buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic RBAC.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<RBAC.Builder>public RBAC.Builder mergeFrom(RBAC other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public RBAC.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<RBAC.Builder>IOExceptionpublic int getActionValue()
The action to take if a policy matches. Every action either allows or denies a request,
and can also carry out action-specific operations.
Actions:
* ALLOW: Allows the request if and only if there is a policy that matches
the request.
* DENY: Allows the request if and only if there are no policies that
match the request.
* LOG: Allows all requests. If at least one policy matches, the dynamic
metadata key `access_log_hint` is set to the value `true` under the shared
key namespace 'envoy.common'. If no policies match, it is set to `false`.
Other actions do not modify this key.
.envoy.config.rbac.v4alpha.RBAC.Action action = 1 [(.validate.rules) = { ... }getActionValue in interface RBACOrBuilderpublic RBAC.Builder setActionValue(int value)
The action to take if a policy matches. Every action either allows or denies a request,
and can also carry out action-specific operations.
Actions:
* ALLOW: Allows the request if and only if there is a policy that matches
the request.
* DENY: Allows the request if and only if there are no policies that
match the request.
* LOG: Allows all requests. If at least one policy matches, the dynamic
metadata key `access_log_hint` is set to the value `true` under the shared
key namespace 'envoy.common'. If no policies match, it is set to `false`.
Other actions do not modify this key.
.envoy.config.rbac.v4alpha.RBAC.Action action = 1 [(.validate.rules) = { ... }public RBAC.Action getAction()
The action to take if a policy matches. Every action either allows or denies a request,
and can also carry out action-specific operations.
Actions:
* ALLOW: Allows the request if and only if there is a policy that matches
the request.
* DENY: Allows the request if and only if there are no policies that
match the request.
* LOG: Allows all requests. If at least one policy matches, the dynamic
metadata key `access_log_hint` is set to the value `true` under the shared
key namespace 'envoy.common'. If no policies match, it is set to `false`.
Other actions do not modify this key.
.envoy.config.rbac.v4alpha.RBAC.Action action = 1 [(.validate.rules) = { ... }getAction in interface RBACOrBuilderpublic RBAC.Builder setAction(RBAC.Action value)
The action to take if a policy matches. Every action either allows or denies a request,
and can also carry out action-specific operations.
Actions:
* ALLOW: Allows the request if and only if there is a policy that matches
the request.
* DENY: Allows the request if and only if there are no policies that
match the request.
* LOG: Allows all requests. If at least one policy matches, the dynamic
metadata key `access_log_hint` is set to the value `true` under the shared
key namespace 'envoy.common'. If no policies match, it is set to `false`.
Other actions do not modify this key.
.envoy.config.rbac.v4alpha.RBAC.Action action = 1 [(.validate.rules) = { ... }public RBAC.Builder clearAction()
The action to take if a policy matches. Every action either allows or denies a request,
and can also carry out action-specific operations.
Actions:
* ALLOW: Allows the request if and only if there is a policy that matches
the request.
* DENY: Allows the request if and only if there are no policies that
match the request.
* LOG: Allows all requests. If at least one policy matches, the dynamic
metadata key `access_log_hint` is set to the value `true` under the shared
key namespace 'envoy.common'. If no policies match, it is set to `false`.
Other actions do not modify this key.
.envoy.config.rbac.v4alpha.RBAC.Action action = 1 [(.validate.rules) = { ... }public int getPoliciesCount()
RBACOrBuilderMaps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;getPoliciesCount in interface RBACOrBuilderpublic boolean containsPolicies(String key)
Maps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;containsPolicies in interface RBACOrBuilder@Deprecated public Map<String,Policy> getPolicies()
getPoliciesMap() instead.getPolicies in interface RBACOrBuilderpublic Map<String,Policy> getPoliciesMap()
Maps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;getPoliciesMap in interface RBACOrBuilderpublic Policy getPoliciesOrDefault(String key, Policy defaultValue)
Maps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;getPoliciesOrDefault in interface RBACOrBuilderpublic Policy getPoliciesOrThrow(String key)
Maps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;getPoliciesOrThrow in interface RBACOrBuilderpublic RBAC.Builder clearPolicies()
public RBAC.Builder removePolicies(String key)
Maps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;@Deprecated public Map<String,Policy> getMutablePolicies()
public RBAC.Builder putPolicies(String key, Policy value)
Maps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;public RBAC.Builder putAllPolicies(Map<String,Policy> values)
Maps from policy name to policy. A match occurs when at least one policy matches the request.
map<string, .envoy.config.rbac.v4alpha.Policy> policies = 2;public final RBAC.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>public final RBAC.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RBAC.Builder>Copyright © 2018–2021 The Envoy Project. All rights reserved.