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

[Timeline] Add Indicator Match Timeline Template #95840

Merged
merged 8 commits into from Apr 15, 2021
Merged

[Timeline] Add Indicator Match Timeline Template #95840

merged 8 commits into from Apr 15, 2021

Conversation

peasead
Copy link
Contributor

@peasead peasead commented Mar 30, 2021

Summary

Currently, there are generic timelines for network, endpoint, and processes.

I would like to add a generic indicator match timeline for the Indicator Match detection rule.

This includes the threat.indicator.matched.atomic, threat.indicator.matched.field, and threat.indicator.matched.type fields.

image
image

Resolves #95565

Checklist

Delete any items that are not applicable to this PR.

Using the documentation here, I was able to successfully run the add_prepackaged_timelines.sh and ./timelines/find_timeline_by_filter.sh scripts to load and verify the Timeline templates in 7.12.0.

sh ./timelines/add_prepackaged_timelines.sh
{
  "success": false,
  "success_count": 1,
  "errors": [
    {
      "id": "(template_timeline_id) db366523-f1c6-4c1f-8731-6ce5ed9e5717",
      "error": {
        "status_code": 409,
        "message": "Timeline template version conflict. The provided templateTimelineVersion does not match the current template."
      }
    },
    {
      "id": "(template_timeline_id) 91832785-286d-4ebe-b884-1a208d111a70",
      "error": {
        "status_code": 409,
        "message": "Timeline template version conflict. The provided templateTimelineVersion does not match the current template."
      }
    },
    {
      "id": "(template_timeline_id) 76e52245-7519-4251-91ab-262fb1a1728c",
      "error": {
        "status_code": 409,
        "message": "Timeline template version conflict. The provided templateTimelineVersion does not match the current template."
      }
    }
  ],
  "timelines_installed": 1,
  "timelines_updated": 0
sh ./timelines/find_timeline_by_filter.sh immutable template elastic
{
  "data": {
    "getAllTimeline": {
      "totalCount": 4,
      "defaultTimelineCount": 0,
      "templateTimelineCount": 4,
      "elasticTemplateTimelineCount": 4,
      "customTemplateTimelineCount": 0,
      "favoriteCount": 0,
      "timeline": [
        {
          "savedObjectId": "13a24c90-918a-11eb-8c0e-81118a850125",
          "description": "This Timeline template is for alerts generated by Indicator Match detection rules.",
          "favorite": [],
          "eventIdToNoteIds": [],
          "notes": [],
          "noteIds": [],
          "pinnedEventIds": [],
          "status": "immutable",
          "title": "Generic Indicator Match Timeline",
          "timelineType": "template",
          "templateTimelineId": "495ad7a7-316e-4544-8a0f-9c098daee76e",
          "templateTimelineVersion": 1,
          "created": 1617130778584,
          "createdBy": "Elastic",
          "updated": 1617130778584,
          "updatedBy": "Elastic",
          "version": "WzIwMywxXQ==",
          "__typename": "TimelineResult"
        },
        {
          "savedObjectId": "1b29d5a0-9180-11eb-b3d2-7d2797f79400",
          "description": "",
          "favorite": [],
          "eventIdToNoteIds": [],
          "notes": [],
          "noteIds": [],
          "pinnedEventIds": [],
          "status": "immutable",
          "title": "Generic Process Timeline",
          "timelineType": "template",
          "templateTimelineId": "76e52245-7519-4251-91ab-262fb1a1728c",
          "templateTimelineVersion": 2,
          "created": 1617126496250,
          "createdBy": "Elastic",
          "updated": 1617126496250,
          "updatedBy": "Elastic",
          "version": "WzE0MCwxXQ==",
          "__typename": "TimelineResult"
        },
        {
          "savedObjectId": "1b29ae90-9180-11eb-b3d2-7d2797f79400",
          "description": "",
          "favorite": [],
          "eventIdToNoteIds": [],
          "notes": [],
          "noteIds": [],
          "pinnedEventIds": [],
          "status": "immutable",
          "title": "Generic Network Timeline",
          "timelineType": "template",
          "templateTimelineId": "91832785-286d-4ebe-b884-1a208d111a70",
          "templateTimelineVersion": 2,
          "created": 1617126496249,
          "createdBy": "Elastic",
          "updated": 1617126496249,
          "updatedBy": "Elastic",
          "version": "WzEzOSwxXQ==",
          "__typename": "TimelineResult"
        },
        {
          "savedObjectId": "1b298780-9180-11eb-b3d2-7d2797f79400",
          "description": "",
          "favorite": [],
          "eventIdToNoteIds": [],
          "notes": [],
          "noteIds": [],
          "pinnedEventIds": [],
          "status": "immutable",
          "title": "Generic Endpoint Timeline",
          "timelineType": "template",
          "templateTimelineId": "db366523-f1c6-4c1f-8731-6ce5ed9e5717",
          "templateTimelineVersion": 2,
          "created": 1617126496248,
          "createdBy": "Elastic",
          "updated": 1617126496248,
          "updatedBy": "Elastic",
          "version": "WzEzOCwxXQ==",
          "__typename": "TimelineResult"
        }
      ],
      "__typename": "ResponseTimelines"
    }
  }
}

For maintainers

@peasead peasead added Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Timeline Security Solution Timeline feature 7.13 candidate labels Mar 30, 2021
@peasead peasead requested a review from a team as a code owner March 30, 2021 19:43
@elasticmachine
Copy link
Contributor

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

@peasead peasead marked this pull request as draft March 30, 2021 19:43
@peasead peasead marked this pull request as ready for review March 30, 2021 19:48
@MikePaquette
Copy link

@peasead this is awesome! Timeline templates are powerful, and I'm psyched to see this new one being added!

Question: What would you think about calling this a generic threat match timeline template?

Two reasons why I ask:

  1. Forward looking: I understand that currently all indicator match rules write enrichment results to the threat.indicator.matched.* fields in the signal document, but our plans for this rule type are that it could be used more generically in the future, where the enrichment results might be stored in another prefix/object.

  2. Consistency: Existing generic timeline templates are process, network, and endpoint which are more about the subject of timeline, rather than the rule type. threat match would seem to be more in line with the other generic timeline templates.

@peasead
Copy link
Contributor Author

peasead commented Mar 31, 2021

Great feedback, thanks @MikePaquette

Absolutely makes sense to change the name. I can do that and update the PR.

@peasead
Copy link
Contributor Author

peasead commented Apr 7, 2021

Can anyone help me with these checks?

@rylnd
Copy link
Contributor

rylnd commented Apr 7, 2021

@elasticmachine merge upstream

@rylnd
Copy link
Contributor

rylnd commented Apr 8, 2021

@elasticmachine merge upstream

@peasead
Copy link
Contributor Author

peasead commented Apr 9, 2021

Thanks @rylnd

What're the next steps? Anything I need to do?

Copy link
Contributor

@ecezalp ecezalp left a comment

Choose a reason for hiding this comment

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

was able to verify the changes with the following steps

  1. set the following env vars
export ELASTICSEARCH_USERNAME=${user}
export ELASTICSEARCH_PASSWORD=${password}
export ELASTICSEARCH_URL=https://${ip}:9200
export KIBANA_URL=http://localhost:5601
export TASK_MANAGER_INDEX=.kibana-task-manager-${your user id}
export KIBANA_INDEX=.kibana-${your user id}

and source ~/.bash_profile

  1. add xpack.securitySolution.signalsIndex: .siem-signals-${username} to config/kibana.dev.yml

  2. run the following

brew update && brew install curl && brew install jq
cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts
sh ./timelines/add_prepackaged_timelines.sh
  1. go to http://localhost:5601/app/security#/detections/rules and click on Install Elastic prebuild rules

after following the steps above, I was able to find and interact with the threat match template. I was able to find my previously generated alerts in the timeline view.
Screen Shot 2021-04-13 at 11 03 34 AM
Screen Shot 2021-04-13 at 11 03 45 AM
Screen Shot 2021-04-13 at 11 05 12 AM

LGTM!

@ecezalp
Copy link
Contributor

ecezalp commented Apr 13, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@peasead peasead mentioned this pull request Apr 15, 2021
2 tasks
@peasead peasead merged commit 8f2f65d into elastic:master Apr 15, 2021
@rylnd
Copy link
Contributor

rylnd commented Apr 16, 2021

We need to backport this to 7.x to get it into the 7.x releases. Doing that now!

@rylnd rylnd added the v8.0.0 label Apr 16, 2021
rylnd pushed a commit to rylnd/kibana that referenced this pull request Apr 16, 2021
* added threat-match timeline template

* added indicator match timeline template

* updated name to threat match

* updated name to threat match

* changed file name to threat.json

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rylnd added a commit that referenced this pull request Apr 16, 2021
* added threat-match timeline template

* added indicator match timeline template

* updated name to threat match

* updated name to threat match

* changed file name to threat.json

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Andrew Pease <7442091+peasead@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
madirey pushed a commit to madirey/kibana that referenced this pull request May 11, 2021
* added threat-match timeline template

* added indicator match timeline template

* updated name to threat match

* updated name to threat match

* changed file name to threat.json

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Timeline Security Solution Timeline feature help wanted adoptme release_note:enhancement Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Timeline] Add Generic Indicator Match Timeline
6 participants