Module org.elasticsearch.xcore
Class IndexPrivilege
java.lang.Object
org.elasticsearch.xpack.core.security.authz.privilege.Privilege
org.elasticsearch.xpack.core.security.authz.privilege.IndexPrivilege
The name of an index related action always being with `indices:` followed by a sequence of slash-separated terms
that generally describes the hierarchy (from broader to more specific) of the action. For example, the
first level comprises `admin`, `monitor`, `data` which generally categorize an action into either an admin
related function, or a monitoring related function or a user-data related function. Subsequent levels further
narrow down the category until the meaning is specific enough.
Note that these terms are meant to categorize what the action does, *not* how it should be invoked. This means
whether an action is accessible via REST API should not contribute to its naming.
Also note that the `internal:transport/proxy/` prefix is automatically added and stripped for actions that go
through a CCR/CCS proxy. No action should be explicitly named like that.
Each named privilege is associated with an
IndexComponentSelector it grants access to.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilegestatic final IndexPrivilege -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<String> findPrivilegesThatGrant(String action) Returns the names of privileges that grant the specified action.static Collection<String> findPrivilegesThatGrant(String action, Predicate<IndexPrivilege> preCondition) static IndexPrivilegeReturns aIndexPrivilegethat corresponds to the given raw action pattern or privilege name.static IndexPrivilegegetNamedOrNull(String name) names()static Set<IndexPrivilege> resolveBySelectorAccess(Set<String> names) Returns a setIndexPrivilegethat captures the access granted by the privileges and actions specified in the input name set.Methods inherited from class org.elasticsearch.xpack.core.security.authz.privilege.Privilege
equals, getAutomaton, hashCode, name, predicate, sortByAccessLevel, toString
-
Field Details
-
NONE
-
ALL
-
READ
-
READ_CROSS_CLUSTER
-
CREATE
-
INDEX
-
DELETE
-
WRITE
-
CREATE_DOC
-
MONITOR
-
MANAGE
-
DELETE_INDEX
-
CREATE_INDEX
-
VIEW_METADATA
-
MANAGE_FOLLOW_INDEX
-
MANAGE_LEADER_INDEX
-
MANAGE_ILM
-
MANAGE_DATA_STREAM_LIFECYCLE
-
MAINTENANCE
-
AUTO_CONFIGURE
-
CROSS_CLUSTER_REPLICATION
-
CROSS_CLUSTER_REPLICATION_INTERNAL
-
READ_FAILURE_STORE
-
MANAGE_FAILURE_STORE
-
ACTION_MATCHER
-
CREATE_INDEX_MATCHER
-
-
Method Details
-
get
Returns aIndexPrivilegethat corresponds to the given raw action pattern or privilege name. -
resolveBySelectorAccess
Returns a setIndexPrivilegethat captures the access granted by the privileges and actions specified in the input name set. This method returns a set of index privileges, instead of a single index privilege to capture that different index privileges grant access to differentIndexComponentSelectors. Most privileges grant access to the (implicit)IndexComponentSelector.DATAselector. TheREAD_FAILURE_STOREgrants access toIndexComponentSelector.FAILURES. The implementation for authorization for access by selector requires that index privileges are (generally) not combined across selector boundaries since their underlying automata would be combined, granting more access than is valid. This method conceptually splits the input names into ones that correspond to different selector access, and return an index privilege for each partition. For instance, `resolveBySelectorAccess(Set.of("view_index_metadata", "write", "read_failure_store"))` will return two index privileges one covering `view_index_metadata` and `write` for aIndexComponentSelectorPredicate.DATA, the other covering `read_failure_store` for aIndexComponentSelectorPredicate.FAILURESselector. A notable exception is theALLprivilege. If this privilege is included in the input name set, this method returns a single index privilege that grants access to all selectors. All raw actions are treated as granting access to theIndexComponentSelector.DATAselector. -
getNamedOrNull
-
names
-
findPrivilegesThatGrant
Returns the names of privileges that grant the specified action.- Returns:
- A collection of names, ordered (to the extent possible) from least privileged (e.g.
CREATE_DOC) to most privileged (e.g.ALL) - See Also:
-
findPrivilegesThatGrant
public static Collection<String> findPrivilegesThatGrant(String action, Predicate<IndexPrivilege> preCondition) -
getSelectorPredicate
-