Skip to content
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

[8.15] [ResponseOps][Alerting] Register anomaly detection and custom threshold rule types under stack alerts feature privilege (#194615) #195173

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Oct 6, 2024

Backport

This will backport the following commits from main to 8.15:

Questions ?

Please refer to the Backport tool documentation

\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Christos Nasikas "}},{"branch":"8.15","label":"v8.15.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->

…ld rule types under stack alerts feature privilege (elastic#194615)

## Summary

In the ES query, anomaly detection, and custom threshold rule types
users can use the "Role visibility" dropdown to select where the rules
should be accessible. The "Role visibility" dropdown sets the `consumer`
which is paramount for alerting RBAC. For the anomaly detection and
custom threshold rule types if the `consumer` is set to `stackAlerts`
then the rules will not be accessible from any rule page even if the
user has access to the "Stack alerts" feature privilege. This PR fixes
this bug.

Fixes elastic#193549
Fixes elastic#191075
Fixes elastic#184422
Fixes elastic#179082

## Testing

1. Create an anomaly detection and custom threshold rule and set the
"Role visibility" to "Stack alerts".
2. Create a user with access only to "Stack alerts".
3. Login with the user created in Step 2.
4. Verify that you can see the rules from the stack management page.
5. Verify that you can see the alerts generated from the rules.
6. Create a user with roles `kibana_admin` and verify the same.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release notes

Fix bug where rule types with "Stack alerts" role visibility are not
being shown in the stack management page

(cherry picked from commit 8d83a07)

# Conflicts:
#	x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/find.ts
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cnasikas cnasikas merged commit 6b6babb into elastic:8.15 Oct 7, 2024
24 checks passed
@cnasikas cnasikas deleted the backport/8.15/pr-194615 branch October 7, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants