kibana/dev_docs/key_concepts
Elena Shostak 52dd7e17c4
[Authz] Operator privileges (#196583)
## Summary

This PR adds support for explicit indication whether endpoint is
restricted to operator only users.

### Context
1. If user has [all operator
privileges](https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/operator/DefaultOperatorOnlyRegistry.java#L35-#L53)
granted, but is not listed as operator in `operator_users.yml`, ES would
throw an unauthorized error.
2. If user is listed as operator in `operator_users.yml`, but doesn't
have necessary privileges granted, ES would throw an unauthorized error.
3. It’s not possible to determine if a user is operator via any ES API,
i.e. `_has_privileges`.
4. If operator privileges are disabled we skip the the check for it,
that's why we require to explicitly specify additional privileges to
ensure that the route is protected even when operator privileges are
disabled.

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

__Relates: https://github.com/elastic/kibana/issues/196271__

### How to test

1. Add your user to the operators list
1bd8144924/packages/kbn-es/src/serverless_resources/operator_users.yml (L4)
or use existing user from the list to log in.
2. Run ES and Kibana serverless
3. Change any endpoint or create a new one with the following security
config
```
      security: {
        authz: {
          requiredPrivileges: [ReservedPrivilegesSet.operator],
        },
      },
```
4. Check with enabled and disabled operator privileges (set
`xpack.security.operator_privileges.enabled`)

## Release Note
Added support for explicit indication whether endpoint is restricted to
operator only users at the route definition level.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-12 23:55:04 +01:00
..
performance [docs] Plugin optimization, case studies (#192285) 2024-09-10 14:28:18 -04:00
anatomy_of_a_plugin.mdx async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
api_authorization.mdx [Authz] Operator privileges (#196583) 2024-12-12 23:55:04 +01:00
audit_logging.mdx [api-docs] follow the correct schema for frontmatter (#138348) 2022-08-10 17:17:50 -05:00
building_blocks.mdx Rename all vis-editors and datavis to visualizations (#144589) 2022-11-05 19:16:20 -04:00
data_views.mdx [api-docs] follow the correct schema for frontmatter (#138348) 2022-08-10 17:17:50 -05:00
embeddables.mdx embeddable overview guiding principles and best practices (#183099) 2024-05-14 12:03:45 -06:00
encrypted_saved_objects.mdx Implements 'Key concepts' developer documentation for Encrypted Saved Objects (#184334) 2024-06-07 14:34:58 +02:00
feature_privileges.mdx [Docs] Update feature privilege docs to reflect new route authorization (#201017) 2024-11-20 14:52:58 -06:00
kibana_platform_plugin_intro.mdx [api-docs] follow the correct schema for frontmatter (#138348) 2022-08-10 17:17:50 -05:00
kibana_system_user.mdx [Docs] Security Route Configuration (#193994) 2024-10-22 06:30:53 -05:00
navigation.mdx Removes duplicated RedirectAppLinks component (#170304) 2023-11-13 10:17:13 +01:00
persistable_state.mdx [api-docs] follow the correct schema for frontmatter (#138348) 2022-08-10 17:17:50 -05:00
saved_objects.mdx Updates internal dev docs for Saved Objects (#178058) 2024-03-07 08:16:28 -07:00