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

Develop the logic of a new index for the FIM module. #6221

Closed
wants to merge 13 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ public/assets/custom/*

# Mac files
.DS_Store

#Vulnerabilities events injector config and data
scripts/vulnerabilities-events-injector/DIS_Settings.json
scripts/vulnerabilities-events-injector/generatedData.json
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ All notable changes to the Wazuh app project will be documented in this file.
- Added the ability to check if there are available updates from the UI. [#6093](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6093)
- Added remember server address check [#5791](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5791)
- Added the ssl_agent_ca configuration to the SSL Settings form [#6083](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6083)
- Added global vulnerabilities dashboards [#5896](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5896)
- Added global vulnerabilities dashboards [#5896](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5896) [#6179](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6179) [#6173](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6173) [#6147](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6147)
- Added an agent selector to the IT Hygiene application [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840)
- Added query results limit when the search exceed 10000 hits [#6106](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6106)
- Added a redirection button to Endpoint Summary from IT Hygiene application [6176](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6176)

### Changed

Expand All @@ -38,11 +39,16 @@ All notable changes to the Wazuh app project will be documented in this file.

- Fixed a problem with the agent menu header when the side menu is docked [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840)
- Fixed how the query filters apply on the Security Alerts table [#6102](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6102)
- Fixed exception in IT-Hygiene when an agent doesn't have policies [#6177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6177)
- Fixed exception in Inventory when agents don't have S.O. information [#6177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6177)
- Fixed pinned agent state in URL [#6177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6177)

### Removed

- Removed the `disabled_roles` and `customization.logo.sidebar` settings [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840)
- Removed the ability to configure the visibility of modules and removed `extensions.*` settings [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840)
- Removed the application menu in the IT Hygiene application [6176](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6176)
- Removed the implicit filter of WQL language of the search bar UI [#6174](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6174)

## Wazuh v4.7.1 - OpenSearch Dashboards 2.8.0 - Revision 01

Expand Down
1 change: 1 addition & 0 deletions docker/imposter/manager/version/check.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"data": {
"uuid": "7f828fd6-ef68-4656-b363-247b5861b84c",
"last_check_date": "2023-10-04T14:52:07.319561Z",
"current_version": "v4.8.0",
"update_check": true,
Expand Down
9 changes: 9 additions & 0 deletions plugins/main/common/config-equivalences.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const configEquivalences = {
'Define the index name prefix of sample alerts. It must match the template used by the index pattern to avoid unknown fields in dashboards.',
'vulnerabilities.pattern':
'Default index pattern to use for vulnerabilities.',
'fim.pattern': 'Default index pattern to use for fim.',
};

export const nameEquivalence = {
Expand Down Expand Up @@ -98,6 +99,8 @@ export const nameEquivalence = {
'alerts.sample.prefix': 'Sample alerts prefix',
'vulnerabilities.pattern': 'Index pattern',
'checks.vulnerabilities.pattern': 'Vulnerabilities index pattern',
'fim.pattern': 'Index pattern',
'checks.fim.pattern': 'Fim index pattern',
};

const HEALTH_CHECK = 'Health Check';
Expand All @@ -106,6 +109,7 @@ const SECURITY = 'Security';
const MONITORING = 'Monitoring';
const STATISTICS = 'Statistics';
const VULNERABILITIES = 'Vulnerabilities';
const FIM = 'Fim';
const CUSTOMIZATION = 'Logo Customization';
export const categoriesNames = [
HEALTH_CHECK,
Expand All @@ -114,6 +118,7 @@ export const categoriesNames = [
MONITORING,
STATISTICS,
VULNERABILITIES,
FIM,
CUSTOMIZATION,
];

Expand Down Expand Up @@ -153,6 +158,8 @@ export const categoriesEquivalence = {
'alerts.sample.prefix': GENERAL,
'vulnerabilities.pattern': VULNERABILITIES,
'checks.vulnerabilities.pattern': HEALTH_CHECK,
'fim.pattern': FIM,
'checks.fim.pattern': HEALTH_CHECK,
};

const TEXT = 'text';
Expand Down Expand Up @@ -226,4 +233,6 @@ export const formEquivalence = {
'alerts.sample.prefix': { type: TEXT },
'vulnerabilities.pattern': { type: TEXT },
'checks.vulnerabilities.pattern': { type: BOOLEAN },
'fim.pattern': { type: TEXT },
'checks.fim.pattern': { type: BOOLEAN },
};
32 changes: 32 additions & 0 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export const WAZUH_STATISTICS_DEFAULT_CRON_FREQ = '0 */5 * * * *';

// Wazuh vulnerabilities
export const WAZUH_VULNERABILITIES_PATTERN = 'wazuh-states-vulnerabilities';
export const WAZUH_INDEX_TYPE_VULNERABILITIES = 'vulnerabilities';

