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 Docker module #6526

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ 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_DOCKER_RULE_GROUP =
'docker-rule-group';
export const DATA_SOURCE_FILTER_CONTROLLED_MITRE_ATTACK_RULE =
'mitre-attack-rule';
export const DATA_SOURCE_FILTER_CONTROLLED_MITRE_ATTACK_RULE_ID =
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_DOCKER_RULE_GROUP } from '../../../../../../../common/constants';
import { AlertsDataSource } from '../alerts-data-source';

const DOCKER_GROUP_KEY = 'rule.groups';
const DOCKER_GROUP_VALUE = 'docker';

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

getRuleGroupsFilter() {
return super.getRuleGroupsFilter(
DOCKER_GROUP_KEY,
DOCKER_GROUP_VALUE,
DATA_SOURCE_FILTER_CONTROLLED_DOCKER_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-docker-data-source';
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export * from './alerts-fim';
export * from './alerts-data-source-repository';
export * from './alerts-data-source';
export * from './alerts-docker';
export * from './alerts-virustotal';
export * from './alerts-malware-detection';
export * from './alerts-aws';
export * from './vulnerabilities';
Expand Down
14 changes: 12 additions & 2 deletions plugins/main/public/components/common/modules/modules-defaults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ 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 { DashboardDocker } from '../../overview/docker/dashboards';
import { DashboardMalwareDetection } from '../../overview/malware-detection/dashboard';
import { DashboardFIM } from '../../overview/fim/dashboard/dashboard';
import { MitreAttackDataSource } from '../data-source/pattern/alerts/mitre-attack/mitre-attack-data-source';
import {
AlertsDockerDataSource,
AlertsDataSource,
AlertsVulnerabilitiesDataSource,
AlertsAWSDataSource,
Expand Down Expand Up @@ -312,8 +314,16 @@ export const ModulesDefaults = {
docker: {
init: 'dashboard',
tabs: [
DashboardTab,
renderDiscoverTab(DEFAULT_INDEX_PATTERN, dockerColumns),
{
id: 'dashboard',
name: 'Dashboard',
buttons: [ButtonModuleExploreAgent, ButtonModuleGenerateReport],
component: DashboardDocker,
},
renderDiscoverTab({
tableColumns: dockerColumns,
DataSource: AlertsDockerDataSource,
}),
],
availableFor: ['manager', 'agent'],
},
Expand Down
Loading
Loading