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] Update readme for timeline apis #67038

Merged
merged 16 commits into from
Jun 26, 2020

Conversation

angorayc
Copy link
Contributor

@angorayc angorayc commented May 19, 2020

Summary

Update readme for timeline's api and remove redundant query params

Export timeline api

POST /api/timeline/_export

Authorization

Type: Basic Auth

username: Your Kibana username

password: Your Kibana password

Request header

Content-Type: application/json

kbn-version: 8.0.0

Request param

file_name ${filename}.ndjson

Request body
{
	ids: [
		${timelineId}
	]
}

Import timeline api

POST /api/timeline/_import

Authorization

Type: Basic Auth

username: Your Kibana username

password: Your Kibana password

Request header

Content-Type: application/json

kbn-version: 8.0.0

Request body

a .ndjson file
(each json in the file should match this format)
example:

{"savedObjectId":"a3002fd0-781b-11ea-85e4-df9002f1452c","version":"WzIzLDFd","columns":[{"columnHeaderType":"not-filtered","id":"@timestamp"},{"columnHeaderType":"not-filtered","id":"message"},{"columnHeaderType":"not-filtered","id":"event.category"},{"columnHeaderType":"not-filtered","id":"event.action"},{"columnHeaderType":"not-filtered","id":"host.name"},{"columnHeaderType":"not-filtered","id":"source.ip"},{"columnHeaderType":"not-filtered","id":"destination.ip"},{"columnHeaderType":"not-filtered","id":"user.name"}],"dataProviders":[],"description":"tes description","eventType":"all","filters":[{"meta":{"field":null,"negate":false,"alias":null,"disabled":false,"params":"{\"query\":\"MacBook-Pro-de-Gloria.local\"}","type":"phrase","key":"host.name"},"query":"{\"match_phrase\":{\"host.name\":\"MacBook-Pro-de-Gloria.local\"}}","missing":null,"exists":null,"match_all":null,"range":null,"script":null}],"kqlMode":"filter","kqlQuery":{"filterQuery":{"serializedQuery":"{\"bool\":{\"should\":[{\"exists\":{\"field\":\"host.name\"}}],\"minimum_should_match\":1}}","kuery":{"expression":"host.name: *","kind":"kuery"}}},"title":"Test","dateRange":{"start":1585227005527,"end":1585313405527},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1586187068132,"createdBy":"angela","updated":1586187068132,"updatedBy":"angela","eventNotes":[],"globalNotes":[{"noteId":"a3b4d9d0-781b-11ea-85e4-df9002f1452c","version":"WzI1LDFd","note":"this is a note","timelineId":"a3002fd0-781b-11ea-85e4-df9002f1452c","created":1586187069313,"createdBy":"angela","updated":1586187069313,"updatedBy":"angela"}],"pinnedEventIds":[]}
Response
{"success":true,"success_count":1,"errors":[]}

Get draft timeline api

GET /api/timeline/_draft

Authorization

Type: Basic Auth

username: Your Kibana username

password: Your Kibana password

Request header

Content-Type: application/json

kbn-version: 8.0.0

Request param

timelineType default or template

Response
{
    "data": {
        "persistTimeline": {
            "timeline": {
                "savedObjectId": "ababbd90-99de-11ea-8446-1d7fd9f03ebf",
                "version": "WzM2MiwzXQ==",
                "columns": [
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "@timestamp"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "message"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "event.category"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "event.action"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "host.name"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "source.ip"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "destination.ip"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "user.name"
                    }
                ],
                "dataProviders": [],
                "description": "",
                "eventType": "all",
                "filters": [],
                "kqlMode": "filter",
                "timelineType": "default",
                "kqlQuery": {
                    "filterQuery": null
                },
                "title": "",
                "sort": {
                    "columnId": "@timestamp",
                    "sortDirection": "desc"
                },
                "status": "draft",
                "created": 1589899222908,
                "createdBy": "casetester",
                "updated": 1589899222908,
                "updatedBy": "casetester",
                "templateTimelineId": null,
                "templateTimelineVersion": null,
                "favorite": [],
                "eventIdToNoteIds": [],
                "noteIds": [],
                "notes": [],
                "pinnedEventIds": [],
                "pinnedEventsSaveObject": []
            }
        }
    }
}

Clean draft timeline api

POST /api/timeline/_draft

Authorization

Type: Basic Auth

username: Your Kibana username

password: Your Kibana password

Request header

Content-Type: application/json

kbn-version: 8.0.0

Request body
{
	"timelineType": "default" or "template"
}
Response
{
    "data": {
        "persistTimeline": {
            "timeline": {
                "savedObjectId": "ababbd90-99de-11ea-8446-1d7fd9f03ebf",
                "version": "WzQyMywzXQ==",
                "columns": [
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "@timestamp"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "message"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "event.category"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "event.action"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "host.name"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "source.ip"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "destination.ip"
                    },
                    {
                        "columnHeaderType": "not-filtered",
                        "id": "user.name"
                    }
                ],
                "dataProviders": [],
                "description": "",
                "eventType": "all",
                "filters": [],
                "kqlMode": "filter",
                "timelineType": "default",
                "kqlQuery": {
                    "filterQuery": null
                },
                "title": "",
                "sort": {
                    "columnId": "@timestamp",
                    "sortDirection": "desc"
                },
                "status": "draft",
                "created": 1589903306582,
                "createdBy": "casetester",
                "updated": 1589903306582,
                "updatedBy": "casetester",
                "templateTimelineId": null,
                "templateTimelineVersion": null,
                "favorite": [],
                "eventIdToNoteIds": [],
                "noteIds": [],
                "notes": [],
                "pinnedEventIds": [],
                "pinnedEventsSaveObject": []
            }
        }
    }
}

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@angorayc angorayc requested review from a team as code owners May 19, 2020 16:39
@angorayc angorayc added v7.8.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:SIEM labels May 19, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc angorayc added v7.9.0 and removed v7.8.0 labels May 28, 2020
@angorayc
Copy link
Contributor Author

