From 1ba9e2b4ad870a8fc2fc10f262b63118f5f9e38a Mon Sep 17 00:00:00 2001 From: Guido Modarelli Date: Wed, 22 Jan 2025 16:39:31 -0300 Subject: [PATCH] Add Threat Intelligence application implementation and registration --- .../threat-intelligence/threat-intelligence.ts | 16 ++++++++++++++++ plugins/wazuh-analysis/public/plugin.ts | 13 ++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/plugins/wazuh-analysis/public/applications/threat-intelligence/threat-intelligence.ts b/plugins/wazuh-analysis/public/applications/threat-intelligence/threat-intelligence.ts index b8d7ddc053..86e9503ee5 100644 --- a/plugins/wazuh-analysis/public/applications/threat-intelligence/threat-intelligence.ts +++ b/plugins/wazuh-analysis/public/applications/threat-intelligence/threat-intelligence.ts @@ -1,5 +1,11 @@ import { i18n } from '@osd/i18n'; +import { + App, + AppMountParameters, + CoreSetup, +} from 'opensearch-dashboards/public'; import { PLUGIN_ID } from '../../../common/constants'; +import { CATEGORY } from '../category'; export const THREAT_INTELLIGENCE_ID = 'threat_intelligence'; export const THREAT_INTELLIGENCE_TITLE = i18n.translate( @@ -15,3 +21,13 @@ export const THREAT_INTELLIGENCE_DESCRIPTION = i18n.translate( 'Collect and analyze information about potential threats to inform security decisions.', }, ); + +export const ThreatIntelligenceApp = (_core: CoreSetup): App => ({ + id: THREAT_INTELLIGENCE_ID, + title: THREAT_INTELLIGENCE_TITLE, + category: CATEGORY, + mount: + async (_params: AppMountParameters) => + // TODO: Implement the threat intelligence application + () => {}, +}); diff --git a/plugins/wazuh-analysis/public/plugin.ts b/plugins/wazuh-analysis/public/plugin.ts index 3c7ef9bfc8..5894e9cee0 100644 --- a/plugins/wazuh-analysis/public/plugin.ts +++ b/plugins/wazuh-analysis/public/plugin.ts @@ -31,6 +31,7 @@ import { THREAT_INTELLIGENCE_ID, THREAT_INTELLIGENCE_TITLE, THREAT_INTELLIGENCE_DESCRIPTION, + ThreatIntelligenceApp, } from './applications/threat-intelligence/threat-intelligence'; interface AnalysisSetupDependencies {} @@ -266,17 +267,7 @@ export class AnalysisPlugin private registerApps(core: CoreSetup) { const applications: App[] = [ EndpointSecurityApp(core), - { - id: THREAT_INTELLIGENCE_ID, - title: THREAT_INTELLIGENCE_TITLE, - category: CATEGORY, - mount: async (params: AppMountParameters) => { - // TODO: Implement the threat intelligence application - const { renderApp } = await import('./application'); - - return renderApp(params, {}); - }, - }, + ThreatIntelligenceApp(core), { id: SECURITY_OPERATIONS_ID, title: TRANSLATION_MESSAGES.SECURITY_OPERATIONS_TITLE,