Repository navigation
Add indices:admin/mappings/get to ml_full_access role for Agentic Search - #6076
owaiskazi19 wants to merge 4 commits into
Conversation
|
TY @owaiskazi19 . The changes LGTM but the build on main is broken atm due to Jackson 3.x upgrade in core. I will have a PR raised mometarily for that. |
|
@owaiskazi19 it may be good to take this opportunity to extract the ml roles from this repo and provide them as classpath resources from within the ml repo instead. See #6038 |
| - index_patterns: | ||
| - '*' | ||
| allowed_actions: | ||
| - 'indices:admin/mappings/get' |
There was a problem hiding this comment.
we also need indices:data/read/search* because agentic search also samples documents from the index, should we add that too?
There was a problem hiding this comment.
Good call. QPT's async chain has two steps: (1) getMappings for index structure, and (2) a search to sample a document. indices:data/read/search* would be needed for it
Signed-off-by: Owais Kazi <[email protected]>
Signed-off-by: Owais Kazi <[email protected]>
QueryPlanningTool samples documents from the target index using a matchAllQuery search. This requires indices:data/read/search* permission which is consistent with other full_access roles (anomaly_full_access, ppl_full_access, asynchronous_search_full_access, forecast_full_access). Signed-off-by: Owais Kazi <[email protected]>
4eae239 to
75b48d7
Compare
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 4f980b7. ⛔ 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 🔍Here are some key observations to aid the review process:
|
|
@owaiskazi19 Is this PR ready for review? If not, this will be marked as stale and closed during next cleanup. |
Description
Adds
indices:admin/mappings/getto theml_full_accessrole to support Agentic Search (QueryPlanningTool). QPT needs to retrieve index mappings to generate accurate OpenSearch DSL queries from natural language input.Dependency
This PR depends on opensearch-project/ml-commons#4785, which changes
QueryPlanningToolto useGetMappingsRequestinstead ofGetIndexRequest. Without that ml-commons change, QPT would require the broaderindices:admin/getpermission. With it, onlyindices:admin/mappings/getis needed.Security implications
This permission does not expose system index mappings. System indices are protected by multiple layers:
plugins.security.system_indices.permissions.enabledistrue(default), accessing system indices requires thesystem:admin/system_indexpermission, whichml_full_accessdoes not have..opendistro_securityindex has additional hardcoded protection that filters it from wildcard requests whenplugins.security.filter_securityindex_from_all_requestsis enabled.getMappingswith a specific user-provided index name, not*.This is a read-only metadata permission — it only exposes field names and types, not document data.
Consistent with existing roles —
indices:admin/mappings/getis already used byknn_full_access,query_assistant_access, andreports_read_accesswith the sameindex_patterns: ['*']scope.Related Issue
opensearch-project/ml-commons#4775
Check List
--signoff