Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
03ce955
Adds resource access evaluator
DarshitChanpura Jun 12, 2025
3f5516d
Updates sample plugin requests to be doc-requests
DarshitChanpura Jun 12, 2025
290a9cb
Fixes create request flow
DarshitChanpura Jun 12, 2025
4dc5812
Adds a ResourceAccessEvaluator to perform authorization on direct res…
DarshitChanpura Jun 17, 2025
ebf1662
Updates SPI classes to accomodate standalone resource authz
DarshitChanpura Jun 17, 2025
f84f5e0
Updates sample plugin with this new standalone resource-authorization…
DarshitChanpura Jun 17, 2025
9cbbf1c
Updates sample plugin integ tests to test the new feature
DarshitChanpura Jun 17, 2025
8a2dd50
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 17, 2025
70dffe5
Adds changelog entry
DarshitChanpura Jun 18, 2025
a149215
Updates sample plugin README
DarshitChanpura Jun 18, 2025
4b9bc5e
Removes calls to verifyAccess in sample plugin
DarshitChanpura Jun 18, 2025
a3f0981
Updates sp integ tests
DarshitChanpura Jun 18, 2025
f76403f
Adds debug log statements to the evaluator
DarshitChanpura Jun 18, 2025
6819b30
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 18, 2025
f636120
Reorganizes logic
DarshitChanpura Jun 18, 2025
71fd8ff
Adds license header
DarshitChanpura Jun 18, 2025
ccf57b9
Fixes evaluator ordering
DarshitChanpura Jun 18, 2025
09ca207
Removes verifyAccess method from SPI
DarshitChanpura Jun 19, 2025
1c2edf6
Refactors tests to add a separate package to test various feature dis…
DarshitChanpura Jun 20, 2025
34212da
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 20, 2025
fed950c
Refactors tests and add feature enabled scenario
DarshitChanpura Jun 20, 2025
a8c0b87
Renames test files
DarshitChanpura Jun 20, 2025
a73eca6
Adds tests for multiple access levels
DarshitChanpura Jun 21, 2025
c0bda2d
Adds await after creating resource
DarshitChanpura Jun 21, 2025
55fbca0
Adds unit test for ResourceAccessEvaluator
DarshitChanpura Jun 21, 2025
ac1932e
Adds remaining awaits
DarshitChanpura Jun 21, 2025
b758d3b
Attempt to make tests stable for CI runnners
DarshitChanpura Jun 23, 2025
50e0f3d
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 23, 2025
2b06c9d
Merge branch 'main' into standalone-resource-authz
DarshitChanpura Jun 23, 2025
e40620e
Updates test user variable names
DarshitChanpura Jun 23, 2025
10e7f90
Adds doc for ResourceAccessEvaluator and a feature flag control
DarshitChanpura Jun 23, 2025
626391c
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 23, 2025
53fcccb
Fixes comments and other small items
DarshitChanpura Jun 23, 2025
faa0a68
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 24, 2025
2ea3fa1
Updates changelog
DarshitChanpura Jun 24, 2025
6e60897
Fix grammar in changelog
DarshitChanpura Jun 24, 2025
dbc2711
Fix await logic in test-helper
DarshitChanpura Jun 24, 2025
548a358
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 24, 2025
c82f8d3
Onboard sample plugin test to java 24 for linux runs
DarshitChanpura Jun 24, 2025
8f31a66
Strengthens tests
DarshitChanpura Jun 24, 2025
0834c25
Fixes update action for sample plugin
DarshitChanpura Jun 24, 2025
a6479dc
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 26, 2025
1a35679
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 30, 2025
46a531c
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jun 30, 2025
2d064d2
Fixes grammar in CHangelog
DarshitChanpura Jun 30, 2025
44a07a9
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 3, 2025
875e824
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 7, 2025
68c0d94
Makes test more robust
DarshitChanpura Jul 7, 2025
49cd0c4
Fixes changelog
DarshitChanpura Jul 7, 2025
640d1ef
Adds test for publicly shared document and explicit wait for get-all …
DarshitChanpura Jul 8, 2025
937813f
Corrects publicly shared doc eval logic
DarshitChanpura Jul 8, 2025
abacad2
Fixes unit tests
DarshitChanpura Jul 8, 2025
98eef3a
Remove timeout
DarshitChanpura Jul 8, 2025
a3a4e88
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 14, 2025
9871f17
set max parallel forks to 1 for sample plugin tests
DarshitChanpura Jul 14, 2025
319afac
remove parallel fork limit and rename sub tests
DarshitChanpura Jul 14, 2025
09189c5
Refactors tests to remove flakyness
DarshitChanpura Jul 15, 2025
b757b56
attempt at multi-node test
DarshitChanpura Jul 18, 2025
ee226b2
Fixes static instances
DarshitChanpura Jul 22, 2025
be6042e
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 22, 2025
fb7f277
Fixes unit tests
DarshitChanpura Jul 22, 2025
79e706f
Makes resource evaluation async
DarshitChanpura Jul 23, 2025
b49748e
Fixes checkstyle violation and return correct presponse variable in s…
DarshitChanpura Jul 23, 2025
7d9f8bc
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 24, 2025
9876fde
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 25, 2025
6670f51
Adds test for authz dry-run on resource access and explicitly restore…
DarshitChanpura Jul 25, 2025
f7ddaac
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 25, 2025
c672683
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 29, 2025
d87a7e8
Cleans resource evaluator code in Security Filter
DarshitChanpura Jul 29, 2025
17fa8e9
Reintroduces verifyAccess client method as it is needed by ML plugin
DarshitChanpura Jul 30, 2025
d738b3c
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Jul 30, 2025
f480b2d
Fixed failing dry run sample plugin tests
DarshitChanpura Jul 30, 2025
978d7b2
Refactors verifyAccess to accept action to be checked against and als…
DarshitChanpura Jul 30, 2025
ee54c97
Updates SPI documentation and refactors feature config constant
DarshitChanpura Jul 30, 2025
cc2fbce
Updates sample plugin to not use feature flag and instead rely on res…
DarshitChanpura Jul 30, 2025
bc312cc
Fixes checkstyle errors
DarshitChanpura Jul 30, 2025
90adaef
Removes todos, cleans up failure message and lingering semi-colon
DarshitChanpura Jul 31, 2025
46e9e2b
Optimizes to only send auth subject header over the wire if different…
DarshitChanpura Aug 1, 2025
b9a50f3
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Aug 1, 2025
d7ba4b0
Merge remote-tracking branch 'upstream/main' into standalone-resource…
DarshitChanpura Aug 1, 2025
f294e1f
Add rest matcher for 501 status and add comment about early return in…
DarshitChanpura Aug 1, 2025
00dd8b4
Refactor so userheader is parsed only once
DarshitChanpura Aug 4, 2025
fc13249
Merge branch 'main' into standalone-resource-authz
DarshitChanpura Aug 4, 2025
674df84
Fix spotless
DarshitChanpura Aug 4, 2025
98ea11f
Adds comment about making resource sharing extensions injectable
DarshitChanpura Aug 4, 2025
5d41f95
Only deserialize user object once
DarshitChanpura Aug 4, 2025
619a778
Fix spotless
DarshitChanpura Aug 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [ 21 ]
platform: [ ubuntu-latest ]
runs-on: ubuntu-latest
jdk: [21,24]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

* 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))
* 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))
* [Resource Sharing] Adds a Resource Access Evaluator for standalone Resource access authorization ([#5408](https://github.com/opensearch-project/security/pull/5408))
* Replaced the standard distribution of BouncyCastle with BC-FIPS ([#5439](https://github.com/opensearch-project/security/pull/5439))
* Introduced setting `plugins.security.privileges_evaluation.precomputed_privileges.enabled` ([#5465](https://github.com/opensearch-project/security/pull/5465))
* Optimized wildcard matching runtime performance ([#5470](https://github.com/opensearch-project/security/pull/5470))
Expand All @@ -36,12 +37,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Refactoring

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

### Maintenance

- 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))
- 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))
- 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))
Expand Down
25 changes: 17 additions & 8 deletions sample-resource-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ plugins.security.system_indices.enabled: true

4. **Interaction Rules**
- If a **user is not the resource owner**, they must:
- Be assigned **a role with `sample_read_access`** permissions.
- **Have the resource shared with them** via the resource-sharing API.
- **Have the resource shared with them** via the resource-sharing API with appropriate action group.
- A user **without** the necessary `sample-resource-plugin` cluster permissions:
- **Cannot access the resource**, even if it is shared with them.
- A user **with `sample-resource-plugin` permissions** but **without a shared resource**:
- **Cannot access the resource**, since resource-level access control applies.
- A user **with full-access to the resource** will be able to **update and delete that resource**.
- Owners and super-admin get full-access by default.


## API Endpoints
Expand Down Expand Up @@ -140,20 +141,22 @@ The plugin exposes the following six API endpoints:

### 5. Share Resource
- **Endpoint:** `POST /_plugins/sample_resource_sharing/share/{resource_id}`
- **Description:** Shares a resource with the intended entities. At present, only admin and resource owners can share the resource.
- **Description:** Shares a resource with the intended entities.
- **Request Body:**
```json
{
"share_with": {
"users": [ "sample_user" ]
"read_only": {
"users": [ "sample_user" ]
}
}
}
```
- **Response:**
```json
{
"share_with": {
"default": {
"read_only": {
"users": [ "sample_user" ]
}
}
Expand All @@ -162,19 +165,25 @@ The plugin exposes the following six API endpoints:

### 6. Revoke Resource Access
- **Endpoint:** `POST /_plugins/sample_resource_sharing/revoke/{resource_id}`
- **Description:** Shares a resource with the intended entities. At present, only admin and resource owners can share the resource.
- **Description:** Shares a resource with the intended entities.
- **Request Body:**
```json
{
"entities_to_revoke": {
"users": [ "sample_user" ]
"read_only": {
"users": [ "sample_user" ]
}
}
}
```
- **Response:**
```json
{
"share_with" : { }
"share_with" : {
"read_only": {
"users" : [ ]
}
}
}
```

Expand Down
2 changes: 2 additions & 0 deletions sample-resource-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ dependencies {
implementation "org.opensearch.client:opensearch-rest-client:${opensearch_version}"
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"

integrationTestImplementation 'org.ldaptive:ldaptive:1.2.3' // for running multinode tests

// Integration test dependencies
integrationTestImplementation rootProject.sourceSets.integrationTest.output
integrationTestImplementation rootProject.sourceSets.main.output
Expand Down

This file was deleted.

Loading
Loading