kibana/x-pack/plugins/alerting/server
Christos Nasikas f81c0edb27
[8.16] [ResponseOps][Rules] Validate timezone in rule routes (#201508) (#208300)
# Backport

This will backport the following commits from `main` to `8.16`:
- [[ResponseOps][Rules] Validate timezone in rule routes
(#201508)](https://github.com/elastic/kibana/pull/201508)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2025-01-24T17:46:24Z","message":"[ResponseOps][Rules]
Validate timezone in rule routes (#201508)\n\n## Summary\r\n\r\nThis PR
adds validation only for internal routes that use the
`rRule`\r\nschema.\r\n\r\n## Testing\r\n\r\n1. Create a rule in
main.\r\n2. Snooze the rule by using the API as\r\n\r\n```\r\nPOST
/internal/alerting/rule/<ruleId>/_snooze\r\n{\r\n \"snooze_schedule\":
{\r\n \"id\": \"e58e2340-dba6-454c-8308-b2ca66a7cf7b\",\r\n
\"duration\": 86400000,\r\n \"rRule\": {\r\n \"dtstart\":
\"2024-09-04T09:27:37.011Z\",\r\n \"tzid\": \"invalid\",\r\n \"freq\":
2,\r\n \"interval\": 1,\r\n \"byweekday\": [\r\n \"invalid\"\r\n ]\r\n
}\r\n }\r\n}\r\n```\r\n\r\n4. Go to the rules page and verify that the
rules are not loaded.\r\n5. Switch to my PR.\r\n6. Go to the rules page
and verify that the rules load.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9a3fc89629e1a6cec2f5200bb75099fcab866701","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","Feature:Alerting/RulesFramework","backport:prev-major","v8.18.0","v8.16.4","v8.17.2"],"title":"[ResponseOps][Rules]
Validate timezone in rule
routes","number":201508,"url":"https://github.com/elastic/kibana/pull/201508","mergeCommit":{"message":"[ResponseOps][Rules]
Validate timezone in rule routes (#201508)\n\n## Summary\r\n\r\nThis PR
adds validation only for internal routes that use the
`rRule`\r\nschema.\r\n\r\n## Testing\r\n\r\n1. Create a rule in
main.\r\n2. Snooze the rule by using the API as\r\n\r\n```\r\nPOST
/internal/alerting/rule/<ruleId>/_snooze\r\n{\r\n \"snooze_schedule\":
{\r\n \"id\": \"e58e2340-dba6-454c-8308-b2ca66a7cf7b\",\r\n
\"duration\": 86400000,\r\n \"rRule\": {\r\n \"dtstart\":
\"2024-09-04T09:27:37.011Z\",\r\n \"tzid\": \"invalid\",\r\n \"freq\":
2,\r\n \"interval\": 1,\r\n \"byweekday\": [\r\n \"invalid\"\r\n ]\r\n
}\r\n }\r\n}\r\n```\r\n\r\n4. Go to the rules page and verify that the
rules are not loaded.\r\n5. Switch to my PR.\r\n6. Go to the rules page
and verify that the rules load.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9a3fc89629e1a6cec2f5200bb75099fcab866701"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201508","number":201508,"mergeCommit":{"message":"[ResponseOps][Rules]
Validate timezone in rule routes (#201508)\n\n## Summary\r\n\r\nThis PR
adds validation only for internal routes that use the
`rRule`\r\nschema.\r\n\r\n## Testing\r\n\r\n1. Create a rule in
main.\r\n2. Snooze the rule by using the API as\r\n\r\n```\r\nPOST
/internal/alerting/rule/<ruleId>/_snooze\r\n{\r\n \"snooze_schedule\":
{\r\n \"id\": \"e58e2340-dba6-454c-8308-b2ca66a7cf7b\",\r\n
\"duration\": 86400000,\r\n \"rRule\": {\r\n \"dtstart\":
\"2024-09-04T09:27:37.011Z\",\r\n \"tzid\": \"invalid\",\r\n \"freq\":
2,\r\n \"interval\": 1,\r\n \"byweekday\": [\r\n \"invalid\"\r\n ]\r\n
}\r\n }\r\n}\r\n```\r\n\r\n4. Go to the rules page and verify that the
rules are not loaded.\r\n5. Switch to my PR.\r\n6. Go to the rules page
and verify that the rules load.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9a3fc89629e1a6cec2f5200bb75099fcab866701"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/208252","number":208252,"state":"OPEN"},{"branch":"8.16","label":"v8.16.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
2025-01-28 09:01:00 +01:00
..
alert [8.x] [Response Ops][Alerting] Only load maintenance windows when there are alerts during rule execution and caching loaded maintenance windows (#192573) (#194191) 2024-09-26 11:15:58 -07:00
alerts_client [8.16] Set refresh according to stateful vs stateless when indexing alert documents (#201209) (#202222) 2024-11-29 07:45:23 -06:00
alerts_service [8.16] Set refresh according to stateful vs stateless when indexing alert documents (#201209) (#202222) 2024-11-29 07:45:23 -06:00
application [8.16] [ResponseOps][Rules] Validate timezone in rule routes (#201508) (#208300) 2025-01-28 09:01:00 +01:00
authorization [8.x] [ResponseOps][Alerts] Fix authorization issues with &#x60;discover&#x60; as consumers (#192321) (#194441) 2024-09-30 11:22:26 -05:00
backfill_client [Response Ops][Alerting] Update schedule backfill bulk error response to match other alerting bulk operations error responses (#186638) 2024-06-26 14:50:42 -04:00
connector_adapters [Cases] Case action enhancements and fixes (#180758) 2024-04-16 05:10:24 -07:00
constants [RAM][Maintenance Window] MW scoped query schema and API changes (#171597) 2023-11-22 12:51:52 -08:00
data [8.16] [ResponseOps][MaintenanceWindow] Introduce pagination for MW find API (#197172) (#198324) 2024-11-01 07:02:06 -05:00
health [Response Ops][Rule Form V2] Move dependencies from triggers actions UI to shared package (#184977) 2024-06-12 16:16:31 -07:00
integration_tests [8.16] [Security Solution] Fixes exception item comment validation on newline chars \n (#202063) (#203709) 2024-12-10 23:33:06 -05:00
invalidate_pending_api_keys Add @typescript-eslint/no-floating-promises (#181456) 2024-05-01 08:41:31 -07:00
lib [8.16] [ResponseOps][Rules] Validate timezone in rule routes (#201508) (#208300) 2025-01-28 09:01:00 +01:00
maintenance_window_client [8.16] [ResponseOps][MaintenanceWindow] Introduce pagination for MW find API (#197172) (#198324) 2024-11-01 07:02:06 -05:00
manual_tests [ResponseOps][Alerting] Deprecate and remove references to action variables in the ui and in tests that are no longer used (#161136) 2023-07-13 11:15:27 -04:00
monitoring Let addLastRunError to report user errors (#180040) 2024-04-05 17:11:41 +02:00
routes [8.16] [ResponseOps][Rules] Validate timezone in rule routes (#201508) (#208300) 2025-01-28 09:01:00 +01:00
rules_client [8.x] [Response Ops][Rules] Version Get Rule Types API (#195361) (#196175) 2024-10-15 11:02:48 -05:00
rules_settings [8.x] [Response Ops][Flapping] Rule Specific Flapping - Create/Update API changes (#190019) (#195526) 2024-10-09 04:47:24 +02:00
saved_objects [8.16] [ResponseOps][MW] Fix bug when creating repeating Maintenance Window (#207084) (#208313) 2025-01-27 12:25:56 +01:00
task_runner [8.16] Set refresh according to stateful vs stateless when indexing alert documents (#201209) (#202222) 2024-11-29 07:45:23 -06:00
test_utils [8.x] [Response Ops][Alerting] Creating global service for fetching and caching rules settings (#192404) (#193011) 2024-09-16 10:30:31 -05:00
usage [8.x] [ResponseOps][Telemetry] Add default value for new telemetry fields for old tasks (#194827) (#195140) 2024-10-04 15:40:45 -05:00
alerting_authorization_client_factory.mock.ts
alerting_authorization_client_factory.test.ts [HTTP] Allow for internal requests to also specify special query param elasticInternalOrigin (#163796) 2023-08-21 11:55:33 +02:00
alerting_authorization_client_factory.ts Improve features plugin's contract type names (#187944) 2024-07-17 15:33:32 +01:00
config.test.ts [8.x] Remove max limit of alerting.rules.maxScheduledPerMinute (#194723) (#194826) 2024-10-03 08:51:01 -05:00
config.ts [8.x] Remove max limit of alerting.rules.maxScheduledPerMinute (#194723) (#194826) 2024-10-03 08:51:01 -05:00
index.ts [Security Solution] Allow users to edit max_signals field for custom rules (#179680) 2024-05-03 12:00:08 -07:00
maintenance_window_client.mock.ts [RAM] [Maintenance Windows] Add Maintenance Window Names to Alert Table (#159847) 2023-06-20 16:40:05 -07:00
maintenance_window_client_factory.test.ts [Alerting Plugin] Migrate authc.getCurrentUser usage to core.security (#187020) 2024-07-01 19:05:32 -05:00
maintenance_window_client_factory.ts [Alerting Plugin] Migrate authc.getCurrentUser usage to core.security (#187020) 2024-07-01 19:05:32 -05:00
maintenance_window_feature.ts [8.x] Added scope field to features config. (#191634) (#193389) 2024-09-19 10:42:43 -05:00
mocks.ts [8.x] [Response Ops][Alerting] Only load maintenance windows when there are alerts during rule execution and caching loaded maintenance windows (#192573) (#194191) 2024-09-26 11:15:58 -07:00
plugin.test.ts [Security Solution] Allow users to edit max_signals field for custom rules (#179680) 2024-05-03 12:00:08 -07:00
plugin.ts [8.16] Set refresh according to stateful vs stateless when indexing alert documents (#201209) (#202222) 2024-11-29 07:45:23 -06:00
rule_type_registry.mock.ts Add connector and actionTaskParams modelVersions (#184542) 2024-06-18 16:31:16 +02:00
rule_type_registry.test.ts [Response Ops][Task Manager] Resource based task scheduling - 2nd attempt (#189626) 2024-08-07 15:27:52 -04:00
rule_type_registry.ts [8.x] [Response Ops][Rules] Version Get Rule Types API (#195361) (#196175) 2024-10-15 11:02:48 -05:00
rule_type_registry_deprecated_consumers.test.ts [Response Ops][Alerting] Adding severity levels to action groups and determining if alert is improving (#184163) 2024-06-26 12:42:24 -04:00
rule_type_registry_deprecated_consumers.ts [Response Ops][Alerting] Adding severity levels to action groups and determining if alert is improving (#184163) 2024-06-26 12:42:24 -04:00
rules_client.mock.ts [8.x] [Response Ops][Alerting] Remove rules client from alerting task runner (#194300) (#194858) 2024-10-03 12:37:16 -05:00
rules_client_conflict_retries.test.ts [ResponseOps][Rules] Version disable rule route (#188659) 2024-07-25 09:06:04 +02:00
rules_client_factory.test.ts [Alerting Plugin] Migrate authc.getCurrentUser usage to core.security (#187020) 2024-07-01 19:05:32 -05:00
rules_client_factory.ts [Alerting Plugin] Migrate authc.getCurrentUser usage to core.security (#187020) 2024-07-01 19:05:32 -05:00
types.ts [8.16] Set refresh according to stateful vs stateless when indexing alert documents (#201209) (#202222) 2024-11-29 07:45:23 -06:00