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

Implement embeddable dashboard on FIM module #6609

Merged
1 change: 1 addition & 0 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export const DATA_SOURCE_FILTER_CONTROLLED_PINNED_AGENT = 'pinned-agent';
export const DATA_SOURCE_FILTER_CONTROLLED_CLUSTER_MANAGER = 'cluster-manager';
export const DATA_SOURCE_FILTER_CONTROLLED_VULNERABILITIES_RULE_GROUP =
'vulnerabilities-rule-group';
export const DATA_SOURCE_FILTER_CONTROLLED_FIM_RULE_GROUP = 'fim-rule-group';

// Wazuh links
export const WAZUH_LINK_GITHUB = 'https://github.com/wazuh';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { tFilter } from '../../../index';
import { DATA_SOURCE_FILTER_CONTROLLED_FIM_RULE_GROUP } from '../../../../../../../common/constants';
import { AlertsDataSource } from '../alerts-data-source';

const FIM_GROUP_KEY = 'rule.groups';
const FIM_GROUP_VALUE = 'syscheck';

export class AlertsFIMDataSource extends AlertsDataSource {
constructor(id: string, title: string) {
super(id, title);
}

getRuleGroupsFilter() {
return super.getRuleGroupsFilter(
FIM_GROUP_KEY,
FIM_GROUP_VALUE,
DATA_SOURCE_FILTER_CONTROLLED_FIM_RULE_GROUP,
);
}

getFixedFilters(): tFilter[] {
return [...this.getRuleGroupsFilter(), ...super.getFixedFilters()];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './alerts-fim-data-source';
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './alerts-vulnerabilities';
export * from './alerts-fim';
export * from './alerts-data-source-repository';
export * from './alerts-data-source';
export * from './alerts-data-source';
18 changes: 15 additions & 3 deletions plugins/main/public/components/common/modules/modules-defaults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ import { mitreAttackColumns } from '../../overview/mitre/events/mitre-attack-col
import { virustotalColumns } from '../../overview/virustotal/events/virustotal-columns';
import { malwareDetectionColumns } from '../../overview/malware-detection/events/malware-detection-columns';
import { WAZUH_VULNERABILITIES_PATTERN } from '../../../../common/constants';
import { AlertsVulnerabilitiesDataSource } from '../data-source';
import {
AlertsFIMDataSource,
AlertsVulnerabilitiesDataSource,
} from '../data-source';
import { DashboardFIM } from '../../overview/fim/dashboard/dashboard';

const ALERTS_INDEX_PATTERN = 'wazuh-alerts-*';
const DEFAULT_INDEX_PATTERN = ALERTS_INDEX_PATTERN;
Expand Down Expand Up @@ -89,14 +93,22 @@ export const ModulesDefaults = {
fim: {
init: 'dashboard',
tabs: [
DashboardTab,
{
id: 'dashboard',
name: 'Dashboard',
buttons: [ButtonModuleExploreAgent, ButtonModuleGenerateReport],
component: DashboardFIM,
},
{
id: 'inventory',
name: 'Inventory',
buttons: [ButtonModuleExploreAgent],
component: MainFim,
},
renderDiscoverTab(DEFAULT_INDEX_PATTERN, fileIntegrityMonitoringColumns),
renderDiscoverTab({
tableColumns: fileIntegrityMonitoringColumns,
DataSource: AlertsFIMDataSource,
}),
],
availableFor: ['manager', 'agent'],
},
Expand Down
Loading
Loading