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

[SIEM][Detection Engine] Fixes import bug with non existent signals index #65595

Merged
merged 2 commits into from
May 7, 2020

Conversation

FrankHassanabad
Copy link
Contributor

@FrankHassanabad FrankHassanabad commented May 6, 2020

See: #65565

  • Fixes it to where if there is an import without an index then the rule is not created

Checklist

@FrankHassanabad FrankHassanabad requested review from a team as code owners May 6, 2020 23:17
if (parsedRule instanceof Error) {
// If the JSON object had a validation or parse error then we return
// early with the error and an (unknown) for the ruleId
const importsWorkerPromise = new Promise<ImportRuleResponse>(async resolve => {
Copy link
Contributor Author

@FrankHassanabad FrankHassanabad May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: formatting is all messed up because I removed the dead variable reject

message: parsedRule.message,
ruleId,
statusCode: 409,
message: `To create a rule, the index must exist first. Index ${signalsIndex} does not exist`,
})
);
return null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Ignore what the diff says, this return null is what I added and only what I added.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI You can always add ?w=1 to diff URIs, or select "Hide whitespaces changes" from the cog dropdown on the diff view.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah of course! I used to do that before. Totally forgot about that feature. Thank you!

@FrankHassanabad FrankHassanabad self-assigned this May 6, 2020
@FrankHassanabad FrankHassanabad added v8.0.0 v7.8.0 bug Fixes for quality problems that affect the customer experience release_note:fix Team:SIEM labels May 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

Copy link
Contributor

@dhurley14 dhurley14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I think moving the index check above the while loop would be a minor improvement but not necessary. Thanks for the 🚫🐛

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@FrankHassanabad FrankHassanabad merged commit e3b4b99 into elastic:master May 7, 2020
@FrankHassanabad FrankHassanabad deleted the fix-import-bug branch May 7, 2020 14:06
FrankHassanabad added a commit to FrankHassanabad/kibana that referenced this pull request May 7, 2020
…ndex (elastic#65595)

See: elastic#65565

* Fixes it to where if there is an import without an index then the rule is not created

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 7, 2020
* master:
  [ML] Transforms: Fix API error message display for edit flyout. (elastic#65494)
  [SIEM][Detection Engine] Fixes import bug with non existent signals index (elastic#65595)
  [Lens] Use rules of hooks with linting (elastic#65593)
  [ML] Migrate server side Mocha tests to Jest. (elastic#65651)
  Fixes the client to setup SSL with the CA certificates for testing (elastic#65598)
  reduce uptime plugin initial bundle size (elastic#65257)
  [ML] Consolidating shared types and util functions (elastic#65247)
  [Drilldowns] Preserve state when selecting different action factory (elastic#65074)
  Migrate test plugins ⇒ NP (kbn_tp_embeddable_explorer) (elastic#64756)
  Move remaining home assets to the new platform (elastic#65053)
  Change the copy and the id from blacklist to block list for consistency (elastic#65419)
  [ML] Hide selector helper in Anomaly Explorer swimlane (elastic#65522)
  [ML] Fix the limit control on the Anomaly explorer page (elastic#65459)
  [Mappings editor] Add component integration tests (elastic#63853)
  [Logs + Metrics UI] Prevent component errors from breaking the whole UI (elastic#65456)
  [Logs UI] Disable search bar when live stream is on. (elastic#65491)
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 7, 2020
…ponents

* alerting/lazy-load-actions:
  align and style loading indicator
  [ML] Transforms: Fix API error message display for edit flyout. (elastic#65494)
  [SIEM][Detection Engine] Fixes import bug with non existent signals index (elastic#65595)
  [Lens] Use rules of hooks with linting (elastic#65593)
  [ML] Migrate server side Mocha tests to Jest. (elastic#65651)
  Fixes the client to setup SSL with the CA certificates for testing (elastic#65598)
  reduce uptime plugin initial bundle size (elastic#65257)
  [ML] Consolidating shared types and util functions (elastic#65247)
  [Drilldowns] Preserve state when selecting different action factory (elastic#65074)
  Migrate test plugins ⇒ NP (kbn_tp_embeddable_explorer) (elastic#64756)
  Move remaining home assets to the new platform (elastic#65053)
  Change the copy and the id from blacklist to block list for consistency (elastic#65419)
  [ML] Hide selector helper in Anomaly Explorer swimlane (elastic#65522)
  [ML] Fix the limit control on the Anomaly explorer page (elastic#65459)
  [Mappings editor] Add component integration tests (elastic#63853)
  [Logs + Metrics UI] Prevent component errors from breaking the whole UI (elastic#65456)
  [Logs UI] Disable search bar when live stream is on. (elastic#65491)
FrankHassanabad added a commit that referenced this pull request May 7, 2020
…ndex (#65595) (#65690)

See: #65565

* Fixes it to where if there is an import without an index then the rule is not created

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Sep 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants