Skip to content

Commit

Permalink
Merge 4.5.1-7.16 into 4.5.2-7.16 (#5778)
Browse files Browse the repository at this point in the history
* Merge 4.5.0-7.16 into 4.5.1-7.16 (#5725)

* [Backport 4.5.0-7.16] Update test snapshots for 4.5 (#5604)

Update test snapshots for 4.5 (#5601)

* Add missing supported versions to the Docker environments (#5584)

feat(environments): add latest versions to Docker environments

- Add Kibana versions: 7.17.7, 7.17.8, 7.17.9 and 7.17.10
- Add OpenSearch: 2.6.0
- Add OpenSearch Dashboards: 2.6.0
- Add Wazuh 4.4.1, 4.4.2, 4.4.3 and 4.4.4

* Update test snapshost

* Update API data to 4.5

* Update branch patterns for GH Actions

---------

Co-authored-by: Antonio <[email protected]>
(cherry picked from commit 1ae5f19)

Co-authored-by: Álex Ruiz <[email protected]>

* Fix API reference links in endpoints.json

* Merge 4.4-7.16 into 4.5.0-7.16 (#5695)

Merge v4.4.5-7.16.0 into 4.4-7.16 (#5668)

* [Backport 4.4.5-7.16] Bump Wazuh and platform versions for v4.4.5 (#5639) (#5641)

* Bump Wazuh and platform versions for v4.4.5 (#5639)

* Update changelog

* Update opensearch_dashboards.json

* Update package.json

* Update readme

* Update tag script

(cherry picked from commit b33c4a5)

* Change tag.py version value

* Empty tag suffix

---------




* [Backport 4.4.5-7.16] Prepare tag.py for v4.4.5-rc1 (#5647)

Prepare tag.py for v4.4.5-rc1 (#5645)

Add -rc1 tag suffix

(cherry picked from commit c10eb4e)



* Add yarn.lock (#5653)

feat: add yarn.lock file

* [Backport 4.4.5-7.16] Update unit-test.yml (#5657)

Update unit-test.yml (#5655)

(cherry picked from commit 29ec6f9)



* [Backport 4.4.5-7.16] Add support for Wazuh 4.4.5-rc2 (#5661)

* Add support for Wazuh 4.4.5-rc2 (#5659)

(cherry picked from commit 1103a0c)

* Update revision of v4.4.5 in the Changelog

---------



* Bump v4.4.5-7.16.0-rc2

---------

Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Nicolas Agustin Guevara Pihen <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Álex Ruiz <[email protected]>

* [Backport 4.5.0-7.16] Update release utilities (#5716)

Update release utilities (#5677)

* feat: update release utilities to current process

- Add new bump script
- Port tag.py to NodeJS and allow receive parameters from stdin
- Add RELEASING.md file with information about the release process
  related to the usage of the included scripts
- Add release:bump and release:tag package scripts to run these process

* remove: remove scripts/tag.py and reference in the Makefile

* fix: fix help text in bump and tag scripts

* remove: remove stage and commit properties from the package.json

* remove: test related to stage property in the package.json

* fix: check if there are changes to commit in the tag script

- Code formatting
- Fix variable name

(cherry picked from commit e6caddc)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Álex Ruiz <[email protected]>
Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Nicolas Agustin Guevara Pihen <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>

* [Backport 4.5.1-7.16] Fix API request to get the manager labels and broken documentation link (#5731)

Fix API request to get the manager labels and broken documentation link (#5687)

* fix: broken documentation link

* changelog: add pull request entry

* fix: changed API endpoint to get the manager labels and managing the data to render

* changelog: add pull request entry

* changelog: fix entry

* changelog: fix entry

* Add response to imposter

---------

Co-authored-by: yenienserrano <[email protected]>
(cherry picked from commit 6a18172)

* [Backport 4.5.1-7.16] Fix server side query in pdf report filter (#5733)

* Backport 5714 to 7.16

* Added Changelog

* Add comments

* Fix deep clone filters

* Fix server side requirement query

* Fix rootkit filter

* [Backport 4.5.1-7.16] Update API data for 4.5.1 (#5760)

Update API data for 4.5.1 (#5758)

update: API data
(cherry picked from commit db9a2c7)

Co-authored-by: Antonio <[email protected]>

* [Backport 4.5.1-7.16] Fix outdated year in PDF report footer (#5767)

Fix outdated year in PDF report footer (#5766)

* Fix year in PDF footer

* Modify changelog

* Change tests to match the new value

* Change md5 in reporting test

* Change md5 in reporting test

* Revert accidental change

* Revert accidental change

* Fix md5 in test

* Change md5 in test

* Change md5 in test

(cherry picked from commit a997dcf)

Co-authored-by: Nicolas Agustin Guevara Pihen <[email protected]>

* Merge 4.5-7.16 into 4.5.1-7.16 (#5777)

* [Backport 4.5.0-7.16] Update test snapshots for 4.5 (#5604)

Update test snapshots for 4.5 (#5601)

* Add missing supported versions to the Docker environments (#5584)

feat(environments): add latest versions to Docker environments

- Add Kibana versions: 7.17.7, 7.17.8, 7.17.9 and 7.17.10
- Add OpenSearch: 2.6.0
- Add OpenSearch Dashboards: 2.6.0
- Add Wazuh 4.4.1, 4.4.2, 4.4.3 and 4.4.4

* Update test snapshost

* Update API data to 4.5

* Update branch patterns for GH Actions

---------

Co-authored-by: Antonio <[email protected]>
(cherry picked from commit 1ae5f19)

Co-authored-by: Álex Ruiz <[email protected]>

* Fix API reference links in endpoints.json

* Merge 4.4-7.16 into 4.5.0-7.16 (#5695)

Merge v4.4.5-7.16.0 into 4.4-7.16 (#5668)

* [Backport 4.4.5-7.16] Bump Wazuh and platform versions for v4.4.5 (#5639) (#5641)

* Bump Wazuh and platform versions for v4.4.5 (#5639)

* Update changelog

* Update opensearch_dashboards.json

* Update package.json

* Update readme

* Update tag script

(cherry picked from commit b33c4a5)

* Change tag.py version value

* Empty tag suffix

---------




* [Backport 4.4.5-7.16] Prepare tag.py for v4.4.5-rc1 (#5647)

Prepare tag.py for v4.4.5-rc1 (#5645)

Add -rc1 tag suffix

(cherry picked from commit c10eb4e)



* Add yarn.lock (#5653)

feat: add yarn.lock file

* [Backport 4.4.5-7.16] Update unit-test.yml (#5657)

Update unit-test.yml (#5655)

(cherry picked from commit 29ec6f9)



* [Backport 4.4.5-7.16] Add support for Wazuh 4.4.5-rc2 (#5661)

* Add support for Wazuh 4.4.5-rc2 (#5659)

(cherry picked from commit 1103a0c)

* Update revision of v4.4.5 in the Changelog

---------



* Bump v4.4.5-7.16.0-rc2

---------

Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Nicolas Agustin Guevara Pihen <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Álex Ruiz <[email protected]>

* [Backport 4.5.0-7.16] Update release utilities (#5716)

Update release utilities (#5677)

* feat: update release utilities to current process

- Add new bump script
- Port tag.py to NodeJS and allow receive parameters from stdin
- Add RELEASING.md file with information about the release process
  related to the usage of the included scripts
- Add release:bump and release:tag package scripts to run these process

* remove: remove scripts/tag.py and reference in the Makefile

* fix: fix help text in bump and tag scripts

* remove: remove stage and commit properties from the package.json

* remove: test related to stage property in the package.json

* fix: check if there are changes to commit in the tag script

- Code formatting
- Fix variable name

(cherry picked from commit e6caddc)

* Bump v4.5.0-7.16.0-alpha1

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Álex Ruiz <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: Nicolas Agustin Guevara Pihen <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>

---------

Co-authored-by: Antonio <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Álex Ruiz <[email protected]>
Co-authored-by: Nicolas Agustin Guevara Pihen <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>
  • Loading branch information
6 people authored Aug 11, 2023
1 parent 6b8c1f9 commit c252461
Show file tree
Hide file tree
Showing 25 changed files with 465 additions and 279 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ All notable changes to the Wazuh app project will be documented in this file.

- Fixed the rendering of tables that contains IPs and agent overview [#5471](https:/wazuh/wazuh-kibana-app/pull/5471)
- Fixed the agents active coverage stat as NaN in Details panel of Agents section [#5490](https:/wazuh/wazuh-kibana-app/pull/5490)
- Fixed a broken documentation link to agent labels [#5687](https:/wazuh/wazuh-kibana-app/pull/5687)
- Fixed the PDF report filters applied to tables [#5714](https:/wazuh/wazuh-kibana-app/pull/5714)
- Fixed outdated year in the PDF report footer [#5766](https:/wazuh/wazuh-kibana-app/pull/5766)

### Removed

Expand All @@ -27,6 +30,7 @@ All notable changes to the Wazuh app project will be documented in this file.

- Changed method to perform redirection on agent table buttons [#5539](https:/wazuh/wazuh-kibana-app/pull/5539)
- Changed windows agent service name in the deploy agent wizard [#5538](https:/wazuh/wazuh-kibana-app/pull/5538)
- Changed the requests to get the agent labels for the managers [#5687](https:/wazuh/wazuh-kibana-app/pull/5687)

## Wazuh v4.5.0 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 01

Expand Down
8 changes: 4 additions & 4 deletions common/api-info/endpoints.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export const ASSETS_PUBLIC_URL = '/plugins/wazuh/public/assets/';
// Reports
export const REPORTS_LOGO_IMAGE_ASSETS_RELATIVE_PATH = 'images/logo_reports.png';
export const REPORTS_PRIMARY_COLOR = '#256BD1';
export const REPORTS_PAGE_FOOTER_TEXT = 'Copyright © 2022 Wazuh, Inc.';
export const REPORTS_PAGE_FOOTER_TEXT = 'Copyright © 2023 Wazuh, Inc.';
export const REPORTS_PAGE_HEADER_TEXT = '[email protected]\nhttps://wazuh.com';

// Plugin platform
Expand Down
115 changes: 61 additions & 54 deletions common/services/settings.test.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,67 @@
import {
formatLabelValuePair,
formatSettingValueToFile,
getCustomizationSetting
} from "./settings";
formatLabelValuePair,
formatSettingValueToFile,
getCustomizationSetting,
} from './settings';

describe('[settings] Methods', () => {
describe('formatLabelValuePair: Format the label-value pairs used to display the allowed values', () => {
it.each`
label | value | expected
${'TestLabel'} | ${true} | ${'true (TestLabel)'}
${'true'} | ${true} | ${'true'}
`(
`label: $label | value: $value | expected: $expected`,
({ label, expected, value }) => {
expect(formatLabelValuePair(label, value)).toBe(expected);
},
);
});

describe('formatLabelValuePair: Format the label-value pairs used to display the allowed values', () => {
it.each`
label | value | expected
${'TestLabel'} | ${true} | ${'true (TestLabel)'}
${'true'} | ${true} | ${'true'}
`(`label: $label | value: $value | expected: $expected`, ({ label, expected, value }) => {
expect(formatLabelValuePair(label, value)).toBe(expected);
});
});
describe('formatSettingValueToFile: Format setting values to save in the configuration file', () => {
it.each`
input | expected
${'test'} | ${'"test"'}
${'test space'} | ${'"test space"'}
${'test\nnew line'} | ${'"test\\nnew line"'}
${''} | ${'""'}
${1} | ${1}
${true} | ${true}
${false} | ${false}
${['test1']} | ${'["test1"]'}
${['test1', 'test2']} | ${'["test1","test2"]'}
`(`input: $input | expected: $expected`, ({ input, expected }) => {
expect(formatSettingValueToFile(input)).toBe(expected);
});
});

describe('formatSettingValueToFile: Format setting values to save in the configuration file', () => {
it.each`
input | expected
${'test'} | ${'\"test\"'}
${'test space'} | ${'\"test space\"'}
${'test\nnew line'} | ${'\"test\\nnew line\"'}
${''} | ${'\"\"'}
${1} | ${1}
${true} | ${true}
${false} | ${false}
${['test1']} | ${'[\"test1\"]'}
${['test1', 'test2']} | ${'[\"test1\",\"test2\"]'}
`(`input: $input | expected: $expected`, ({ input, expected }) => {
expect(formatSettingValueToFile(input)).toBe(expected);
});
});

describe('getCustomizationSetting: Get the value for the "customization." settings depending on the "customization.enabled" setting', () => {
it.each`
customizationEnabled | settingKey | configValue | expected
${true} | ${'customization.logo.app'} | ${'custom-image-app.png'} | ${'custom-image-app.png'}
${true} | ${'customization.logo.app'} | ${''} | ${''}
${false} | ${'customization.logo.app'} | ${'custom-image-app.png'} | ${''}
${false} | ${'customization.logo.app'} | ${''} | ${''}
${true} | ${'customization.reports.footer'} | ${'Custom footer'} | ${'Custom footer'}
${true} | ${'customization.reports.footer'} | ${''} | ${'Copyright © 2022 Wazuh, Inc.'}
${false} | ${'customization.reports.footer'} | ${'Custom footer'} | ${'Copyright © 2022 Wazuh, Inc.'}
${false} | ${'customization.reports.footer'} | ${''} | ${'Copyright © 2022 Wazuh, Inc.'}
${false} | ${'customization.reports.footer'} | ${''} | ${'Copyright © 2022 Wazuh, Inc.'}
${true} | ${'customization.reports.header'} | ${'Custom header'} | ${'Custom header'}
${true} | ${'customization.reports.header'} | ${''} | ${'[email protected]\nhttps://wazuh.com'}
${false} | ${'customization.reports.header'} | ${'Custom header'} | ${'[email protected]\nhttps://wazuh.com'}
${false} | ${'customization.reports.header'} | ${''} | ${'[email protected]\nhttps://wazuh.com'}
`(`customizationEnabled: $customizationEnabled | settingKey: $settingKey | configValue: $configValue | expected: $expected`, ({ configValue, customizationEnabled, expected, settingKey }) => {
const configuration = {
'customization.enabled': customizationEnabled,
[settingKey]: configValue
};
expect(getCustomizationSetting(configuration, settingKey)).toBe(expected);
});
});
describe('getCustomizationSetting: Get the value for the "customization." settings depending on the "customization.enabled" setting', () => {
it.each`
customizationEnabled | settingKey | configValue | expected
${true} | ${'customization.logo.app'} | ${'custom-image-app.png'} | ${'custom-image-app.png'}
${true} | ${'customization.logo.app'} | ${''} | ${''}
${false} | ${'customization.logo.app'} | ${'custom-image-app.png'} | ${''}
${false} | ${'customization.logo.app'} | ${''} | ${''}
${true} | ${'customization.reports.footer'} | ${'Custom footer'} | ${'Custom footer'}
${true} | ${'customization.reports.footer'} | ${''} | ${'Copyright © 2023 Wazuh, Inc.'}
${false} | ${'customization.reports.footer'} | ${'Custom footer'} | ${'Copyright © 2023 Wazuh, Inc.'}
${false} | ${'customization.reports.footer'} | ${''} | ${'Copyright © 2023 Wazuh, Inc.'}
${false} | ${'customization.reports.footer'} | ${''} | ${'Copyright © 2023 Wazuh, Inc.'}
${true} | ${'customization.reports.header'} | ${'Custom header'} | ${'Custom header'}
${true} | ${'customization.reports.header'} | ${''} | ${'[email protected]\nhttps://wazuh.com'}
${false} | ${'customization.reports.header'} | ${'Custom header'} | ${'[email protected]\nhttps://wazuh.com'}
${false} | ${'customization.reports.header'} | ${''} | ${'[email protected]\nhttps://wazuh.com'}
`(
`customizationEnabled: $customizationEnabled | settingKey: $settingKey | configValue: $configValue | expected: $expected`,
({ configValue, customizationEnabled, expected, settingKey }) => {
const configuration = {
'customization.enabled': customizationEnabled,
[settingKey]: configValue,
};
expect(getCustomizationSetting(configuration, settingKey)).toBe(
expected,
);
},
);
});
});
15 changes: 15 additions & 0 deletions docker/imposter/agents/configuration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var path = context.request.path;
var pathConfiguration = path.split('/');
pathConfiguration.splice(0, 5);
console.log(pathConfiguration);
switch (pathConfiguration[0]) {
case 'labels':
respond()
.withStatusCode(200)
.withFile('agents/configuration/agent_labels.json');

break;
default:
respond().withStatusCode(200).withFile('agents/configuration/default.json');
break;
}
12 changes: 12 additions & 0 deletions docker/imposter/agents/configuration/agent_labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"data": {
"labels": [
{
"value": "customLabel",
"key": "custom",
"hidden": "no"
}
]
},
"error": 0
}
33 changes: 33 additions & 0 deletions docker/imposter/agents/configuration/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"data": {
"client": {
"config-profile": "ubuntu, ubuntu20, ubuntu20.04",
"notify_time": 10,
"time-reconnect": 60,
"force_reconnect_interval": 0,
"ip_update_interval": 0,
"auto_restart": "yes",
"remote_conf": "yes",
"crypto_method": "aes",
"server": [
{
"address": "nginx-lb/172.25.0.4",
"port": 1514,
"max_retries": 5,
"retry_interval": 10,
"protocol": "tcp"
}
],
"enrollment": [
{
"enabled": "yes",
"delay_after_enrollment": 20,
"port": 1515,
"ssl_cipher": "HIGH:!ADH:!EXP:!MD5:!RC4:!3DES:!CAMELLIA:@STRENGTH",
"auto_method": "no"
}
]
}
},
"error": 0
}
20 changes: 20 additions & 0 deletions docker/imposter/cluster/configuration/agent_labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"data": {
"affected_items": [
{
"labels": [
{
"value": "customLabel",
"key": "custom",
"hidden": "no"
}
]
}
],
"total_affected_items": 1,
"total_failed_items": 0,
"failed_items": []
},
"message": "Active configuration was successfully read in specified node.",
"error": 0
}
22 changes: 22 additions & 0 deletions docker/imposter/manager/configuration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var path = context.request.path;
var pathConfiguration = path.split('/');
pathConfiguration.splice(0, 4);
switch (pathConfiguration[0]) {
case 'labels':
respond()
.withStatusCode(200)
.withFile('manager/configuration/agent_labels.json');

break;
case 'reports':
respond()
.withStatusCode(200)
.withFile('manager/configuration/monitor_reports.json');

break;
default:
respond()
.withStatusCode(200)
.withFile('manager/configuration/default.json');
break;
}
20 changes: 20 additions & 0 deletions docker/imposter/manager/configuration/agent_labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"data": {
"affected_items": [
{
"labels": [
{
"value": "customLabel",
"key": "custom",
"hidden": "no"
}
]
}
],
"total_affected_items": 1,
"total_failed_items": 0,
"failed_items": []
},
"message": "Active configuration was successfully read in specified node.",
"error": 0
}
35 changes: 35 additions & 0 deletions docker/imposter/manager/configuration/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"data": {
"affected_items": [
{
"global": {
"email_notification": "no",
"logall": "no",
"logall_json": "no",
"integrity_checking": 8,
"rootkit_detection": 8,
"host_information": 8,
"prelude_output": "no",
"zeromq_output": "no",
"jsonout_output": "yes",
"alerts_log": "yes",
"stats": 4,
"memory_size": 8192,
"white_list": [
"127.0.0.1",
"80.58.61.250",
"80.58.61.254",
"localhost.localdomain"
],
"rotate_interval": 0,
"max_output_size": 0
}
}
],
"total_affected_items": 1,
"total_failed_items": 0,
"failed_items": []
},
"message": "Active configuration was successfully read in specified node",
"error": 0
}
16 changes: 16 additions & 0 deletions docker/imposter/manager/configuration/monitor_reports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"data": {
"affected_items": [{
"reports": [{
"category": "syscheck",
"title": "Daily report: File changes",
"email_to": "[email protected]"
}]
}],
"total_affected_items": 1,
"total_failed_items": 0,
"failed_items": []
},
"message": "Could not read active configuration in specified node",
"error": 0
}
6 changes: 6 additions & 0 deletions docker/imposter/wazuh-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ resources:
# Get active configuration
- method: GET
path: /agents/{agent_id}/config/{component}/{configuration}
response:
statusCode: 200
scriptFile: agents/configuration.js

# Remove agent from groups
- method: DELETE
Expand Down Expand Up @@ -501,6 +504,9 @@ resources:
# Get active configuration
- method: GET
path: /manager/configuration/{component}/{configuration}
response:
statusCode: 200
scriptFile: manager/configuration.js

# ===================================================== #
# MITRE
Expand Down
Loading

0 comments on commit c252461

Please sign in to comment.