From 1384ce13e92b1ce585b5a45003d877004cbfd3ca Mon Sep 17 00:00:00 2001 From: Kylie Meli Date: Thu, 3 Apr 2025 15:24:59 -0400 Subject: [PATCH] [Fleet] Add and setup new config `xpack.fleet.integrationsHomeOverride` for AI4DSOC (#216716) ## Summary Introduces a new fleet config variable to redirect from the integrations home page to a specified URL. The search_ai_lake serverless security product type will have its own page (`/app/security/configurations/integrations`) for browsing integrations and viewing installed integrations, so this ensures those users will only be able to see that dedicated page. ## Screen recordings AI4DSOC: https://github.com/user-attachments/assets/9fc203ed-f9c0-45bb-a4a9-2d07688b5ecd Otherwise: https://github.com/user-attachments/assets/50071467-b813-4f13-895f-435fd746adcc Relates: https://github.com/elastic/security-team/issues/11789 --- config/serverless.security.search_ai_lake.yml | 6 ++++-- .../test_suites/core_plugins/rendering.ts | 1 + .../plugins/shared/fleet/common/types/index.ts | 1 + .../sections/epm/screens/home/index.tsx | 14 +++++++++++++- .../platform/plugins/shared/fleet/server/config.ts | 2 ++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/config/serverless.security.search_ai_lake.yml b/config/serverless.security.search_ai_lake.yml index d4e9f1cf2305..05556a9d48f9 100644 --- a/config/serverless.security.search_ai_lake.yml +++ b/config/serverless.security.search_ai_lake.yml @@ -7,6 +7,8 @@ xpack.features.overrides: ### The following features are Security features hidden in Role management UI for this specific tier. securitySolutionTimeline.hidden: true securitySolutionNotes.hidden: true - + ## Agentless deployment by default -xpack.fleet.agentless.isDefault: true \ No newline at end of file +xpack.fleet.agentless.isDefault: true +# Override integrations home +xpack.fleet.integrationsHomeOverride: '/app/security/configurations/integrations' \ No newline at end of file diff --git a/src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts b/src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts index 5a8b7d3e6be1..40c5ffe10d28 100644 --- a/src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -266,6 +266,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.fleet.internal.fleetServerStandalone (boolean?)', 'xpack.fleet.internal.onlyAllowAgentUpgradeToKnownVersions (boolean?)', 'xpack.fleet.developer.maxAgentPoliciesWithInactivityTimeout (number?)', + 'xpack.fleet.integrationsHomeOverride (string?)', 'xpack.global_search.search_timeout (duration?)', 'xpack.global_search_bar.input_max_limit (number?)', 'xpack.graph.canEditDrillDownUrls (boolean?)', diff --git a/x-pack/platform/plugins/shared/fleet/common/types/index.ts b/x-pack/platform/plugins/shared/fleet/common/types/index.ts index 6d60cb88e628..502256eedd84 100644 --- a/x-pack/platform/plugins/shared/fleet/common/types/index.ts +++ b/x-pack/platform/plugins/shared/fleet/common/types/index.ts @@ -88,6 +88,7 @@ export interface FleetConfigType { autoUpgrades?: { retryDelays?: string[]; }; + integrationsHomeOverride?: string; } // Calling Object.entries(PackagesGroupedByStatus) gave `status: string` diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx index 8d1567f2fda3..8eb75156f9c4 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx @@ -15,7 +15,13 @@ import { INTEGRATIONS_ROUTING_PATHS, INTEGRATIONS_SEARCH_QUERYPARAM } from '../. import { DefaultLayout } from '../../../../layouts'; import { ExperimentalFeaturesService, isPackageUpdatable } from '../../../../services'; import { InstalledIntegrationsPage } from '../installed_integrations'; -import { useAuthz, useGetPackagesQuery, useGetSettingsQuery } from '../../../../hooks'; +import { + useAuthz, + useConfig, + useGetPackagesQuery, + useGetSettingsQuery, + useStartServices, +} from '../../../../hooks'; import type { CategoryFacet, ExtendedIntegrationCategory } from './category_facets'; @@ -42,6 +48,12 @@ export const categoryExists = (category: string, categories: CategoryFacet[]) => }; export const EPMHomePage: React.FC = () => { + const config = useConfig(); + const { application } = useStartServices(); + if (config.integrationsHomeOverride) { + application.navigateToUrl(config.integrationsHomeOverride); + } + const authz = useAuthz(); const isAuthorizedToFetchSettings = authz.fleet.readSettings; const { data: settings, isFetchedAfterMount: isSettingsFetched } = useGetSettingsQuery({ diff --git a/x-pack/platform/plugins/shared/fleet/server/config.ts b/x-pack/platform/plugins/shared/fleet/server/config.ts index e9ba8e8920dc..907cc84e9483 100644 --- a/x-pack/platform/plugins/shared/fleet/server/config.ts +++ b/x-pack/platform/plugins/shared/fleet/server/config.ts @@ -48,6 +48,7 @@ export const config: PluginConfigDescriptor = { activeAgentsSoftLimit: true, onlyAllowAgentUpgradeToKnownVersions: true, }, + integrationsHomeOverride: true, }, deprecations: ({ renameFromRoot, unused, unusedFromRoot }) => [ // Unused settings before Fleet server exists @@ -298,6 +299,7 @@ export const config: PluginConfigDescriptor = { retryDelays: schema.maybe(schema.arrayOf(schema.string())), }) ), + integrationsHomeOverride: schema.maybe(schema.string()), }, { validate: (configToValidate) => {