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

[ResponseOps] Allow users authenticated with an API keys to manage alerting rules #153805

Conversation

doakalexi
Copy link
Contributor

@doakalexi doakalexi commented Mar 27, 2023

Summary

Updates the following functions in the Rules Client to re-use the API key in context and avoid having the system invalidate them when no longer in use:

  • bulk_delete
  • bulk_edit
  • clone
  • create
  • delete
  • update
  • update_api_key

Also adds a new field to the rule SO to help determine when whether an api key was created by a user or created by us.

Checklist

To verify

@doakalexi doakalexi changed the title Updating rules client to allow users with api key auth to manage rules [ResponseOps] Allow users authenticated with an API keys to manage alerting rules Mar 28, 2023
@doakalexi doakalexi added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) release_note:feature Makes this part of the condensed release notes v8.8.0 labels Mar 28, 2023
@kibana-ci
Copy link
Collaborator

kibana-ci commented Mar 31, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #7 / bulkEdit() actions operations should set timeframe in alertsFilter null if doesn't exist
  • [job] [logs] Jest Integration Tests #1 / checking migration metadata changes on all registered SO types detecting migration related changes in registered types
  • [job] [logs] Jest Tests #7 / create() calls the authentication API key function if the user is authenticated using an api key
  • [job] [logs] FTR Configs #22 / detection engine api security and spaces enabled - rule execution logic Threat match type rules terms and match should have the same alerts with pagination
  • [job] [logs] FTR Configs #37 / features Features /api/features with trial license should return a full feature set
  • [job] [logs] FTR Configs #37 / features Features /api/features with trial license should return a full feature set
  • [job] [logs] Jest Tests #7 / MaintenanceWindowClient - active should log and return false is an error is thrown
  • [job] [logs] Jest Tests #7 / MaintenanceWindowClient - update should call update with the correct parameters
  • [job] [logs] FTR Configs #7 / security (basic license) Privileges GET /api/security/privileges should include sub-feature privileges when respectlicenseLevel is false
  • [job] [logs] FTR Configs #7 / security (basic license) Privileges GET /api/security/privileges should include sub-feature privileges when respectlicenseLevel is false
  • [job] [logs] FTR Configs #7 / security (basic license) Privileges GET /api/security/privileges should return a privilege map with all known privileges, without actions
  • [job] [logs] FTR Configs #7 / security (basic license) Privileges GET /api/security/privileges should return a privilege map with all known privileges, without actions
  • [job] [logs] FTR Configs #52 / security Privileges GET /api/security/privileges should return a privilege map with all known privileges, without actions
  • [job] [logs] FTR Configs #52 / security Privileges GET /api/security/privileges should return a privilege map with all known privileges, without actions
  • [job] [logs] FTR Configs #52 / security Privileges GET /api/security/privileges?respectLicenseLevel=false should return a privilege map with all known privileges, without actions
  • [job] [logs] FTR Configs #52 / security Privileges GET /api/security/privileges?respectLicenseLevel=false should return a privilege map with all known privileges, without actions
  • [job] [logs] Jest Integration Tests #2 / SO type registrations does not remove types from registrations without updating excludeOnUpgradeQuery

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
alerting 33 35 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
alerting 540 570 +30

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
alerting 41 42 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
alerting 44.2KB 44.7KB +603.0B

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
alert 101 102 +1
maintenance-window - 28 +28
total +29
Unknown metric groups

API count

id before after diff
alerting 560 590 +30

ESLint disabled line counts

id before after diff
securitySolution 432 435 +3

Total ESLint disabled count

id before after diff
securitySolution 512 515 +3

History

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

@doakalexi doakalexi closed this Mar 31, 2023
@doakalexi doakalexi removed Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) release_note:feature Makes this part of the condensed release notes v8.8.0 labels Mar 31, 2023
@doakalexi doakalexi deleted the alerting/allow-manage-rules-with-api-key-auth branch March 31, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants