-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution] [Detections] Remove allow_no_indices to prevent error being thrown in response of field capabilities #89927
[Security Solution] [Detections] Remove allow_no_indices to prevent error being thrown in response of field capabilities #89927
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there are still some failing integration tests that were relying on the previous rule behavior. Related to this, it would be nice to have an integration test that explicitly captures this new behavior: the rule will fail with an error if no source indices exist.
LGTM once CI is happy 👍
@elasticmachine merge upstream |
…ices property then write error status with index patterns provided to rule
…e should fail and when one index pattern does exist but another does not, the rule should succeed
c60f8e9
to
e41de31
Compare
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
…rror being thrown in response of field capabilities (elastic#89927) * remove allow_no_indices param, adds a check if response has empty indices property then write error status with index patterns provided to rule * fix tests * fix tests and update with comments * update integration tests * adds integration test for when an index pattern doesn't exist the rule should fail and when one index pattern does exist but another does not, the rule should succeed
…rror being thrown in response of field capabilities (elastic#89927) * remove allow_no_indices param, adds a check if response has empty indices property then write error status with index patterns provided to rule * fix tests * fix tests and update with comments * update integration tests * adds integration test for when an index pattern doesn't exist the rule should fail and when one index pattern does exist but another does not, the rule should succeed
…-ml-jobs * 'master' of github.com:elastic/kibana: (254 commits) [Security Solution] [Detections] Remove allow_no_indices to prevent error being thrown in response of field capabilities (elastic#89927) Skip test for cloud (elastic#89450) [Fleet] Fix duplicate data streams being shown in UI (elastic#89812) Bump package dependencies (elastic#90034) [App Search] DRY helper for encoding/decoding routes that can have special characters in params (elastic#89811) TypeScript project references for Observability plugin (elastic#89320) [SearchSource] Combine sort and parent fields when serializing (elastic#89808) Made imports static (elastic#89935) [ml] migrate file_data_visualizer/import route to file_upload plugin (elastic#89640) [Discover] Adapt default column behavior (elastic#89826) Round start and end values (elastic#89030) Rename getProxyAgents to getCustomAgents (elastic#89813) [Form lib] UseField `onError` listener (elastic#89895) [APM] use latency sum instead of avg for impact (elastic#89990) migrate more core-owned plugins to tsproject ref (elastic#89975) [Logs UI] Load <LogStream> entries via async searches (elastic#86899) [APM] Abort browser requests when appropriate (elastic#89557) [Alerting] Allow user to select existing connector of same type when fixing broken connector (elastic#89062) [Data Table] Use shared CSV export mechanism (elastic#89702) chore(NA): improve logic check when installing Bazel tools (elastic#89634) ...
…vent error being thrown in response of field capabilities (#89927) (#90072) * remove allow_no_indices param, adds a check if response has empty indices property then write error status with index patterns provided to rule * fix tests * fix tests and update with comments * update integration tests * adds integration test for when an index pattern doesn't exist the rule should fail and when one index pattern does exist but another does not, the rule should succeed
…event error being thrown in response of field capabilities (#89927) (#90073) * remove allow_no_indices param, adds a check if response has empty indices property then write error status with index patterns provided to rule * fix tests * fix tests and update with comments * update integration tests * adds integration test for when an index pattern doesn't exist the rule should fail and when one index pattern does exist but another does not, the rule should succeed
@@ -46,11 +47,13 @@ export default ({ getService }: FtrProviderContext) => { | |||
describe('creating rules', () => { | |||
beforeEach(async () => { | |||
await createSignalsIndex(supertest); | |||
await esArchiver.load('auditbeat/hosts'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For posterity: these indices were added so that the rule would not fail on the initial permissions check due to a lack of indices.
Summary
Removes
allow_no_indices
param. Specifying this option meant that our field_capabilities check was throwing an error if the rule included an index pattern that did not exist. This would be most typical in e.g. a prepackaged rule using the default index patterns.If we pass the field capabilities api an index pattern that does not match any indices in Elasticsearch, that index pattern is not returned as a part of the response with indices that have that field "unmapped". This adds a check if the response from field capabilities api has empty
indices
property then write error status with index patterns provided to rule. This essentially tells the user there are no concrete indices matching any of the provided index patterns.Checklist
Delete any items that are not applicable to this PR.
For maintainers