-
Notifications
You must be signed in to change notification settings - Fork 578
Adds doc for Resource Sharing and Access Control feature #9667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
DarshitChanpura
wants to merge
9
commits into
opensearch-project:main
from
DarshitChanpura:resource-sharing-feature
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ada43e3
Adds doc for Resource Sharing and Access Control feature
DarshitChanpura e850c48
Adds a line for onboarding plugin
DarshitChanpura b736bd5
Add tech writer review.
Naarcha-AWS af0d632
Apply suggestions from code review
Naarcha-AWS 90aaf81
Adds experimental to feature-flag key
DarshitChanpura 430b2be
Merge branch 'main' into resource-sharing-feature
DarshitChanpura c6a1132
Remove developer specific information.
Naarcha-AWS d72a8b3
Apply suggestions from code review
Naarcha-AWS 08e3e27
Remove more developer specific information
Naarcha-AWS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
layout: default | ||
title: Sharing resources between access roles | ||
parent: Access control | ||
nav_order: 130 | ||
--- | ||
|
||
# Sharing resources between access roles | ||
|
||
**Introduced 3.0** | ||
{: .label .label-purple } | ||
|
||
This is an experimental feature and we don't recommend using it in a production environment. For updates on the feature's progress or to provide feedback, join the discussion in the [OpenSearch forum](https://forum.opensearch.org/). | ||
{: .warning} | ||
|
||
The Resource Sharing extension in the OpenSearch Security plugin provides fine-grained, resource-level access management for plugin-declared resources. It builds on top of existing index-level authorization to enable you to: | ||
|
||
- Share and revoke access as a resource owner. | ||
- View and manage all resources as a super-admin. | ||
- Define custom shareable resources through a standardized Service Provider Interface (SPI). | ||
|
||
## Enabling the resource sharing extension | ||
|
||
To enable the resource sharing extension, set up the plugin and permission settings. | ||
|
||
### Plugin settings | ||
|
||
To enable resource sharing, add the following settings to `opensearch.yaml`: | ||
|
||
```yaml | ||
plugins.security.experimental.resource_sharing.enabled: true | ||
plugins.security.system_indices.enabled: true | ||
``` | ||
{% include copy.html %} | ||
|
||
For information about implementing this feature in your plugin, see [Resource access control for plugins](https://github.com/opensearch-project/security/blob/main/RESOURCE_ACCESS_CONTROL_FOR_PLUGINS.md). | ||
{: .tip } | ||
|
||
### Cluster permissions | ||
|
||
The Security plugin must have the following access: | ||
|
||
- Permissions to make share, verify, and list requests. | ||
- Shared access to all cluster components, or be the owner of the cluster. | ||
|
||
To grant the resource sharing extension these permissions, add the following roles to `roles.yaml`. These roles will be assigned to anyone conducting resource sharing: | ||
|
||
```yaml | ||
sample_full_access: | ||
cluster_permissions: | ||
- 'cluster:admin/sample-resource-plugin/*' | ||
|
||
sample_read_access: | ||
cluster_permissions: | ||
- 'cluster:admin/sample-resource-plugin/get' | ||
``` | ||
{% include copy.html %} | ||
|
||
|
||
## Action groups | ||
|
||
Action groups define permission levels for shared resources. As of OpenSearch 3.0, the only supported action group for resource sharing is `default`. To share resources across the action groups, use the `share_with` array in that resource's configuration and add wildcards for each default role: | ||
|
||
```json | ||
{ | ||
"share_with": { | ||
"default": { | ||
"users": ["*"], | ||
"roles": ["*"], | ||
"backend_roles": ["*"] | ||
} | ||
} | ||
} | ||
``` | ||
{% include copy.html %} | ||
|
||
To keep a resource private, keep the `share_with` array empty: | ||
|
||
```json | ||
{ "share_with": {} } | ||
``` | ||
{% include copy.html %} | ||
|
||
## Restrictions | ||
|
||
Before implementing resource sharing and access control, be aware of the following limitations that help maintain security and consistency across the system: | ||
|
||
- Only resource owners or super-admins can share or revoke access. | ||
- Resources must reside in system indexes. | ||
- Disabling system index protection exposes resources to direct index-level access. | ||
|
||
## Best practices | ||
|
||
To ensure secure and efficient implementation of resource sharing and access control, follow these recommended practices: | ||
|
||
- Declare and register extensions correctly. | ||
- Use the SPI client APIs instead of manual index queries. | ||
- Enable only on fresh 3.0.0+ clusters to avoid upgrade issues. | ||
- Grant minimal required permissions when sharing resources. | ||
|
||
These practices help maintain security, improve maintainability, and prevent potential issues during upgrades or system changes. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we mean by "fresh" clusters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature is intended to be enabled only on brand new clusters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In next iteration, we will add a migration path to enable usage on existing clusters.