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

[Security Solution] Add support for GET requests to the Detection Engine health API #159970

Merged

Conversation

banderror
Copy link
Contributor

@banderror banderror commented Jun 19, 2023

Partially addresses: #125642

Summary

The PoC of the Detection Engine health API has been implemented in #157155. Now, we need to integrate it into the support-diagnostics tool. It looks like the tool requires the APIs it calls to be callable with the GET verb.

This PR makes it possible to call 2 out of 3 health endpoints with GET:

GET /internal/detection_engine/health/_cluster
GET /internal/detection_engine/health/_space

The GET routes don't accept any parameters and use the default parameters instead:

  • interval: last_day
  • granularity: hour
  • debug: false

Checklist

For maintainers

@banderror banderror added release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Rule Monitoring Security Solution Detection Rule Monitoring Team:Detection Rule Management Security Detection Rule Management Team v8.9.0 v8.8.2 labels Jun 19, 2023
@banderror banderror requested a review from a team as a code owner June 19, 2023 19:13
@banderror banderror requested a review from jpdjere June 19, 2023 19:13
@banderror banderror self-assigned this Jun 19, 2023
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@maximpn maximpn self-requested a review June 20, 2023 10:37
@banderror banderror force-pushed the detection-engine-health-api-get-requests branch from 968d52c to 3a7f3cb Compare June 20, 2023 10:46
Copy link
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

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

@banderror The changes look straightforward and work locally as expected 👍

@banderror banderror removed the request for review from jpdjere June 20, 2023 12:06
@banderror banderror enabled auto-merge (squash) June 20, 2023 12:06
@banderror banderror force-pushed the detection-engine-health-api-get-requests branch from 3a7f3cb to 5be87d1 Compare June 20, 2023 12:53
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Explore - Security Solution Tests #2 / Entity Analytics Dashboard With anomalies data renders table with pagination

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 13 15 +2
securitySolution 411 415 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 14 16 +2
securitySolution 494 498 +4
total +6

History

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

cc @banderror

@banderror banderror merged commit 7047f24 into elastic:main Jun 20, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 20, 2023
…ine health API (elastic#159970)

**Partially addresses:** elastic#125642

## Summary

The PoC of the Detection Engine health API has been implemented in
elastic#157155. Now, we need to integrate
it into the
[support-diagnostics](https:/elastic/support-diagnostics)
tool. It looks like the tool requires the APIs it calls to be callable
with the `GET` verb.

This PR makes it possible to call 2 out of 3 health endpoints with
`GET`:

```txt
GET /internal/detection_engine/health/_cluster
```

```txt
GET /internal/detection_engine/health/_space
```

The `GET` routes don't accept any parameters and use the default
parameters instead:

- interval: `last_day`
- granularity: `hour`
- debug: `false`

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 7047f24)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@banderror banderror deleted the detection-engine-health-api-get-requests branch June 20, 2023 15:48
kibanamachine added a commit that referenced this pull request Jun 20, 2023
…on Engine health API (#159970) (#160023)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Security Solution] Add support for GET requests to the Detection
Engine health API
(#159970)](#159970)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https:/sqren/backport)

<!--BACKPORT [{"author":{"name":"Georgii
Gorbachev","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-20T14:03:27Z","message":"[Security
Solution] Add support for GET requests to the Detection Engine health
API (#159970)\n\n**Partially addresses:**
https:/elastic/kibana/issues/125642\r\n\r\n##
Summary\r\n\r\nThe PoC of the Detection Engine health API has been
implemented in\r\nhttps://pull/157155. Now, we
need to integrate\r\nit into
the\r\n[support-diagnostics](https:/elastic/support-diagnostics)\r\ntool.
It looks like the tool requires the APIs it calls to be callable\r\nwith
the `GET` verb.\r\n\r\nThis PR makes it possible to call 2 out of 3
health endpoints with\r\n`GET`:\r\n\r\n```txt\r\nGET
/internal/detection_engine/health/_cluster\r\n```\r\n\r\n```txt\r\nGET
/internal/detection_engine/health/_space\r\n```\r\n\r\nThe `GET` routes
don't accept any parameters and use the default\r\nparameters
instead:\r\n\r\n- interval: `last_day`\r\n- granularity: `hour`\r\n-
debug: `false`\r\n\r\n\r\n### Checklist\r\n\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7047f24c1743a2a98e22e332403c5260d6062374","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Feature:Rule
Monitoring","Team:Detection Rule
Management","v8.9.0","v8.8.2"],"number":159970,"url":"https:/elastic/kibana/pull/159970","mergeCommit":{"message":"[Security
Solution] Add support for GET requests to the Detection Engine health
API (#159970)\n\n**Partially addresses:**
https:/elastic/kibana/issues/125642\r\n\r\n##
Summary\r\n\r\nThe PoC of the Detection Engine health API has been
implemented in\r\nhttps://pull/157155. Now, we
need to integrate\r\nit into
the\r\n[support-diagnostics](https:/elastic/support-diagnostics)\r\ntool.
It looks like the tool requires the APIs it calls to be callable\r\nwith
the `GET` verb.\r\n\r\nThis PR makes it possible to call 2 out of 3
health endpoints with\r\n`GET`:\r\n\r\n```txt\r\nGET
/internal/detection_engine/health/_cluster\r\n```\r\n\r\n```txt\r\nGET
/internal/detection_engine/health/_space\r\n```\r\n\r\nThe `GET` routes
don't accept any parameters and use the default\r\nparameters
instead:\r\n\r\n- interval: `last_day`\r\n- granularity: `hour`\r\n-
debug: `false`\r\n\r\n\r\n### Checklist\r\n\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7047f24c1743a2a98e22e332403c5260d6062374"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https:/elastic/kibana/pull/159970","number":159970,"mergeCommit":{"message":"[Security
Solution] Add support for GET requests to the Detection Engine health
API (#159970)\n\n**Partially addresses:**
https:/elastic/kibana/issues/125642\r\n\r\n##
Summary\r\n\r\nThe PoC of the Detection Engine health API has been
implemented in\r\nhttps://pull/157155. Now, we
need to integrate\r\nit into
the\r\n[support-diagnostics](https:/elastic/support-diagnostics)\r\ntool.
It looks like the tool requires the APIs it calls to be callable\r\nwith
the `GET` verb.\r\n\r\nThis PR makes it possible to call 2 out of 3
health endpoints with\r\n`GET`:\r\n\r\n```txt\r\nGET
/internal/detection_engine/health/_cluster\r\n```\r\n\r\n```txt\r\nGET
/internal/detection_engine/health/_space\r\n```\r\n\r\nThe `GET` routes
don't accept any parameters and use the default\r\nparameters
instead:\r\n\r\n- interval: `last_day`\r\n- granularity: `hour`\r\n-
debug: `false`\r\n\r\n\r\n### Checklist\r\n\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"7047f24c1743a2a98e22e332403c5260d6062374"}},{"branch":"8.8","label":"v8.8.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Georgii Gorbachev <[email protected]>
banderror added a commit that referenced this pull request Jun 21, 2023
…PI (#160137)

**Partially addresses:** #125642

## Summary

- fixes typos noticed by @maximpn in
#159970 (comment)
- adds additional docs for #159875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Rule Monitoring Security Solution Detection Rule Monitoring release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.8.2 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants