From b340fe3f999b71b44973b48184eb3f3571e6922f Mon Sep 17 00:00:00 2001 From: JuanGarriuz Date: Mon, 27 Nov 2023 13:26:50 +0100 Subject: [PATCH 01/23] refine ui and remove wazuh prefix --- plugins/main/common/api-info/endpoints.json | 4 +- plugins/main/common/config-equivalences.js | 4 +- plugins/main/common/constants.ts | 2 +- plugins/main/common/wazuh-modules.ts | 2 +- .../add-modules-data/guides/audit.js | 90 ++++++----- .../add-modules-data/guides/cis-cat.js | 95 ++++++------ .../add-modules-data/guides/osquery.js | 76 +++++----- .../prompts/prompt-agent-never-connected.tsx | 2 +- .../health-check.container.test.tsx.snap | 4 +- .../container/health-check.container.tsx | 4 +- .../services/check-api.service.ts | 6 +- .../services/check-setup.service.ts | 75 ++++++---- .../overview/github-panel/views/stats.tsx | 130 ++++++++++++---- .../office-panel/views/office-stats.tsx | 141 +++++++++++++----- .../main/public/components/security/main.tsx | 6 +- .../__snapshots__/generalInfo.test.tsx.snap | 4 +- .../components/settings/about/generalInfo.tsx | 84 ++++++----- .../public/components/settings/api/add-api.js | 10 +- .../components/settings/api/api-is-down.js | 10 +- .../components/visualize/wz-visualize.js | 2 +- .../wz-blank-screen/wz-blank-screen.js | 10 +- .../controllers/agent/agents-preview.js | 2 +- .../main/public/controllers/agent/agents.js | 2 +- .../agent/components/agents-preview.js | 32 ---- .../agent/components/register-agent.js | 22 +-- .../server-address.test.tsx.snap | 2 +- .../register-agent/steps/server-address.tsx | 7 +- .../steps/wz-manager-address.tsx | 4 +- .../components/tools-welcome-cards.js | 12 +- .../public/controllers/dev-tools/dev-tools.ts | 2 +- .../configuration/cluster/cluster.js | 28 ++-- .../configuration/configuration-overview.js | 85 ++++++----- .../configuration/github/github.tsx | 12 +- .../components/general-tab/general-tab.tsx | 31 ++-- .../registration-service.js | 40 +++-- .../util-components/wz-api-not-reachable.js | 2 +- .../configuration/utils/wz-fetch.js | 2 +- .../components/management/mg-logs/logs.js | 2 +- .../management/status/status-agent-info.js | 20 ++- .../register-agent/containers/steps/steps.tsx | 9 +- .../core/register-commands/README.md | 138 +++++++++-------- .../utils/register-agent-data.tsx | 2 +- .../public/controllers/settings/settings.js | 2 +- .../public/react-services/error-handler.ts | 2 +- plugins/main/public/services/error-handler.js | 7 +- .../services/resolves/settings-wizard.js | 14 +- plugins/main/public/styles/common.scss | 135 +++++++++-------- plugins/main/public/utils/applications.ts | 24 +-- plugins/main/scripts/generate-api-data.js | 4 +- plugins/main/server/controllers/wazuh-api.ts | 16 +- .../main/server/controllers/wazuh-elastic.ts | 6 +- .../visualizations/cluster/monitoring.ts | 16 +- .../visualizations/cluster/statistics.ts | 46 +++--- .../visualizations/overview/overview-oscap.ts | 4 +- .../server/lib/cache-api-user-has-run-as.ts | 2 +- plugins/main/server/lib/error-response.ts | 6 +- .../server/start/cron-scheduler/apiRequest.ts | 6 +- .../cron-scheduler/scheduler-job.test.ts | 2 +- .../start/cron-scheduler/scheduler-job.ts | 2 +- plugins/main/server/start/initialize/index.ts | 6 +- plugins/main/server/start/monitoring/index.ts | 4 +- .../The-wazuh-admin-user-is-logged.given.js | 2 +- 62 files changed, 871 insertions(+), 652 deletions(-) diff --git a/plugins/main/common/api-info/endpoints.json b/plugins/main/common/api-info/endpoints.json index 440a61fcf6..000c6f6f45 100644 --- a/plugins/main/common/api-info/endpoints.json +++ b/plugins/main/common/api-info/endpoints.json @@ -1542,7 +1542,7 @@ { "name": "/cluster/:node_id/stats/analysisd", "documentation": "https://documentation.wazuh.com/4.8/user-manual/api/reference.html#operation/api.controllers.cluster_controller.get_stats_analysisd_node", - "description": "Return Wazuh analysisd statistical information in node {node_id}", + "description": "Return analysisd statistical information in node {node_id}", "summary": "Get node stats analysisd", "tags": ["Cluster"], "args": [ @@ -5044,7 +5044,7 @@ { "name": "/manager/stats/analysisd", "documentation": "https://documentation.wazuh.com/4.8/user-manual/api/reference.html#operation/api.controllers.manager_controller.get_stats_analysisd", - "description": "Return Wazuh analysisd statistical information", + "description": "Return analysisd statistical information", "summary": "Get stats analysisd", "tags": ["Manager"], "query": [ diff --git a/plugins/main/common/config-equivalences.js b/plugins/main/common/config-equivalences.js index e9c3a01bea..4abf0c08a6 100644 --- a/plugins/main/common/config-equivalences.js +++ b/plugins/main/common/config-equivalences.js @@ -3,7 +3,7 @@ import { ASSETS_PUBLIC_URL, PLUGIN_PLATFORM_NAME } from './constants'; export const configEquivalences = { pattern: "Default index pattern to use on the app. If there's no valid index pattern, the app will automatically create one with the name indicated in this option.", - 'customization.logo.app': `Set the name of the app logo stored at ${ASSETS_PUBLIC_URL}. It is used while the user is logging into Wazuh API.`, + 'customization.logo.app': `Set the name of the app logo stored at ${ASSETS_PUBLIC_URL}. It is used while the user is logging into the API.`, 'customization.logo.healthcheck': `Set the name of the health-check logo stored at ${ASSETS_PUBLIC_URL}`, 'customization.logo.reports': `Set the name of the reports logo (.png) stored at ${ASSETS_PUBLIC_URL}`, 'checks.pattern': @@ -23,7 +23,7 @@ export const configEquivalences = { 'ip.selector': 'Define if the user is allowed to change the selected index pattern directly from the top menu bar.', 'ip.ignore': - 'Disable certain index pattern names from being available in index pattern selector from the Wazuh app.', + 'Disable certain index pattern names from being available in index pattern selector from the app.', 'wazuh.monitoring.enabled': 'Enable or disable the wazuh-monitoring index creation and/or visualization.', 'wazuh.monitoring.frequency': diff --git a/plugins/main/common/constants.ts b/plugins/main/common/constants.ts index 26d3e79ae1..a1efefbf31 100644 --- a/plugins/main/common/constants.ts +++ b/plugins/main/common/constants.ts @@ -1108,7 +1108,7 @@ export const PLUGIN_SETTINGS: { [key: string]: TPluginSetting } = { }, 'customization.logo.app': { title: 'App main logo', - description: `This logo is used as loading indicator while the user is logging into Wazuh API`, + description: `This logo is used as loading indicator while the user is logging into API`, category: SettingCategory.CUSTOMIZATION, type: EpluginSettingType.filepicker, defaultValue: '', diff --git a/plugins/main/common/wazuh-modules.ts b/plugins/main/common/wazuh-modules.ts index 35b0221bfe..169383fa24 100644 --- a/plugins/main/common/wazuh-modules.ts +++ b/plugins/main/common/wazuh-modules.ts @@ -158,7 +158,7 @@ export const WAZUH_MODULES = { devTools: { title: 'API console', appId: 'api-console', - description: 'Test the Wazuh API endpoints.', + description: 'Test the API endpoints.', }, logtest: { title: 'Test your logs', diff --git a/plugins/main/public/components/add-modules-data/guides/audit.js b/plugins/main/public/components/add-modules-data/guides/audit.js index d7f54685bc..b5d4b31831 100644 --- a/plugins/main/public/components/add-modules-data/guides/audit.js +++ b/plugins/main/public/components/add-modules-data/guides/audit.js @@ -1,16 +1,16 @@ /* -* Wazuh app - System auditing interactive extension guide -* Copyright (C) 2015-2022 Wazuh, Inc. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* Find more information about this on the LICENSE file. -*/ + * Wazuh app - System auditing interactive extension guide + * Copyright (C) 2015-2022 Wazuh, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Find more information about this on the LICENSE file. + */ -import { webDocumentationLink } from "../../../../common/services/web_documentation"; +import { webDocumentationLink } from '../../../../common/services/web_documentation'; export default { id: 'audit', @@ -18,7 +18,9 @@ export default { xml_tag: 'localfile', description: 'Configuration options of the System auditing extension.', category: 'Auditing and policy monitoring', - documentation_link: webDocumentationLink('user-manual/reference/ossec-conf/localfile.html'), + documentation_link: webDocumentationLink( + 'user-manual/reference/ossec-conf/localfile.html', + ), icon: 'securityApp', avaliable_for_manager: true, avaliable_for_agent: true, @@ -29,50 +31,54 @@ export default { elements: [ { name: 'log_format', - description: 'Set the format of the log to be read. field is required', + description: + 'Set the format of the log to be read. field is required', type: 'input', required: true, placeholder: 'audit', default_value: 'audit', - field_read_only: true + field_read_only: true, }, { name: 'location', - description: 'Option to get the location of a log or a group of logs. strftime format strings may be used for log file names.', + description: + 'Option to get the location of a log or a group of logs. strftime format strings may be used for log file names.', type: 'input', required: true, placeholder: 'Log or group of logs location', default_value: '/var/log/audit/audit.log', - field_read_only: true + field_read_only: true, }, { name: 'command', - description: 'Given a command output, it will be read as one or more log messages depending on command or full_command is used.', + description: + 'Given a command output, it will be read as one or more log messages depending on command or full_command is used.', type: 'input', - placeholder: 'Any command line, optionally including arguments' + placeholder: 'Any command line, optionally including arguments', }, { name: 'alias', description: 'Change a command name in the log message.', type: 'input', - placeholder: 'Alias' + placeholder: 'Alias', }, { name: 'frequency', - description: 'Prevents a command from being executed in less time than the specified time (in seconds). This options can be used with command and full_command.', + description: + 'Prevents a command from being executed in less time than the specified time (in seconds). This options can be used with command and full_command.', type: 'input-number', values: { min: 1 }, default_value: '', placeholder: 'Frequency', - validate_error_message: 'Any positive number of seconds' + validate_error_message: 'Any positive number of seconds', }, { name: 'only-future-events', - description: `Set it to no to collect events generated since Wazuh agent was stopped. + description: `Set it to no to collect events generated since agent was stopped. By default, when Wazuh starts it will only read all log content from a given Windows Event Channel since the agent started. This feature is only compatible with eventchannel log format.`, type: 'switch', - default_value: true + default_value: true, }, // { //Not for log_format audit // name: 'query', @@ -94,14 +100,16 @@ export default { // }, { name: 'target', - description: 'Target specifies the name of the socket where the output will be redirected. The socket must be defined previously.', + description: + 'Target specifies the name of the socket where the output will be redirected. The socket must be defined previously.', type: 'input', default_value: 'agent', - placeholder: 'Any defined socket' + placeholder: 'Any defined socket', }, { name: 'out_format', - description: 'This option allows formatting logs from Logcollector using field substitution.', + description: + 'This option allows formatting logs from Logcollector using field substitution.', info: `log: Message from the log. json_escaped_log: Message from the log, escaping JSON reserver characters. output: Output from a command. Alias of log. @@ -112,24 +120,26 @@ export default { hostname: System’s host name. host_ip: Host’s primary IP address.`, type: 'input', - placeholder: 'Formatting logs from Logcollector using field substitution', + placeholder: + 'Formatting logs from Logcollector using field substitution', show_attributes: true, attributes: [ { name: 'target', - description: 'This option selects a defined target to apply the output format', + description: + 'This option selects a defined target to apply the output format', type: 'input', required: true, - placeholder: 'Any target defined in the option .' - } - ] + placeholder: 'Any target defined in the option .', + }, + ], }, { name: 'ignore_binaries', description: `This specifies to ignore binary files, testing if the file is UTF8 or ASCII. If this is set to yes and the file is, for example, a binary file, it will be discarded.`, info: 'On Windows agents, it will also check if the file is encoded with UCS-2 LE BOM or UCS-2 BE BOM.', - type: 'switch' + type: 'switch', }, { name: 'age', @@ -138,23 +148,23 @@ export default { type: 'input', placeholder: 'Time in format