-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Monitors notifications channel not working With RBAC setting #698
Comments
@techrna, I have a few questions.
|
Thank you!!. Bellow are the details requested.And please let me know if anything else required. Get user api response
Role api response
Cluster Settings.
notification.yml file setting (Hope we have added the settings in right file(path: /etc/opensearch/opensearch-notifications/notifications.yml))
|
@techrna, can you run the following: Additionally, can you do the [getRoleMapping](GET .opendistro-alerting-config/_doc/c3CwFYQBxyWm8H1EhccS) API for the role, One last question, if you create the monitor with that notification channel associated to the trigger, does the monitor correctly send out notifications when alerts are generated? |
Monitor id : HbWuYYUBb9hzdJ2RpaJ5 GET .opendistro-alerting-config/_doc/HbWuYYUBb9hzdJ2RpaJ5
Monitor Json GET _plugins/_alerting/monitors/HbWuYYUBb9hzdJ2RpaJ5
@lezzago i have added rbac_role while creating but its not reflecting in it. User and roles mapping GET _plugins/_security/api/rolesmapping/dgvzdf8zx2toawthltg
GET _plugins/_security/api/internalusers/[email protected]
|
@techrna, sorry, I forgot to share the correct method to query Also the reason you do not see the rbac roles associated to the monitor is prevent leaking security credential information. If you run the command above, you should get user information tied to the monitor and that will include the rbac_roles. So when you get that, feel free to also obfuscate any important security credentials. Also can you share the output of |
@lezzago [email protected] its new user created with same settings
GET _plugins/_security/api/internalusers/[email protected]
curl -k --cert ./kirk.pem --key ./kirk-key.pem -XGET 'https://localhost:9200/.opendistro-alerting-config/_doc/HbWuYYUBb9hzdJ2RpaJ5
|
Can you send the test message as the |
Are we able to solve this issue as I am also facing the same problem, and this seems a big blocker in my project delivery as if I am disabling the configuration of filtering_by_backend_role its working but than my all tenants was able to see each other's data like their own created monitors and if I am enabling, I am not able to trigger any notification Please help |
Looks like there is an issue in passing in the backend roles to the notification plugin when sending the notification.
This will only disable RBAC for notification and still allow you to have it enabled on Alerting resources. |
Thanks, @lezzago Yes, I was able to send the notification by using the cluster setting as mentioned by you, but this change introduced a big security flaw for me as my product tenants segregated based on their roles was able to see everybody else notification channels I am able to fix the same by changing the code inside notification-plugin repo, Please do update here once you fix the issue and give the release with that fix |
Closing this issue as the PR has been merged and will be part of the 2.7 release |
Bug
While Creating Monitors in that Triggers actions notification channel is not working. I have created the notification channel as custom webhook. When we hit send test message over there it works .But when do send test message while adding monitor it fails .
How can one reproduce the bug?
Steps to reproduce the behavior:
PUT _cluster/settings
{
"transient": {
"plugins.alerting.filter_by_backend_roles": "true"
}
}
Error screenshots and logs are attach below please check.
Problem is it fails to read the backend roles for the user.when filter_by_backend_roles is enabled
host/environment
screenshots?
OpenSearch logs
[2022-12-09T18:59:50,893][INFO ][o.o.n.i.ConfigIndexingActions] [test2-server] notifications:NotificationConfig-get org.opensearch.commons.notifications.action.GetNotificationConfigRequest@43c2eec6
[2022-12-09T18:59:50,893][WARN ][o.o.n.a.PluginBaseAction ] [test2-server] notifications:OpenSearchStatusException:
org.opensearch.OpenSearchStatusException: User doesn't have backend roles configured. Contact administrator.
at org.opensearch.notifications.security.UserAccessManager.validateUser(UserAccessManager.kt:24) ~[opensearch-notifications-2.3.0.0.jar:2.3.0.0]
at org.opensearch.notifications.index.ConfigIndexingActions.get(ConfigIndexingActions.kt:251) ~[opensearch-notifications-2.3.0.0.jar:2.3.0.0]
at org.opensearch.notifications.action.GetNotificationConfigAction.executeRequest(GetNotificationConfigAction.kt:60) ~[opensearch-notifications-2.3.0.0.jar:2.3.0.0]
at org.opensearch.notifications.action.GetNotificationConfigAction.executeRequest(GetNotificationConfigAction.kt:26) ~[opensearch-notifications-2.3.0.0.jar:2.3.0.0]
at org.opensearch.notifications.action.PluginBaseAction$doExecute$1.invokeSuspend(PluginBaseAction.kt:63) [opensearch-notifications-2.3.0.0.jar:2.3.0.0]
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) [kotlinx-coroutines-core-jvm-1.4.3.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) [kotlinx-coroutines-core-jvm-1.4.3.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) [kotlinx-coroutines-core-jvm-1.4.3.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) [kotlinx-coroutines-core-jvm-1.4.3.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) [kotlinx-coroutines-core-jvm-1.4.3.jar:?]
[2022-12-09T18:59:50,894][INFO ][o.o.a.m.MonitorRunResult ] [test2-server] Internal error: Unable to find a Notification Channel or Destination config with id [nsgT94QBikbo0yuk80z2]. See the opensearch.log for details
java.lang.IllegalStateException: Unable to find a Notification Channel or Destination config with id [nsgT94QBikbo0yuk80z2]
at org.opensearch.alerting.MonitorRunner.getConfigAndSendNotification(MonitorRunner.kt:93) ~[opensearch-alerting-2.3.0.0.jar:2.3.0.0]
at org.opensearch.alerting.MonitorRunner$getConfigAndSendNotification$1.invokeSuspend(MonitorRunner.kt) ~[opensearch-alerting-2.3.0.0.jar:2.3.0.0]
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233) [kotlinx-coroutines-core-1.1.1.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) [kotlinx-coroutines-core-1.1.1.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) [kotlinx-coroutines-core-1.1.1.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742) [kotlinx-coroutines-core-1.1.1.jar:?]
The text was updated successfully, but these errors were encountered: