-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Intercept individual package installation via Fleet #161859
Conversation
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
24cc1f3
to
9fadb8d
Compare
Running the Flaky Test Runner for the SecuritySolution Cypress tests: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2629 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @jpdjere 🙏🏽
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @jpdjere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it locally using the 8.7.9-beta.1
package, and all the rule installation workflow tests passed. A big thank you to @jpdjere for the fixes 👍
// Under normal flow the package is installed via the Fleet bulk install API. | ||
// However, for testing purposes the package can be installed via the Fleet individual install API, | ||
// so we need to intercept and wait for that request as well. | ||
if (!packagesBulkInstalled.includes('security_detection_engine')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's okay to leave the logic here for now, but for a more robust solution, we should consider introducing an API endpoint on the detection engine side. This endpoint would handle all the complexities of package installation logic internally. We currently have duplication of this logic on both the frontend and backend. That could be part of Serverless: #150587.
…et (elastic#161859) ## Summary During Cypress tests, intercept `POST /api/fleet/epm/packages/security_detection_engine/*`. This is the endpoint used when a specific `security_detection_engine` package is set to be used via the `--xpack.securitySolution.prebuiltRulesPackageVersion` config flag, which is used to test by the TRADE team. This PR updates the test to account for that flow. ### For maintainers - [ ] 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 45a483f)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ia Fleet (#161859) (#161972) # Backport This will backport the following commits from `main` to `8.9`: - [[Security Solution] Intercept individual package installation via Fleet (#161859)](#161859) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Juan Pablo Djeredjian","email":"jpdjeredjian@gmail.com"},"sourceCommit":{"committedDate":"2023-07-14T13:49:42Z","message":"[Security Solution] Intercept individual package installation via Fleet (#161859)\n\n## Summary\r\n\r\nDuring Cypress tests, intercept `POST\r\n/api/fleet/epm/packages/security_detection_engine/*`.\r\n\r\nThis is the endpoint used when a specific `security_detection_engine`\r\npackage is set to be used via the\r\n`--xpack.securitySolution.prebuiltRulesPackageVersion` config flag,\r\nwhich is used to test by the TRADE team.\r\n\r\nThis PR updates the test to account for that flow.\r\n\r\n### For maintainers\r\n\r\n- [ ] 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":"45a483f49643bcca4ff130d9f100c38a1a2181e7","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","backport:skip","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","v8.10.0"],"number":161859,"url":"https://github.com/elastic/kibana/pull/161859","mergeCommit":{"message":"[Security Solution] Intercept individual package installation via Fleet (#161859)\n\n## Summary\r\n\r\nDuring Cypress tests, intercept `POST\r\n/api/fleet/epm/packages/security_detection_engine/*`.\r\n\r\nThis is the endpoint used when a specific `security_detection_engine`\r\npackage is set to be used via the\r\n`--xpack.securitySolution.prebuiltRulesPackageVersion` config flag,\r\nwhich is used to test by the TRADE team.\r\n\r\nThis PR updates the test to account for that flow.\r\n\r\n### For maintainers\r\n\r\n- [ ] 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":"45a483f49643bcca4ff130d9f100c38a1a2181e7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/161859","number":161859,"mergeCommit":{"message":"[Security Solution] Intercept individual package installation via Fleet (#161859)\n\n## Summary\r\n\r\nDuring Cypress tests, intercept `POST\r\n/api/fleet/epm/packages/security_detection_engine/*`.\r\n\r\nThis is the endpoint used when a specific `security_detection_engine`\r\npackage is set to be used via the\r\n`--xpack.securitySolution.prebuiltRulesPackageVersion` config flag,\r\nwhich is used to test by the TRADE team.\r\n\r\nThis PR updates the test to account for that flow.\r\n\r\n### For maintainers\r\n\r\n- [ ] 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":"45a483f49643bcca4ff130d9f100c38a1a2181e7"}}]}] BACKPORT--> Co-authored-by: Juan Pablo Djeredjian <jpdjeredjian@gmail.com>
Summary
During Cypress tests, intercept
POST /api/fleet/epm/packages/security_detection_engine/*
.This is the endpoint used when a specific
security_detection_engine
package is set to be used via the--xpack.securitySolution.prebuiltRulesPackageVersion
config flag, which is used to test by the TRADE team.This PR updates the test to account for that flow.
For maintainers