angorayc commented Jun 1, 2020

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

angorayc commented Jun 3, 2020

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

angorayc commented Jun 8, 2020

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

angorayc commented Jun 9, 2020

@elasticmachine merge upstream

##### Request body
a .ndjson file
(each json in the file should match this [format](https://github.com/elastic/kibana/blob/master/x-pack/plugins/siem/public/graphql/types.ts#L118-L146))
Copy link
Contributor

Choose a reason for hiding this comment

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

this link is no good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, we've change the name of the plugin!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove there link here as we are not going to use graphql, might not be a good idea to refer to that.

```json
{
"timelineType": "default" or "template"
Copy link
Contributor

Choose a reason for hiding this comment

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

if i dont pass a body the error I get is:
"[request body]: Invalid value \"null\" supplied to \"\""
I wish it told me the key timelineType

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out!
I have a PR up for fixing that: #65448
I'll make sure this won't happen after the fix.

Copy link
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.

Thanks for the update and making the requested changes. LGTM, nice work!

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@angorayc angorayc merged commit 100a5fd into elastic:master Jun 26, 2020
angorayc added a commit to angorayc/kibana that referenced this pull request Jun 26, 2020
* update doc

* update unit test

* remove redundant params

* fix types

* update readme

* update readme

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
angorayc added a commit that referenced this pull request Jun 26, 2020
* update doc

* update unit test

* remove redundant params

* fix types

* update readme

* update readme

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 29, 2020
* master: (59 commits)
  [Lens] Fix broken test (elastic#70117)
  [SIEM] Import timeline fix (elastic#65448)
  [SECURITY SOLUTION][INGEST] UX update for ingest manager edit/create datasource for endpoint (elastic#70079)
  [Telemetry] Collector Schema (elastic#64942)
  [Endpoint] Add Endpoint empty states for onboarding (elastic#69626)
  Hide unused resolver buttons (elastic#70112)
  [Security] `Investigate in Resolver` Timeline Integration (elastic#70111)
  [Discover] Improve styling of graphs in sidebar (elastic#69440)
  [Metrics UI] Fix EuiTheme type issue (elastic#69735)
  skip failing suite (elastic#70104) (elastic#70103)
  [ENDPOINT] Hide the Timeline Flyout while on the Management Pages (elastic#69998)
  [SIEM][CASE] Persist callout when dismissed (elastic#68372)
  [SIEM][Exceptions] - Cleaned up and updated exception list item comment structure (elastic#69532)
  [Maps] remove indexing state from redux (elastic#69765)
  Add API integration test for deleting data streams. (elastic#70020)
  renames SIEM to Security Solution (elastic#70070)
  Adding saved_objects_page in OSS (elastic#69900)
  [Lens] Use accordion menus in field list for available and empty fields (elastic#68871)
  Dynamic uiActions & license support (elastic#68507)
  [SIEM] Update readme for timeline apis (elastic#67038)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 29, 2020
…bana into alerting/consumer-based-rbac

* 'alerting/consumer-based-rbac' of github.com:gmmorris/kibana: (25 commits)
  [Lens] Fix broken test (elastic#70117)
  [SIEM] Import timeline fix (elastic#65448)
  [SECURITY SOLUTION][INGEST] UX update for ingest manager edit/create datasource for endpoint (elastic#70079)
  [Telemetry] Collector Schema (elastic#64942)
  [Endpoint] Add Endpoint empty states for onboarding (elastic#69626)
  Hide unused resolver buttons (elastic#70112)
  [Security] `Investigate in Resolver` Timeline Integration (elastic#70111)
  [Discover] Improve styling of graphs in sidebar (elastic#69440)
  [Metrics UI] Fix EuiTheme type issue (elastic#69735)
  skip failing suite (elastic#70104) (elastic#70103)
  [ENDPOINT] Hide the Timeline Flyout while on the Management Pages (elastic#69998)
  [SIEM][CASE] Persist callout when dismissed (elastic#68372)
  [SIEM][Exceptions] - Cleaned up and updated exception list item comment structure (elastic#69532)
  [Maps] remove indexing state from redux (elastic#69765)
  Add API integration test for deleting data streams. (elastic#70020)
  renames SIEM to Security Solution (elastic#70070)
  Adding saved_objects_page in OSS (elastic#69900)
  [Lens] Use accordion menus in field list for available and empty fields (elastic#68871)
  Dynamic uiActions & license support (elastic#68507)
  [SIEM] Update readme for timeline apis (elastic#67038)
  ...
@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
release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants