You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a user associated with a role that used parameter substitution in their DLS creates an alert, the alert queries fail because the parameter substitution does not occur (resulting in an invalid query document). The same query, when executed directly, works as expected.
The difference in behavior for search rest api calls & alerting extraction query calls is due to the additional SecurityRestFilter interceptor workflow.
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: Error while parsing {"terms":{"testfield":[{attr.internal.test}]}}
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2086) ~[guava-32.1.2-jre.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:4012) ~[guava-32.1.2-jre.jar:?]
at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4922) ~[guava-32.1.2-jre.jar:?]
at org.opensearch.security.configuration.DlsQueryParser.containsTermLookupQuery(DlsQueryParser.java:161) ~[opensearch-security-2.11.0.0.jar:2.11.0.0]
at org.opensearch.security.configuration.DlsQueryParser.containsTermLookupQuery(DlsQueryParser.java:143) ~[opensearch-security-2.11.0.0.jar:2.11.0.0]
at org.opensearch.security.configuration.DlsFlsValveImpl.invoke(DlsFlsValveImpl.java:166) ~[opensearch-security-2.11.0.0.jar:2.11.0.0]
at org.opensearch.security.filter.SecurityFilter.apply0(SecurityFilter.java:390) [opensearch-security-2.11.0.0.jar:2.11.0.0]
at org.opensearch.security.filter.SecurityFilter.apply(SecurityFilter.java:165) [opensearch-security-2.11.0.0.jar:2.11.0.0]
at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.action.support.TransportAction.execute(TransportAction.java:188) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.action.support.TransportAction.execute(TransportAction.java:107) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.client.node.NodeClient.executeLocally(NodeClient.java:110) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.rest.action.RestCancellableNodeClient.doExecute(RestCancellableNodeClient.java:106) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.client.support.AbstractClient.execute(AbstractClient.java:476) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.rest.action.search.RestSearchAction.lambda$prepareRequest$2(RestSearchAction.java:135) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:128) [opensearch-2.11.0.jar:2.11.0]
at org.opensearch.security.filter.SecurityRestFilter.lambda$wrap$0(SecurityRestFilter.java:141) [opensearch-security-2.11.0.0.jar:2.11.0.0]
Create a user with the appropriate attribute defined
Insert a document that the user should be able to see
Query for that document. It should be visible.
Create an alert query that should return the same document. The alert query should error and show that the query was malformed where the parameter substitution should have occurred.
Expected behavior
Users that have roles with parameter substitution in their DLS should be able to create and use the alerting feature.
Plugins
Unknown. Standard AWS Open Search deployment
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
OS: [e.g. iOS] Windows
Version [e.g. 22] Identified in ES 7.10, but it is also an issue in latest OpenSearch available through AWS Open Search managed service.
Additional context
We created a support ticket in our AWS account for this issue, and were directed to open the issue here. More details can be provided if needed.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a user associated with a role that used parameter substitution in their DLS creates an alert, the alert queries fail because the parameter substitution does not occur (resulting in an invalid query document). The same query, when executed directly, works as expected.
The difference in behavior for search rest api calls & alerting extraction query calls is due to the additional SecurityRestFilter interceptor workflow.
this makes a call to following method internally.
[+] https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java#L1025
which replaces attributes with actual values.
This call need to be included in the alerting workflow as well to fix this issue.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Users that have roles with parameter substitution in their DLS should be able to create and use the alerting feature.
Plugins
Unknown. Standard AWS Open Search deployment
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
We created a support ticket in our AWS account for this issue, and were directed to open the issue here. More details can be provided if needed.
The text was updated successfully, but these errors were encountered: