Skip to content

Commit

Permalink
Implement embeddable dashboard on TSC (#6517)
Browse files Browse the repository at this point in the history
* feat(TSC): replace the dashboard on TSC application

* fix(tsc): fix ids dashboard panels

* fix(tsc): fix ids dashboards panels

* rename(tsc): rename dashboard files

* fix(tsc): add id to visualizations

* fix(TSC): fix dashboard

* fix: fix dashboards

* feat(tsc): use data source on Dashboard and Events tabs

* clean(tsc): cleaning unused statement

* fix(tsc): remove comment

* fix(tsc): add date range to Dashboard query

* remove(tsc): visualizations on server side

* feat(tsc): hide filter control on the search bar of dashboard

* feat(tsc): move sample data warning on the dashboard

---------

Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
  • Loading branch information
Desvelao and asteriscos committed May 13, 2024
1 parent 510714d commit d70976f
Show file tree
Hide file tree
Showing 13 changed files with 1,294 additions and 1,058 deletions.
1 change: 1 addition & 0 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export const DATA_SOURCE_FILTER_CONTROLLED_REGULATORY_COMPLIANCE_REQUIREMENT =
export const DATA_SOURCE_FILTER_CONTROLLED_PCI_DSS_EXIST = 'pci-dss-exist';
export const DATA_SOURCE_FILTER_CONTROLLED_VULNERABILITIES_RULE_GROUP =
'vulnerabilities-rule-group';
export const DATA_SOURCE_FILTER_CONTROLLED_TSC_EXIST = 'tsc-rule-exist';
export const DATA_SOURCE_FILTER_CONTROLLED_NIST_800_53_EXIST =
'nist-800-53-rule-exist';
export const DATA_SOURCE_FILTER_CONTROLLED_GDPR_EXIST = 'gdpr-rule-exist';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { tFilter } from '../../../index';
import { DATA_SOURCE_FILTER_CONTROLLED_TSC_EXIST } from '../../../../../../../common/constants';
import { AlertsDataSource } from '../alerts-data-source';

const KEY_EXIST = 'rule.tsc';

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

private getFilterExist() {
return [
{
meta: {
index: this.id,
negate: false,
disabled: false,
alias: null,
type: 'exists',
key: KEY_EXIST,
value: 'exists',
params: {
query: null,
type: 'phrase',
},
controlledBy: DATA_SOURCE_FILTER_CONTROLLED_TSC_EXIST,
},
exists: {
field: KEY_EXIST,
},
$state: {
store: 'appState',
},
} as tFilter,
];
}

getFixedFilters(): tFilter[] {
return [...this.getFilterExist(), ...super.getFixedFilters()];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './alerts-tsc-data-souce';
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export * from './alerts-virustotal';
export * from './alerts-malware-detection';
export * from './alerts-nist-800-53';
export * from './alerts-aws';
export * from './alerts-tsc';
export * from './vulnerabilities';
export * from './mitre-attack';
export * from './pci-dss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ 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 { DashboardTSC } from '../../overview/tsc/dashboards/dashboard';
import { DashboardGDPR } from '../../overview/gdpr/dashboards/dashboard';
import { DashboardPCIDSS } from '../../overview/pci/dashboards/dashboard';
import { DashboardDocker } from '../../overview/docker/dashboards';
Expand All @@ -66,6 +67,7 @@ import {
AlertsGoogleCloudDataSource,
AlertsMalwareDetectionDataSource,
AlertsFIMDataSource,
AlertsTSCDataSource,
AlertsNIST80053DataSource,
MitreAttackDataSource,
AlertsGDPRDataSource,
Expand Down Expand Up @@ -447,7 +449,26 @@ export const ModulesDefaults = {
},
tsc: {
init: 'dashboard',
tabs: RegulatoryComplianceTabs(tscColumns),
tabs: [
{
id: 'dashboard',
name: 'Dashboard',
buttons: [ButtonModuleExploreAgent, ButtonModuleGenerateReport],
component: DashboardTSC,
},
{
id: 'inventory',
name: 'Controls',
buttons: [ButtonModuleExploreAgent],
component: props => (
<ComplianceTable {...props} DataSource={AlertsTSCDataSource} />
),
},
renderDiscoverTab({
tableColumns: tscColumns,
DataSource: AlertsTSCDataSource,
}),
],
availableFor: ['manager', 'agent'],
},
syscollector: {
Expand Down

0 comments on commit d70976f

Please sign in to comment.