-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[SecruitySolution][Endpoint][ResponseActions] Add usage telemtery for response actions rules #221518
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
Merged
ashokaditya
merged 23 commits into
elastic:main
from
ashokaditya:task/edr-workflows-telemetry-rules-with-response-actions
Jun 24, 2025
Merged
[SecruitySolution][Endpoint][ResponseActions] Add usage telemtery for response actions rules #221518
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b5d78e8
add snapshot telemtery for response actions rules
ashokaditya ec5e4d3
fix KQL filter to select response action rules SOs
ashokaditya 6855667
cleanup event data and types
ashokaditya cff4aa6
update registered task test
ashokaditya 0dd2385
fix
ashokaditya c7d63e3
fix KQL
ashokaditya cef14d9
use ES Client instead of rulesSO client
ashokaditya f74d611
rename
ashokaditya ebd1d20
test
ashokaditya 2bade23
Merge branch 'main' into task/edr-workflows-telemetry-rules-with-resp…
ashokaditya 6cbb4db
move task behind telemetry feature flag
ashokaditya 462bdef
fix types
ashokaditya 156c498
fix test
ashokaditya 51d5374
Merge branch 'main' into task/edr-workflows-telemetry-rules-with-resp…
ashokaditya 5bb1e84
fix types
ashokaditya 2cd4c87
review changes
ashokaditya 72453fd
fetch SOs from the correct index
ashokaditya a454389
update counter types
ashokaditya ac8a3f3
fix types
ashokaditya b70a845
Merge branch 'main' into task/edr-workflows-telemetry-rules-with-resp…
ashokaditya 450c7a6
update missing type changes
ashokaditya d30fd64
use `sendAsync`
ashokaditya 3831cbb
Merge branch 'main' into task/edr-workflows-telemetry-rules-with-resp…
ashokaditya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...plugins/security_solution/server/lib/telemetry/tasks/custom_response_actions_rule.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { loggingSystemMock } from '@kbn/core/server/mocks'; | ||
| import { createTelemetryCustomResponseActionRulesTaskConfig } from './custom_response_actions_rule'; | ||
| import { | ||
| createMockTelemetryEventsSender, | ||
| createMockTelemetryReceiver, | ||
| createMockTaskMetrics, | ||
| } from '../__mocks__'; | ||
|
|
||
| describe('security response actions rule task test', () => { | ||
| let logger: ReturnType<typeof loggingSystemMock.createLogger>; | ||
|
|
||
| beforeEach(() => { | ||
| logger = loggingSystemMock.createLogger(); | ||
| }); | ||
|
|
||
| test('security response actions rule task should fetch response actions rules data', async () => { | ||
| const testTaskExecutionPeriod = { | ||
| last: undefined, | ||
| current: new Date().toISOString(), | ||
| }; | ||
| const mockTelemetryEventsSender = createMockTelemetryEventsSender(); | ||
| const mockTelemetryReceiver = createMockTelemetryReceiver(); | ||
| const telemetryCustomResponseActionsRulesTaskConfig = | ||
| createTelemetryCustomResponseActionRulesTaskConfig(1); | ||
| const mockTaskMetrics = createMockTaskMetrics(); | ||
|
|
||
| await telemetryCustomResponseActionsRulesTaskConfig.runTask( | ||
| 'test-id', | ||
| logger, | ||
| mockTelemetryReceiver, | ||
| mockTelemetryEventsSender, | ||
| mockTaskMetrics, | ||
| testTaskExecutionPeriod | ||
| ); | ||
|
|
||
| expect(mockTelemetryReceiver.fetchResponseActionsRules).toHaveBeenCalled(); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.