Skip to content

[SecuritySolution] Add SecuritySolution sample data#164052

Closed
angorayc wants to merge 51 commits intoelastic:mainfrom
angorayc:sample-data
Closed

[SecuritySolution] Add SecuritySolution sample data#164052
angorayc wants to merge 51 commits intoelastic:mainfrom
angorayc:sample-data

Conversation

@angorayc
Copy link
Copy Markdown
Contributor

@angorayc angorayc commented Aug 16, 2023

Summary

Steps to verify:
Try sample data > Security Solution data > Add data

  • It should populate sample data: auditbeat, logs, and alerts
  • It shouldn't affect existing auditbeat, logs or alerts data
  • It should install relevant saved objects and ingest pipelines

Try sample data > Security Solution data > Remove data

  • It should remove sample data

  • It shouldn't affect existing auditbeat, logs or alerts data

  • It should remove relevant saved objects and ingest pipelines

  • Add Security Solution sample data:

Screenshot 2023-09-20 at 20 51 03
  • Install sample data

Uploading Screen Recording 2023-09-20 at 20.48.28.mov…

  • Remove sample data
remove_sample_data.mov
  • Update fields with ingest pipeline:
pipeline
  • Create kibana_sample_data_securitysolution_alerts index
  • Add sample alert index to security solution alerts alias (and the alerts alias should not be deleted when sample data removed)
Screenshot 2023-09-14 at 16 11 26
  • Create kibana_sample_data_securitysolution_auditbeat index
  • Add Auditbeat sample index to an alias that matches auditbeat-* pattern:
Screenshot 2023-09-14 at 16 12 57

Checklist

Delete any items that are not applicable to this PR.

@angorayc angorayc changed the title add sample data Add SecuritySolution sample data Aug 28, 2023
index: {
...dataIndex.indexSettings,
},
settings: {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The use of the 'body' key has been deprecated, so moving the nested keys to the top level object.

node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.d.ts line 8755

},
settings: {
index: {},
mappings: {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The use of the 'body' key has been deprecated, so moving the nested keys to the top level object.

node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.d.ts line 8755

@angorayc angorayc added the ci:cloud-deploy Create or update a Cloud deployment label Sep 11, 2023

const resp = await esClient.asCurrentUser.bulk({
body: bulk,
refresh: true,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Before - There were chances that new indices haven't refreshed before the next listing request:

incorrect_add_data_state.mov

After:

Screen.Recording.2023-09-12.at.11.41.42.mov

@angorayc
Copy link
Copy Markdown
Contributor Author

I've tried to run in locally, just spun up your branch in stateful mode and clicked "Add data", and toast message with "Internal error" appears (the flights sample data gets installed as usual):

image

Thanks for pointing this out, I messed up the dashboard references in 2c998fd#diff-c047af719d3de4f7878bbfabb1b9b22c1e56fddf51d9ca9c1fa97e48235b7704. It should work now.

@angorayc angorayc changed the title Add SecuritySolution sample data [SecuritySolution] Add SecuritySolution sample data Sep 21, 2023
Copy link
Copy Markdown
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

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

Great job 👍 !

@ferenrigue
Copy link
Copy Markdown

Reviewed!

Copy link
Copy Markdown
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

I'm not sure, why @elastic/kibana-data-discovery team is assigned to review since there seems to be no code ownership here, but I just needed to test something in Security , and so I've been using this PR, and I works like expected. It's really nice to have this available with just a few clicks, thanks a lot 👍

@stephmilovic
Copy link
Copy Markdown
Contributor

stephmilovic commented Sep 25, 2023

Resolves #124463

@stephmilovic
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

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

I think we need to handle the sourcerer specially for this case. We can discuss in our meeting in 20 mins :)
Screenshot 2023-09-25 at 9 42 16 AM

@angorayc angorayc removed the v8.11.0 label Sep 25, 2023
@kibana-ci
Copy link
Copy Markdown

kibana-ci commented Sep 26, 2023

💔 Build Failed

Failed CI Steps

Metrics [docs]

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
home 109 110 +1

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
home 0 1 +1
Unknown metric groups

API count

id before after diff
home 149 150 +1

ESLint disabled line counts

id before after diff
securitySolution 454 456 +2

References to deprecated APIs

id before after diff
home 71 70 -1

Total ESLint disabled count

id before after diff
securitySolution 521 523 +2

History

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

cc @angorayc

@angorayc
Copy link
Copy Markdown
Contributor Author

This PR will not make it in 8.11 as here are some more items to do:

  1. Write an issues for onboarding sample data @paulewing
  2. Confirm if we want to add Sample data view to alerts page data view @paulewing
  3. Could tag sample alerts / events with a sample data tag to indicate it's a sample data @paulewing
  4. Confirm with @james.spiteri if we should only install sample events and sample rules . Let it automatically generate alerts from sample events @paulewing
  5. Check with @james.spiteri if we should modify any values in the sample data @paulewing
  6. Investigate opening alert flyout automatically @angorayc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:cloud-deploy Create or update a Cloud deployment needs_docs release_note:feature Makes this part of the condensed release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants