Skip to content

Commit

Permalink
Replace discover
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano committed Jan 9, 2024
1 parent c1329d8 commit 5b9402e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
27 changes: 16 additions & 11 deletions plugins/main/public/components/common/modules/modules-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ import ButtonModuleExploreAgent from '../../../controllers/overview/components/o
import { ButtonModuleGenerateReport } from '../modules/buttons';
import { OfficePanel } from '../../overview/office-panel';
import { GitHubPanel } from '../../overview/github-panel';
import { DashboardVuls, InventoryVuls } from '../../overview/vulnerabilities'
import { DashboardVuls, InventoryVuls } from '../../overview/vulnerabilities';
import { withModuleNotForAgent } from '../hocs';
import WazuhDiscover from '../wazuh-discover/wz-discover';
import { threatHuntingColumns } from '../wazuh-discover/config/data-grid-columns';
import { DashboardFim } from '../../overview/fim/dashboard/dashboard';
import { InventoryFim } from '../../overview/fim/inventory/inventory';
import React from 'react';
import { fileIntegrityMonitoringColumns } from '../../overview/fim/events/file-integrity-monitoring-columns';

const DashboardTab = {
id: 'dashboard',
Expand All @@ -36,21 +37,22 @@ const DashboardTab = {
const ALERTS_INDEX_PATTERN = 'wazuh-alerts-*';
const DEFAULT_INDEX_PATTERN = ALERTS_INDEX_PATTERN;

const renderDiscoverTab = (indexName = DEFAULT_INDEX_PATTERN, columns) => {
const renderDiscoverTab = (indexName = DEFAULT_INDEX_PATTERN, columns) => {
return {
id: 'events',
name: 'Events',
buttons: [ButtonModuleExploreAgent],
component: () =>
<WazuhDiscover indexPatternName={indexName} tableColumns={columns}/>,
}
component: () => (
<WazuhDiscover indexPatternName={indexName} tableColumns={columns} />
),
};
};

const EventsTab = {
id: 'events',
name: 'Events',
buttons: [ButtonModuleExploreAgent],
component: Events,
id: 'events',
name: 'Events',
buttons: [ButtonModuleExploreAgent],
component: Events,
};

const RegulatoryComplianceTabs = [
Expand All @@ -67,7 +69,10 @@ const RegulatoryComplianceTabs = [
export const ModulesDefaults = {
general: {
init: 'events',
tabs: [DashboardTab,renderDiscoverTab(DEFAULT_INDEX_PATTERN, threatHuntingColumns)],
tabs: [
DashboardTab,
renderDiscoverTab(DEFAULT_INDEX_PATTERN, threatHuntingColumns),
],
availableFor: ['manager', 'agent'],
},
fim: {
Expand All @@ -85,7 +90,7 @@ export const ModulesDefaults = {
buttons: [ButtonModuleExploreAgent],
component: InventoryFim,
},
EventsTab,
renderDiscoverTab(DEFAULT_INDEX_PATTERN, fileIntegrityMonitoringColumns),
],
availableFor: ['manager', 'agent'],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { tDataGridColumn } from '../../../common/data-grid';

export const fileIntegrityMonitoringColumns: tDataGridColumn[] = [
{
id: 'agent.name',
},
{
id: 'syscheck.path',
},
{
id: 'syscheck.event',
},
{
id: 'rule.description',
},
{
id: 'rule.level',
},
{
id: 'rule.id',
},
];

0 comments on commit 5b9402e

Please sign in to comment.