Add setting to ignore source security roles on CCS requests - #6402
Add setting to ignore source security roles on CCS requests#6402sharathkanaka wants to merge 7 commits into
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 31cd053. ⛔ Hard block: Issues at High severity or above will block this PR from merging.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit 35bbb78)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 35bbb78 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 9ce7e24
Suggestions up to commit 83bbf84
Suggestions up to commit df51453
Suggestions up to commit b37e8b9
Suggestions up to commit bc4732b
|
|
Failing CI checks will be resolved by #6407. There was a breaking change from core that this repo needs to react to. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
4477bd4 to
5c35095
Compare
|
Persistent review updated to latest commit 5c35095 |
5c35095 to
1e309ce
Compare
|
Persistent review updated to latest commit 1e309ce |
Signed-off-by: Sharath Kanaka <sharatcr@amazon.com>
1e309ce to
9aebcac
Compare
|
Persistent review updated to latest commit 9aebcac |
|
Persistent review updated to latest commit 9ab6473 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6402 +/- ##
==========================================
+ Coverage 75.42% 75.45% +0.02%
==========================================
Files 456 457 +1
Lines 30252 30283 +31
Branches 4574 4576 +2
==========================================
+ Hits 22818 22849 +31
+ Misses 5300 5298 -2
- Partials 2134 2136 +2
🚀 New features to boost your workflow:
|
… field, add dedicated test cluster Signed-off-by: Sharath Kanaka <sharatcr@amazon.com>
9ab6473 to
bc4732b
Compare
|
Persistent review updated to latest commit bc4732b |
Signed-off-by: Sharath Kanaka <sharatcr@amazon.com>
|
Persistent review updated to latest commit b37e8b9 |
Signed-off-by: Sharath Kanaka <sharatcr@amazon.com>
|
Persistent review updated to latest commit df51453 |
…calls Signed-off-by: Sharath Kanaka <sharatcr@amazon.com>
|
Persistent review updated to latest commit 83bbf84 |
Signed-off-by: Sharath Kanaka <sharatcr@amazon.com>
|
Persistent review updated to latest commit 9ce7e24 |
|
Persistent review updated to latest commit 35bbb78 |
|
Minor / defense-in-depth (not a blocker): the sanitize happens at receive time on the transient + persistent user, but on a multi-node remote cluster the coordinator's onward fan-out reuses the original The feature's core gate is unaffected — the remote coordinator authorizes with the sanitized user, so access control still works on multi-node clusters. This is purely about the source roles physically still reaching remote data nodes, i.e. the "header identity state" mentioned earlier in the thread that isn't rewritten. Suggestions (optional for this PR, could be a follow-up):
|
DarshitChanpura
left a comment
There was a problem hiding this comment.
Approving as non-blocker can be addressed in a follow-up PR.
|
Darshit, replying to your comment on Coordinator to Data node. That is a good callout. Though no more authorization happens in data node, the user will re-appear with the security roles. |
|
Reason it doesn't sanitize on the intra-cluster hop today: sanitize is gated on HeaderHelper.isRemoteClusterNodeRequest, which only returns true for TRUSTED_CLUSTER_REQUEST. The data-node hop comes in as INTERCLUSTER_REQUEST, so it no-ops and the source securityRoles re-appear. In theory it should sanitize the same way a single node does, but a test proving it strengthens the claim and future-proofs the behavioral change. We also filter out headers not part of the map before serializing and sending across, so to preserve the CCS-origin signal we'd need to pass it in the map. Adding as a suggestion since I'm not completely sure there's no edge case here leading to inconsistent state — fine to address in a follow-up. |
Description
Category: Enhancement
Why these changes are required?
On cross-cluster search (CCS) requests, the remote cluster inherits the source cluster's pre-computed security roles for the user. This prevents the remote cluster from independently controlling what permissions CCS users receive based on its own configuration.
Old behavior: Remote cluster always unions source-propagated
securityRolesinto its own role mapping result for CCS requests. The remote cannot independently control what permissions a CCS user receives.New behavior: A new cluster setting
plugins.security.ccs.ignore_source_security_roles(default: false) allows users to skip source cluster propagated securityRoles on CCS requests. When enabled, the remote cluster evaluates access through its own roles_mapping.yml. This gives the remote cluster independent control over CCS user permissions.Issues Resolved
Resolves #6401
Not a backport. No new permissions introduced.
Testing
ConfigurableRoleMapperTest.CcsSkipSourceSecurityRolesTest: covers flag on/off with and without CCS request contextCcsIgnoreSourceSecurityRolesIntTests: end-to-end CCS with two remote clustersCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Note: Documentation will be added in a follow-up PR to the documentation-website repo once this change is merged.