-
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][Endpoint] Cypress test to validate that Endpoint can stream alerts to ES/Kibana #155455
[Security Solution][Endpoint] Cypress test to validate that Endpoint can stream alerts to ES/Kibana #155455
Conversation
…py of version found in run endpoint host utility)
…nhanced `getAgentDownloadUrl()` to use it
…d use it in alerts test
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
…endpoint-sends-alert-events # Conflicts: # x-pack/plugins/security_solution/public/management/cypress/cypress.d.ts # x-pack/plugins/security_solution/public/management/cypress/support/data_loaders.ts
…s-alert-events' into task/olm-6030-test-endpoint-sends-alert-events
x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/scripts/endpoint/common/endpoint_metadata_services.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/cypress/tasks/response_actions.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/cypress/support/e2e.ts
Show resolved
Hide resolved
💔 Build FailedFailed CI StepsMetrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
…s-alert-events' into task/olm-6030-test-endpoint-sends-alert-events
* NOTE: This is tno the same as the alerts that populate the Alerts list. To check for | ||
* those types of alerts, use `waitForDetectionAlerts()` | ||
*/ | ||
export const waitForEndpointAlerts = ( |
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.
@paul-tavares have you tried to use https://www.npmjs.com/package/cypress-recurse ?
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.
No, I have not
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.
looks like its available in package.json
from kibana. Are you proposing that be used instead?
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.
Going to merge this in, but if you still have feedback, feel free to post it here on the PR and I'll come back around and follow up on it.
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.
Left a suggestion but other than that, this LGTM
body: { | ||
query: { | ||
query_string: { | ||
query: queryString, |
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.
Not needed now, but perhaps we could do this query more accurate to avoid removing extra things.
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.
yeah, I played around with that as well (see a sample query below), but found that as more/other data is added, we are likely to miss it. I wanted to truly try to remove all records that reference the agent ID so that our tests (especially those that use a Real endpoint) clean up properly after themselves.
Here is the query I initially came up with:
# List all indexes where the agent id has data
GET */_search
{
"query": {
"bool": {
"filter": [
{
"bool": {
"should": [
{
"match": {
"agent.id": "180f5edb-2f48-4d4b-af97-2434775a0bb9"
}
},
{
"match": {
"agent_id": "180f5edb-2f48-4d4b-af97-2434775a0bb9"
}
},
{
"match": {
"EndpointActions.action_id": "180f5edb-2f48-4d4b-af97-2434775a0bb9"
}
},
{
"match": {
"agents": "180f5edb-2f48-4d4b-af97-2434775a0bb9"
}
},
{
"match": {
"_id": "180f5edb-2f48-4d4b-af97-2434775a0bb9"
}
}
],
"minimum_should_match": 1
}
}
]
}
},
"_source": false,
"size": 0,
"aggs": {
"unique_indexes": {
"terms": {
"field": "_index",
"size": 10000
}
}
}
}
…nt_agent.js` CLI tool (#155730) ## Summary As a follow up to PR #155455 : - `run_endpoint_agent` CLI: Removed internal code that handles the creation of a VM and the enrollment of the agent with fleet and replaced it with use of methods now found in `endpoint_host_services` - created new service for managing agent download cache on local system - enhanced `run_endpoint_agent` to use cached version of agent download, and thus increase the performance of this tool
Summary
Testing
The test was added to a Test Suite that is not currently running under CI. To run it manually:
run_endpoint_agent.js
script, which will setup fleet server locally with Docker)