Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const createMockConfig = (): ConfigType => {
alertMergeStrategy: 'missingFields',
alertIgnoreFields: [],
maxUploadResponseActionFileBytes: 26214400,
disableEndpointRuleAutoInstall: false,
settings: getDefaultConfigSettings(),
experimentalFeatures: parseExperimentalConfigValue(enableExperimental).features,
enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ export const configSchema = schema.object({
defaultValue: 26214400, // 25MB,
max: 104857600, // 100MB,
}),
/**
* Disables the auto-install/enable of the Elastic Defend SIEM rule.
* Whenever a Policy is created via Fleet's API, we check if the corresponding Elastic Defend SIEM
* rule is installed/enabled in the active space, and if not, we auto-install it. Set this configuration
* setting to `false` to disable that behavior
*/
disableEndpointRuleAutoInstall: schema.boolean({ defaultValue: false }),

/**
* Defines the settings for a specific offering of the Security Solution app.
* They override the default values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import type {
} from './services/fleet/endpoint_fleet_services_factory';
import { EndpointFleetServicesFactory } from './services/fleet/endpoint_fleet_services_factory';
import { registerListsPluginEndpointExtensionPoints } from '../lists_integration';
import { EndpointError } from '../../common/endpoint/errors';
import type { EndpointAuthz } from '../../common/endpoint/types/authz';
import { calculateEndpointAuthz } from '../../common/endpoint/service/authz';
import type { FeatureUsageService } from './services/feature_usage/service';
Expand Down Expand Up @@ -446,4 +447,18 @@ export class EndpointAppContextService {
this.createLogger('ReferenceDataClient')
);
}

public getServerConfigValue<TKey extends keyof ConfigType = keyof ConfigType>(
key: TKey
): ConfigType[TKey] {
if (!this.startDependencies?.config) {
throw new EndpointAppContentServicesNotStartedError();
}

if (!Object.prototype.hasOwnProperty.call(this.startDependencies.config, key)) {
throw new EndpointError(`Missing config value for key: ${key}`);
}

return this.startDependencies.config[key];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const createMockEndpointAppContextService = (
})),
getSpaceId: jest.fn().mockReturnValue('default'),
getReferenceDataClient: jest.fn().mockReturnValue(referenceDataMocks.createClient()),
getServerConfigValue: jest.fn(),
} as unknown as jest.Mocked<EndpointAppContextService>;
};

Expand Down
Loading