Skip to content

Commit

Permalink
Implement embeddable dashboard on NIST 800-53 (#6515)
Browse files Browse the repository at this point in the history
* feat(NIST800-53): replace the dashboard on NIST 800-53 application

* fix(NIST800-53): fix ids dashboards panels

* fix: remove unused visualziation definition

* rename(nist800-53): rename dashboard files

* fix(nist800-53): add id to visualizations

* fix(nist): fix dashboard

* fix: fix dashboards

* feat(nist-800-53): use data source on Dashboard and Events tabs

* fix(nist): remove comment

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

* remove(nist): visualizations on server side

* feat(nist-800-53): hide filter control on the search bar of dashboard

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

* fix: import dashboard

---------

Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
  • Loading branch information
Desvelao and asteriscos authored May 13, 2024
1 parent 5a3ac2a commit 510714d
Show file tree
Hide file tree
Showing 13 changed files with 1,549 additions and 1,489 deletions.
2 changes: 2 additions & 0 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ 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_NIST_800_53_EXIST =
'nist-800-53-rule-exist';
export const DATA_SOURCE_FILTER_CONTROLLED_GDPR_EXIST = 'gdpr-rule-exist';
export const DATA_SOURCE_FILTER_CONTROLLED_HIPAA_EXIST = 'hipaa-rule-exist';
export const DATA_SOURCE_FILTER_CONTROLLED_DOCKER_RULE_GROUP =
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_NIST_800_53_EXIST } from '../../../../../../../common/constants';
import { AlertsDataSource } from '../alerts-data-source';

const KEY_EXIST = 'rule.nist_800_53';

export class AlertsNIST80053DataSource 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_NIST_800_53_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-nist-800-53-data-source';
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './alerts-hipaa';
export * from './alerts-docker';
export * from './alerts-virustotal';
export * from './alerts-malware-detection';
export * from './alerts-nist-800-53';
export * from './alerts-aws';
export * from './vulnerabilities';
export * from './mitre-attack';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { DashboardPCIDSS } from '../../overview/pci/dashboards/dashboard';
import { DashboardDocker } from '../../overview/docker/dashboards';
import { DashboardMalwareDetection } from '../../overview/malware-detection/dashboard';
import { DashboardFIM } from '../../overview/fim/dashboard/dashboard';
import { DashboardNIST80053 } from '../../overview/nist/dashboards/dashboard';
import { DashboardHIPAA } from '../../overview/hipaa/dashboards/dashboard';
import {
AlertsDockerDataSource,
Expand All @@ -65,6 +66,7 @@ import {
AlertsGoogleCloudDataSource,
AlertsMalwareDetectionDataSource,
AlertsFIMDataSource,
AlertsNIST80053DataSource,
MitreAttackDataSource,
AlertsGDPRDataSource,
AlertsConfigurationAssessmentDataSource,
Expand Down Expand Up @@ -397,7 +399,26 @@ export const ModulesDefaults = {
},
nist: {
init: 'dashboard',
tabs: RegulatoryComplianceTabs(nistColumns),
tabs: [
{
id: 'dashboard',
name: 'Dashboard',
buttons: [ButtonModuleExploreAgent, ButtonModuleGenerateReport],
component: DashboardNIST80053,
},
{
id: 'inventory',
name: 'Controls',
buttons: [ButtonModuleExploreAgent],
component: props => (
<ComplianceTable {...props} DataSource={AlertsNIST80053DataSource} />
),
},
renderDiscoverTab({
tableColumns: nistColumns,
DataSource: AlertsNIST80053DataSource,
}),
],
availableFor: ['manager', 'agent'],
},
gdpr: {
Expand Down
Loading

0 comments on commit 510714d

Please sign in to comment.