Skip to content

Commit 11c71e7

Browse files
[Resource Sharing] Adds a Resource Access Evaluator for standalone Resource access authorization (#5408)
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
1 parent 1c2792a commit 11c71e7

File tree

71 files changed

+3992
-2361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3992
-2361
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ jobs:
297297
strategy:
298298
fail-fast: false
299299
matrix:
300-
jdk: [ 21 ]
301-
platform: [ ubuntu-latest ]
302-
runs-on: ubuntu-latest
300+
jdk: [21,24]
301+
platform: [ubuntu-latest]
302+
runs-on: ${{ matrix.platform }}
303303
container:
304304
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
305305
# this image tag is subject to change as more dependencies and updates will arrive over time

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1818

1919
* Create a mechanism for plugins to explicitly declare actions they need to perform with their assigned PluginSubject ([#5341](https://github.com/opensearch-project/security/pull/5341))
2020
* Moves OpenSAML jars to a Shadow Jar configuration to facilitate its use in FIPS enabled environments ([#5400](https://github.com/opensearch-project/security/pull/5404))
21+
* [Resource Sharing] Adds a Resource Access Evaluator for standalone Resource access authorization ([#5408](https://github.com/opensearch-project/security/pull/5408))
2122
* Replaced the standard distribution of BouncyCastle with BC-FIPS ([#5439](https://github.com/opensearch-project/security/pull/5439))
2223
* Introduced setting `plugins.security.privileges_evaluation.precomputed_privileges.enabled` ([#5465](https://github.com/opensearch-project/security/pull/5465))
2324
* Optimized wildcard matching runtime performance ([#5470](https://github.com/opensearch-project/security/pull/5470))
@@ -36,12 +37,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3637

3738
### Refactoring
3839

39-
* Refactor JWT Vender to take a claims builder and rename oboEnabled to enabled ([#5436](https://github.com/opensearch-project/security/pull/5436))
40+
* Refactor JWT Vendor to take a claims builder and rename oboEnabled to be enabled ([#5436](https://github.com/opensearch-project/security/pull/5436))
4041
* Remove ASN1 reflection methods ([#5454](https://github.com/opensearch-project/security/pull/5454))
4142
* Remove provider reflection code ([#5457](https://github.com/opensearch-project/security/pull/5457))
4243
* Add tenancy access info to serialized user in threadcontext ([#5519](https://github.com/opensearch-project/security/pull/5519))
4344

4445
### Maintenance
46+
4547
- Bump `org.eclipse.platform:org.eclipse.core.runtime` from 3.33.0 to 3.33.100 ([#5400](https://github.com/opensearch-project/security/pull/5400))
4648
- Bump `org.eclipse.platform:org.eclipse.equinox.common` from 3.20.0 to 3.20.100 ([#5402](https://github.com/opensearch-project/security/pull/5402))
4749
- Bump `spring_version` from 6.2.7 to 6.2.9 ([#5403](https://github.com/opensearch-project/security/pull/5403), [#5493](https://github.com/opensearch-project/security/pull/5493))

sample-resource-plugin/README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ plugins.security.system_indices.enabled: true
5858
5959
4. **Interaction Rules**
6060
- If a **user is not the resource owner**, they must:
61-
- Be assigned **a role with `sample_read_access`** permissions.
62-
- **Have the resource shared with them** via the resource-sharing API.
61+
- **Have the resource shared with them** via the resource-sharing API with appropriate action group.
6362
- A user **without** the necessary `sample-resource-plugin` cluster permissions:
6463
- **Cannot access the resource**, even if it is shared with them.
6564
- A user **with `sample-resource-plugin` permissions** but **without a shared resource**:
6665
- **Cannot access the resource**, since resource-level access control applies.
66+
- A user **with full-access to the resource** will be able to **update and delete that resource**.
67+
- Owners and super-admin get full-access by default.
6768

6869

6970
## API Endpoints
@@ -140,20 +141,22 @@ The plugin exposes the following six API endpoints:
140141

141142
### 5. Share Resource
142143
- **Endpoint:** `POST /_plugins/sample_resource_sharing/share/{resource_id}`
143-
- **Description:** Shares a resource with the intended entities. At present, only admin and resource owners can share the resource.
144+
- **Description:** Shares a resource with the intended entities.
144145
- **Request Body:**
145146
```json
146147
{
147148
"share_with": {
148-
"users": [ "sample_user" ]
149+
"read_only": {
150+
"users": [ "sample_user" ]
151+
}
149152
}
150153
}
151154
```
152155
- **Response:**
153156
```json
154157
{
155158
"share_with": {
156-
"default": {
159+
"read_only": {
157160
"users": [ "sample_user" ]
158161
}
159162
}
@@ -162,19 +165,25 @@ The plugin exposes the following six API endpoints:
162165

163166
### 6. Revoke Resource Access
164167
- **Endpoint:** `POST /_plugins/sample_resource_sharing/revoke/{resource_id}`
165-
- **Description:** Shares a resource with the intended entities. At present, only admin and resource owners can share the resource.
168+
- **Description:** Shares a resource with the intended entities.
166169
- **Request Body:**
167170
```json
168171
{
169172
"entities_to_revoke": {
170-
"users": [ "sample_user" ]
173+
"read_only": {
174+
"users": [ "sample_user" ]
175+
}
171176
}
172177
}
173178
```
174179
- **Response:**
175180
```json
176181
{
177-
"share_with" : { }
182+
"share_with" : {
183+
"read_only": {
184+
"users" : [ ]
185+
}
186+
}
178187
}
179188
```
180189

sample-resource-plugin/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ dependencies {
7474
implementation "org.opensearch.client:opensearch-rest-client:${opensearch_version}"
7575
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
7676

77+
integrationTestImplementation 'org.ldaptive:ldaptive:1.2.3' // for running multinode tests
78+
7779
// Integration test dependencies
7880
integrationTestImplementation rootProject.sourceSets.integrationTest.output
7981
integrationTestImplementation rootProject.sourceSets.main.output

sample-resource-plugin/src/integrationTest/java/org/opensearch/sample/SampleResourcePluginFeatureDisabledTests.java

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)