// Wazuh fim
export const WAZUH_FIM_PATTERN = 'wazuh-alerts-*';
export const WAZUH_INDEX_TYPE_FIM = 'fim';

// Job - Wazuh initialize
export const WAZUH_PLUGIN_PLATFORM_TEMPLATE_NAME = 'wazuh-kibana';
Expand Down Expand Up @@ -861,6 +866,33 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = {
return schema.boolean();
},
},
'checks.fim.pattern': {
title: 'Fim index pattern',
description:
'Enable or disable the fim index pattern health check when opening the app.',
category: SettingCategory.HEALTH_CHECK,
type: EpluginSettingType.switch,
defaultValue: true,
isConfigurableFromFile: true,
isConfigurableFromUI: true,
options: {
switch: {
values: {
disabled: { label: 'false', value: false },
enabled: { label: 'true', value: true },
},
},
},
uiFormTransformChangedInputValue: function (
value: boolean | string,
): boolean {
return Boolean(value);
},
validate: SettingsValidator.isBoolean,
validateBackend: function (schema) {
return schema.boolean();
},
},
'cron.prefix': {
title: 'Cron prefix',
description: 'Define the index prefix of predefined jobs.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
style="margin-right:4px;margin-top:0"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -486,8 +485,7 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
style="margin-left:4px;margin-top:0"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -820,8 +818,7 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
style="margin-right:4px"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -1207,8 +1204,7 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -1596,8 +1592,7 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -2131,8 +2126,7 @@ exports[`Inventory component A Linux agent should be well rendered. 1`] = `
style="margin-right:4px;margin-top:0"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -2498,8 +2492,7 @@ exports[`Inventory component A Linux agent should be well rendered. 1`] = `
style="margin-left:4px;margin-top:0"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -2851,8 +2844,7 @@ exports[`Inventory component A Linux agent should be well rendered. 1`] = `
style="margin-right:4px"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -3221,8 +3213,7 @@ exports[`Inventory component A Linux agent should be well rendered. 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -3594,8 +3585,7 @@ exports[`Inventory component A Linux agent should be well rendered. 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -4234,8 +4224,7 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
style="margin-right:4px;margin-top:0"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -4618,8 +4607,7 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
style="margin-left:4px;margin-top:0"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -4976,8 +4964,7 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
style="margin-right:4px"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -5360,8 +5347,7 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
style="margin-left:4px"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -5651,8 +5637,7 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down Expand Up @@ -6016,8 +6001,7 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="margin:12px 16px 12px 16px"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow wz-agent-inventory-panel"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive euiFlexGroup--wrap"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export { NetworkInterfacesTable } from './network-interfaces-table';
export { NetworkPortsTable } from './network-ports-table';
export { NetworkSettingsTable } from './network-settings-table';
export { PackagesTable } from './packages-table';
export { ProcessesTable } from './processes-table';
export { InventoryMetrics } from './syscollector-metrics';
export { WindowsUpdatesTable } from './windows-updates-table';
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import { EuiPanel } from '@elastic/eui';
import { SEARCH_BAR_WQL_VALUE_SUGGESTIONS_COUNT } from '../../../../../common/constants';
import { TableWzAPI } from '../../../common/tables';
import { WzRequest } from '../../../../react-services';
import { get as getLodash } from 'lodash';
import { netifaceColumns } from '../columns';

const sortFieldSuggestion = (a, b) => (a.label > b.label ? 1 : -1);

export const NetworkInterfacesTable = ({ agent }) => {
return (
<EuiPanel paddingSize='m' className='wz-agent-inventory-panel'>
<TableWzAPI
title='Network interfaces'
tableColumns={netifaceColumns}
tableInitialSortingField={netifaceColumns[0].field}
endpoint={`/syscollector/${agent.id}/netiface?select=${netifaceColumns
.map(({ field }) => field)
.join(',')}`}
searchTable
downloadCsv
showReload
tablePageSizeOptions={[10, 25, 50, 100]}
searchBarWQL={{
suggestions: {
field(currentValue) {
return netifaceColumns
.map(item => ({
label: item.field,
description: `filter by ${item.name}`,
}))
.sort(sortFieldSuggestion);
},
value: async (currentValue, { field }) => {
try {
const response = await WzRequest.apiReq(
'GET',
`/syscollector/${agent.id}/netiface`,
{
params: {
distinct: true,
limit: SEARCH_BAR_WQL_VALUE_SUGGESTIONS_COUNT,
select: field,
sort: `+${field}`,
...(currentValue
? { q: `${field}~${currentValue}` }
: {}),
},
},
);
return response?.data?.data.affected_items.map(item => ({
label: getLodash(item, field),
}));
} catch (error) {
return [];
}
},
},
}}
tableProps={{
tableLayout: 'auto',
}}
/>
</EuiPanel>
);
};
Loading
Loading