Skip to content

Commit

Permalink
Add Vulnerabilities Detection and Office 365 links to agent menu on E…
Browse files Browse the repository at this point in the history
…ndpoints Summary (#6983)

* fix(agent-menu): add vulnerabilities detection

* fix(agent-menu): add Office 365 link

* fix: unsupported module definition by agent OS

- Fix vulnerabilities detection unsupported component by agent OS
- Replace the varible used to define the unsupported component for
  Docker
- Add unsupported module Office 365 to SunOS and "Others" OS
- Fix bug on the available options on the agent configuration report

* chore(changelog): add entries

* fix: documentation URL link
  • Loading branch information
Desvelao authored Sep 11, 2024
1 parent 1520c8e commit 67bcbe0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fixed an error on the command to deploy a new macOS agent that could cause the registration password had a wrong value because a `\n` could be included [#6906](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6906)
- Fixed rendering an active response as disabled when is active [#6901](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6901)
- Fixed an error on Dev Tools when using payload properties as arrays [#6908](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6908)
- Fixed missing link to Vulnerabilities detection and Office 365 in the agent menu of `Endpoints Summary` [#6983](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6983)
- Fixed missing options depending on agent operating system in the agent configuration report [#6983](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6983)

### Changed

Expand Down
9 changes: 2 additions & 7 deletions plugins/main/public/components/agents/export-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ import {
} from '@elastic/eui';

import PropTypes from 'prop-types';
import { UnsupportedComponents } from '../../utils/components-os-support';
import { WAZUH_AGENTS_OS_TYPE } from '../../../common/constants';
import { withErrorBoundary } from '../common/hocs';
import { hasAgentSupportModule } from '../../react-services';

export const ExportConfiguration = withErrorBoundary(
class ExportConfiguration extends Component {
Expand Down Expand Up @@ -57,11 +56,7 @@ export const ExportConfiguration = withErrorBoundary(
list.forEach((x, idx) => {
if (
typeof x === 'string' ||
(x.name &&
!(
UnsupportedComponents[this.props.agentPlatform] ||
UnsupportedComponents[WAZUH_AGENTS_OS_TYPE.OTHERS]
).includes(x.name))
(x.name && hasAgentSupportModule(this.props.agent, x.name))
) {
this.options.push({ id: `${idx}`, label: x.desc || x });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import { hasAgentSupportModule } from '../../../../../react-services/wz-agents';
import { WAZUH_MODULES_ID } from '../../../../../../common/constants';
import { docker as dockerApp } from '../../../../../utils/applications';

export default [
{
Expand Down Expand Up @@ -158,7 +159,7 @@ export default [
description:
'Monitor and collect the activity from Docker containers such as creation, running, starting, stopping or pausing events',
goto: 'docker-listener',
when: agent => hasAgentSupportModule(agent, WAZUH_MODULES_ID.DOCKER),
when: agent => hasAgentSupportModule(agent, dockerApp.id),
},
],
},
Expand Down
4 changes: 2 additions & 2 deletions plugins/main/public/utils/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const vulnerabilityDetection = {
euiIconType: 'heartbeatApp',
order: 301,
showInOverviewApp: true,
showInAgentMenu: false,
showInAgentMenu: true,
redirectTo: () =>
`/overview/?tab=vuls&tabView=dashboard${
store.getState()?.appStateReducers?.currentAgentData?.id
Expand Down Expand Up @@ -475,7 +475,7 @@ export const office365 = {
euiIconType: LogoOffice365,
order: 503,
showInOverviewApp: true,
showInAgentMenu: false,
showInAgentMenu: true,
redirectTo: () =>
`/overview/?tab=office&tabView=dashboard${
store.getState()?.appStateReducers?.currentAgentData?.id
Expand Down
26 changes: 22 additions & 4 deletions plugins/main/public/utils/components-os-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,29 @@
* Find more information about this on the LICENSE file.
*/
import { WAZUH_AGENTS_OS_TYPE, WAZUH_MODULES_ID } from '../../common/constants';
import { vulnerabilityDetection, docker, office365 } from './applications';

export const UnsupportedComponents = {
[WAZUH_AGENTS_OS_TYPE.LINUX]: [],
[WAZUH_AGENTS_OS_TYPE.WINDOWS]: [WAZUH_MODULES_ID.AUDITING, WAZUH_MODULES_ID.DOCKER, WAZUH_MODULES_ID.OPEN_SCAP],
[WAZUH_AGENTS_OS_TYPE.DARWIN]: [WAZUH_MODULES_ID.AUDITING, WAZUH_MODULES_ID.DOCKER, WAZUH_MODULES_ID.OPEN_SCAP],
[WAZUH_AGENTS_OS_TYPE.SUNOS]: [WAZUH_MODULES_ID.VULNERABILITIES],
[WAZUH_AGENTS_OS_TYPE.OTHERS]: [WAZUH_MODULES_ID.AUDITING, WAZUH_MODULES_ID.DOCKER, WAZUH_MODULES_ID.OPEN_SCAP, WAZUH_MODULES_ID.VULNERABILITIES]
[WAZUH_AGENTS_OS_TYPE.WINDOWS]: [
WAZUH_MODULES_ID.AUDITING,
docker.id,
WAZUH_MODULES_ID.OPEN_SCAP,
],
[WAZUH_AGENTS_OS_TYPE.DARWIN]: [
WAZUH_MODULES_ID.AUDITING,
docker.id,
WAZUH_MODULES_ID.OPEN_SCAP,
],
[WAZUH_AGENTS_OS_TYPE.SUNOS]: [vulnerabilityDetection.id, office365.id],
[WAZUH_AGENTS_OS_TYPE.OTHERS]: [
WAZUH_MODULES_ID.AUDITING,
docker.id,
WAZUH_MODULES_ID.OPEN_SCAP,
vulnerabilityDetection.id,
office365.id,
],
};

// Office 365 is only compatible with Linux, macOS and Windows
// https://documentation.wazuh.com/4.9/user-manual/reference/ossec-conf/office365-module.html#office365

0 comments on commit 67bcbe0

Please sign in to comment.