Skip to content
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

[Attack Discovery][Scheduling] Add a new feature flag to hide scheduling feature (#12005) #213148

Merged
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 @@ -21,4 +21,5 @@ export type AssistantFeatureKey = keyof AssistantFeatures;
export const defaultAssistantFeatures = Object.freeze({
assistantModelEvaluation: false,
defendInsights: true,
assistantAttackDiscoverySchedulingEnabled: false,
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export type GetCapabilitiesResponse = z.infer<typeof GetCapabilitiesResponse>;
export const GetCapabilitiesResponse = z.object({
assistantModelEvaluation: z.boolean(),
defendInsights: z.boolean(),
assistantAttackDiscoverySchedulingEnabled: z.boolean(),
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ paths:
type: boolean
defendInsights:
type: boolean
assistantAttackDiscoverySchedulingEnabled:
type: boolean
required:
- assistantModelEvaluation
- defendInsights
- assistantAttackDiscoverySchedulingEnabled
'400':
description: Generic Error
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('AppContextService', () => {
appContextService.registerFeatures('super', {
assistantModelEvaluation: true,
defendInsights: true,
assistantAttackDiscoverySchedulingEnabled: true,
});
appContextService.stop();

Expand Down Expand Up @@ -106,6 +107,7 @@ describe('AppContextService', () => {
...defaultAssistantFeatures,
assistantModelEvaluation: true,
defendInsights: true,
assistantAttackDiscoverySchedulingEnabled: true,
};

appContextService.start(mockAppContext);
Expand All @@ -122,12 +124,14 @@ describe('AppContextService', () => {
...defaultAssistantFeatures,
assistantModelEvaluation: true,
defendInsights: true,
assistantAttackDiscoverySchedulingEnabled: true,
};
const pluginTwo = 'plugin2';
const featuresTwo: AssistantFeatures = {
...defaultAssistantFeatures,
assistantModelEvaluation: false,
defendInsights: false,
assistantAttackDiscoverySchedulingEnabled: false,
};

appContextService.start(mockAppContext);
Expand All @@ -144,11 +148,13 @@ describe('AppContextService', () => {
...defaultAssistantFeatures,
assistantModelEvaluation: true,
defendInsights: true,
assistantAttackDiscoverySchedulingEnabled: true,
};
const featuresTwo: AssistantFeatures = {
...defaultAssistantFeatures,
assistantModelEvaluation: false,
defendInsights: false,
assistantAttackDiscoverySchedulingEnabled: false,
};

appContextService.start(mockAppContext);
Expand All @@ -171,6 +177,7 @@ describe('AppContextService', () => {
const featuresSubset: Partial<AssistantFeatures> = {
assistantModelEvaluation: true,
defendInsights: true,
assistantAttackDiscoverySchedulingEnabled: true,
};

appContextService.start(mockAppContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ export const allowedExperimentalValues = Object.freeze({
*/
assistantModelEvaluation: false,

/**
* Enables the Attack Discovery Scheduling functionality and API endpoint`.
*/
assistantAttackDiscoverySchedulingEnabled: false,

/**
* Enables the Managed User section inside the new user details flyout.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ export class Plugin implements ISecuritySolutionPlugin {
plugins.elasticAssistant.registerTools(APP_UI_ID, assistantTools);
const features = {
assistantModelEvaluation: config.experimentalFeatures.assistantModelEvaluation,
assistantAttackDiscoverySchedulingEnabled:
config.experimentalFeatures.assistantAttackDiscoverySchedulingEnabled,
};
plugins.elasticAssistant.registerFeatures(APP_UI_ID, features);
plugins.elasticAssistant.registerFeatures('management', features);
Expand Down