Role restriction
The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Stack
Generally available
Role restriction can be used to specify conditions under which a role should be effective. When conditions are not met, the role will be disabled, which will result in access being denied. Not specifying restriction means the role is not restricted and thus always effective. This is the default behavior.
Currently, the role restriction is only supported for API keys, with limitation that the API key can only have a single role descriptor.
Workflows allow to restrict the role to be effective exclusively when calling certain REST APIs. Calling a REST API that is not allowed by a workflow, will result in the role being disabled. The below section lists workflows that you can restrict the role to:
search_application_query- This workflow restricts the role to the Search Application Search API only.
Workflow names are case-sensitive.
The following example creates an API key with a restriction to the search_application_query workflow, which allows to call only Search Application Search API:
POST /_security/api_key{ "name": "my-restricted-api-key", "role_descriptors": { "my-restricted-role-descriptor": { "indices": [ { "names": ["my-search-app"], "privileges": ["read"] } ], "restriction": { "workflows": ["search_application_query"] } } } }