Skip to content

Commit 28c230d

Browse files
[EDR Workflows] Add dns event collection for macOS for Elastic Defend (#223566)
## Summary Adds `DNS` to Defend policy config: <img width="952" alt="image" src="https://github.com/user-attachments/assets/de5aabe2-544a-49ae-82c2-59f9ffbca8c4" /> There is no migration for existing policies. For new policies, it is enabled by default for - Complete EDR - Data Collection and disabled for other configs. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [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 --------- Co-authored-by: Elastic Machine <[email protected]>
1 parent 77038d3 commit 28c230d

File tree

7 files changed

+24
-6
lines changed

7 files changed

+24
-6
lines changed

x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const policyFactory = ({
9595
},
9696
mac: {
9797
events: {
98+
dns: true,
9899
process: true,
99100
file: true,
100101
network: true,

x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ describe('Policy Config helpers', () => {
100100
};
101101

102102
const macEvents: typeof defaultPolicy.mac.events = {
103+
dns: false,
103104
file: false,
104105
process: false,
105106
network: false,
@@ -370,7 +371,7 @@ const eventsOnlyPolicy = (): PolicyConfig => ({
370371
attack_surface_reduction: { credential_hardening: { enabled: false } },
371372
},
372373
mac: {
373-
events: { process: true, file: true, network: true, security: true },
374+
events: { dns: true, process: true, file: true, network: true, security: true },
374375
malware: { mode: ProtectionModes.off, blocklist: false, on_write_scan: false },
375376
behavior_protection: { mode: ProtectionModes.off, supported: true, reputation_service: false },
376377
memory_protection: { mode: ProtectionModes.off, supported: true },

x-pack/solutions/security/plugins/security_solution/common/endpoint/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ export interface PolicyConfig {
10331033
mac: {
10341034
advanced?: {};
10351035
events: {
1036+
dns: boolean;
10361037
file: boolean;
10371038
process: boolean;
10381039
network: boolean;

x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ describe('policy details: ', () => {
331331
},
332332
},
333333
mac: {
334-
events: { process: true, file: true, network: true, security: true },
334+
events: { dns: true, process: true, file: true, network: true, security: true },
335335
malware: { mode: 'prevent', blocklist: true, on_write_scan: true },
336336
behavior_protection: {
337337
mode: 'off',

x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Policy Mac Event Collection Card', () => {
4040

4141
expect(
4242
getByTestId(testSubj.optionsContainer).querySelectorAll('input[type="checkbox"]')
43-
).toHaveLength(4);
43+
).toHaveLength(5);
4444
expect(getByTestId(testSubj.fileCheckbox)).toBeChecked();
4545
expect(getByTestId(testSubj.networkCheckbox)).toBeChecked();
4646
expect(getByTestId(testSubj.processCheckbox)).toBeChecked();
@@ -63,8 +63,9 @@ describe('Policy Mac Event Collection Card', () => {
6363
'Event collection' +
6464
'Operating system' +
6565
'Mac ' +
66-
'4 / 4 event collections enabled' +
66+
'5 / 5 event collections enabled' +
6767
'Events' +
68+
'DNS' +
6869
'File' +
6970
'Process' +
7071
'Network' +
@@ -86,8 +87,9 @@ describe('Policy Mac Event Collection Card', () => {
8687
'Event collection' +
8788
'Operating system' +
8889
'Mac ' +
89-
'3 / 4 event collections enabled' +
90+
'4 / 5 event collections enabled' +
9091
'Events' +
92+
'DNS' +
9193
'File' +
9294
'Process' +
9395
'Network' +

x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ import { EventCollectionCard } from '../event_collection_card';
1313
import type { PolicyFormComponentCommonProps } from '../../types';
1414

1515
const OPTIONS: ReadonlyArray<EventFormOption<OperatingSystem.MAC>> = [
16+
{
17+
name: i18n.translate('xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.dns', {
18+
defaultMessage: 'DNS',
19+
}),
20+
protectionField: 'dns',
21+
},
1622
{
1723
name: i18n.translate('xpack.securitySolution.endpoint.policyDetailsConfig.mac.events.file', {
1824
defaultMessage: 'File',

x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ describe('Create Default Policy tests ', () => {
127127
};
128128
};
129129

130-
const defaultEventsDisabled = () => ({
130+
const defaultEventsDisabled = (): {
131+
linux: PolicyConfig['linux']['events'];
132+
mac: PolicyConfig['mac']['events'];
133+
windows: PolicyConfig['windows']['events'];
134+
} => ({
131135
linux: {
132136
process: false,
133137
file: false,
@@ -136,11 +140,14 @@ describe('Create Default Policy tests ', () => {
136140
tty_io: false,
137141
},
138142
mac: {
143+
dns: false,
139144
process: false,
140145
file: false,
141146
network: false,
147+
security: false,
142148
},
143149
windows: {
150+
credential_access: false,
144151
process: false,
145152
file: false,
146153
network: false,

0 commit comments

Comments
 (0)