From 61283ed4c33fafb91f6ec6aaacdf044bf92be8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chantal=20Bel=C3=A9n=20kelm?= <99441266+chantal-kelm@users.noreply.github.com> Date: Mon, 19 Dec 2022 14:12:37 -0300 Subject: [PATCH] Fix commands in the deploy new agent section (#4962) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix-commands-in-the-deploy-new-agent-section * CHANGELOG Co-authored-by: Álex --- CHANGELOG.md | 3 +- .../agent/components/register-agent.js | 1732 +++++++++++------ 2 files changed, 1115 insertions(+), 620 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fed91b84a3..a857693bcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed pagination to SCA table [#4653](https://github.com/wazuh/wazuh-kibana-app/issues/4653) - Fixed WAZUH_PROTOCOL param suggestion [#4849](https://github.com/wazuh/wazuh-kibana-app/pull/4849) - Raspbian OS, Ubuntu, Amazon Linux and Amazon Linux 2 commands in the wizard deploy agent now change when a different architecture is selected [#4876](https://github.com/wazuh/wazuh-kibana-app/pull/4876) [#4880](https://github.com/wazuh/wazuh-kibana-app/pull/4880) +- Fixed commands in the deploy new agent section(most of the commands are missing '-1') [#4962](https://github.com/wazuh/wazuh-kibana-app/pull/4962) - Fixed Inventory checks table filters by stats [#4999](https://github.com/wazuh/wazuh-kibana-app/pull/4999) - Fixed vulnerabilities default last scan date formatter [#4975](https://github.com/wazuh/wazuh-kibana-app/pull/4975) @@ -71,7 +72,7 @@ All notable changes to the Wazuh app project will be documented in this file. ### Fixed -- Wazuh.yml review: fixed link to web documentation, improved in-file documentation and fixed some grammatical errors. [#4378](https://github.com/wazuh/wazuh-kibana-app/pull/4378) [#4399](https://github.com/wazuh/wazuh-kibana-app/pull/4399) +- Wazuh.yml review: fixed link to web documentation, improved in-file documentation and fixed some grammatical errors. [#4378](https://github.com/wazuh/wazuh-kibana-app/pull/4378) [#4399](https://github.com/wazuh/wazuh-kibana-app/pull/4399) - Fixed an error during the generation of a group's report, if the request to the Wazuh API fails [#4350](https://github.com/wazuh/wazuh-kibana-app/pull/4350) - Fixed a problem with the group's report, when the group has no agents [#4350](https://github.com/wazuh/wazuh-kibana-app/pull/4350) - Fixed path in logo customization section [#4352](https://github.com/wazuh/wazuh-kibana-app/pull/4352) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 1cbc327079..d6714aff90 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -33,7 +33,7 @@ import { EuiProgress, EuiIcon, EuiSwitch, - EuiLink + EuiLink, } from '@elastic/eui'; import { WzRequest } from '../../../react-services/wz-request'; import { withErrorBoundary } from '../../../components/common/hocs'; @@ -41,17 +41,46 @@ import { UI_LOGGER_LEVELS } from '../../../../common/constants'; import { UI_ERROR_SEVERITIES } from '../../../react-services/error-orchestrator/types'; import { getErrorOrchestrator } from '../../../react-services/common-services'; import { webDocumentationLink } from '../../../../common/services/web_documentation'; -import { architectureButtons, architectureButtonsi386, architecturei386Andx86_64, versionButtonsRaspbian, versionButtonsSuse, versionButtonsOracleLinux, versionButtonFedora, architectureButtonsSolaris, architectureButtonsWithPPC64LE, architectureButtonsOpenSuse, architectureButtonsAix, architectureButtonsHpUx, versionButtonAmazonLinux, versionButtonsRedHat, versionButtonsCentos, architectureButtonsMacos, osButtons, versionButtonsDebian, versionButtonsUbuntu, versionButtonsWindows, versionButtonsMacOS, versionButtonsOpenSuse, versionButtonsSolaris, versionButtonsAix, versionButtonsHPUX } from '../wazuh-config' -import ServerAddress from '../register-agent/steps/server-address'; -import { getConnectionConfig, fetchClusterNodesOptions } from './register-agent-service' +import { + architectureButtons, + architectureButtonsi386, + architecturei386Andx86_64, + versionButtonsRaspbian, + versionButtonsSuse, + versionButtonsOracleLinux, + versionButtonFedora, + architectureButtonsSolaris, + architectureButtonsWithPPC64LE, + architectureButtonsOpenSuse, + architectureButtonsAix, + architectureButtonsHpUx, + versionButtonAmazonLinux, + versionButtonsRedHat, + versionButtonsCentos, + architectureButtonsMacos, + osButtons, + versionButtonsDebian, + versionButtonsUbuntu, + versionButtonsWindows, + versionButtonsMacOS, + versionButtonsOpenSuse, + versionButtonsSolaris, + versionButtonsAix, + versionButtonsHPUX, +} from '../wazuh-config'; +import ServerAddress from '../register-agent/steps/server-address'; +import { + getConnectionConfig, + fetchClusterNodesOptions, +} from './register-agent-service'; export const RegisterAgent = withErrorBoundary( - class RegisterAgent extends Component { constructor(props) { super(props); this.wazuhConfig = new WazuhConfig(); this.configuration = this.wazuhConfig.getConfig(); + this.addToVersion = '-1'; this.state = { status: 'incomplete', selectedOS: '', @@ -70,7 +99,7 @@ export const RegisterAgent = withErrorBoundary( udpProtocol: false, showPassword: false, showProtocol: true, - connectionSecure: true + connectionSecure: true, }; this.restartAgentCommand = { rpm: this.systemSelector(), @@ -79,7 +108,7 @@ export const RegisterAgent = withErrorBoundary( ubu: this.systemSelector(), oraclelinux: this.systemSelector(), macos: 'sudo /Library/Ossec/bin/wazuh-control start', - win: 'NET START WazuhSvc' + win: 'NET START WazuhSvc', }; } @@ -93,7 +122,10 @@ export const RegisterAgent = withErrorBoundary( let authInfo = await this.getAuthInfo(); const needsPassword = (authInfo.auth || {}).use_password === 'yes'; if (needsPassword) { - wazuhPassword = this.configuration['enrollment.password'] || authInfo['authd.pass'] || ''; + wazuhPassword = + this.configuration['enrollment.password'] || + authInfo['authd.pass'] || + ''; if (wazuhPassword) { hidePasswordInput = true; } @@ -154,16 +186,20 @@ export const RegisterAgent = withErrorBoundary( getEnrollDNSConfig = () => { let serverAddress = this.configuration['enrollment.dns'] || ''; this.setState({ defaultServerAddress: serverAddress }); - if(serverAddress){ + if (serverAddress) { this.setState({ udpProtocol: true }); - }else{ + } else { this.setState({ udpProtocol: false }); } - } + }; async getAuthInfo() { try { - const result = await WzRequest.apiReq('GET', '/agents/000/config/auth/auth', {}); + const result = await WzRequest.apiReq( + 'GET', + '/agents/000/config/auth/auth', + {}, + ); return (result.data || {}).data || {}; } catch (error) { this.setState({ gotErrorRegistrationServiceInfo: true }); @@ -181,28 +217,69 @@ export const RegisterAgent = withErrorBoundary( } systemSelector() { - if (this.state.selectedVersion === 'redhat7' || this.state.selectedVersion === 'amazonlinux2022' || this.state.selectedVersion === 'centos7' || this.state.selectedVersion === 'suse11' || this.state.selectedVersion === 'suse12' || this.state.selectedVersion === 'oraclelinux5' || this.state.selectedVersion === '22' || this.state.selectedVersion === 'amazonlinux2' || this.state.selectedVersion === 'debian8' || this.state.selectedVersion === 'debian9' || this.state.selectedVersion === 'debian10' || this.state.selectedVersion === 'busterorgreater' || this.state.selectedVersion === 'ubuntu15' || this.state.selectedVersion === 'ubuntu16' || this.state.selectedVersion === 'leap15') { + if ( + this.state.selectedVersion === 'redhat7' || + this.state.selectedVersion === 'amazonlinux2022' || + this.state.selectedVersion === 'centos7' || + this.state.selectedVersion === 'suse11' || + this.state.selectedVersion === 'suse12' || + this.state.selectedVersion === 'oraclelinux5' || + this.state.selectedVersion === '22' || + this.state.selectedVersion === 'amazonlinux2' || + this.state.selectedVersion === 'debian8' || + this.state.selectedVersion === 'debian9' || + this.state.selectedVersion === 'debian10' || + this.state.selectedVersion === 'busterorgreater' || + this.state.selectedVersion === 'ubuntu15' || + this.state.selectedVersion === 'ubuntu16' || + this.state.selectedVersion === 'leap15' + ) { return 'sudo systemctl daemon-reload\nsudo systemctl enable wazuh-agent\nsudo systemctl start wazuh-agent'; - } else if (this.state.selectedVersion === 'redhat5' || this.state.selectedVersion === 'redhat6' || this.state.selectedVersion === 'centos5' || this.state.selectedVersion === 'centos6' || this.state.selectedVersion === 'oraclelinux6' || this.state.selectedVersion === 'amazonlinux1' || this.state.selectedVersion === 'debian7' || this.state.selectedVersion === 'ubuntu14') { - return ('service wazuh-agent start'); + } else if ( + this.state.selectedVersion === 'redhat5' || + this.state.selectedVersion === 'redhat6' || + this.state.selectedVersion === 'centos5' || + this.state.selectedVersion === 'centos6' || + this.state.selectedVersion === 'oraclelinux6' || + this.state.selectedVersion === 'amazonlinux1' || + this.state.selectedVersion === 'debian7' || + this.state.selectedVersion === 'ubuntu14' + ) { + return 'service wazuh-agent start'; } } systemSelectorNet() { - if (this.state.selectedVersion === 'windowsxp' || this.state.selectedVersion === 'windows8') { - return ('update-rc.d wazuh-agent defaults && service wazuh-agent start'); + if ( + this.state.selectedVersion === 'windowsxp' || + this.state.selectedVersion === 'windows8' + ) { + return 'update-rc.d wazuh-agent defaults && service wazuh-agent start'; } } systemSelectorWazuhControlMacos() { - if (this.state.selectedVersion == 'sierra' || this.state.selectedVersion == 'highSierra' || this.state.selectedVersion == 'mojave' || this.state.selectedVersion == 'catalina' || this.state.selectedVersion == 'bigSur' || this.state.selectedVersion == 'monterrey' || this.state.selectedVersion == 'ventura') { - return ('/Library/Ossec/bin/wazuh-control start'); + if ( + this.state.selectedVersion == 'sierra' || + this.state.selectedVersion == 'highSierra' || + this.state.selectedVersion == 'mojave' || + this.state.selectedVersion == 'catalina' || + this.state.selectedVersion == 'bigSur' || + this.state.selectedVersion == 'monterrey' || + this.state.selectedVersion == 'ventura' + ) { + return '/Library/Ossec/bin/wazuh-control start'; } } systemSelectorWazuhControl() { - if (this.state.selectedVersion === 'solaris10' || this.state.selectedVersion === 'solaris11' || this.state.selectedVersion === '6.1 TL9' || this.state.selectedVersion === '11.31') { - return ('/var/ossec/bin/wazuh-control start'); + if ( + this.state.selectedVersion === 'solaris10' || + this.state.selectedVersion === 'solaris11' || + this.state.selectedVersion === '6.1 TL9' || + this.state.selectedVersion === '11.31' + ) { + return '/var/ossec/bin/wazuh-control start'; } } @@ -257,16 +334,20 @@ export const RegisterAgent = withErrorBoundary( async getGroups() { try { const result = await WzRequest.apiReq('GET', '/groups', {}); - return result.data.data.affected_items.map((item) => ({ label: item.name, id: item.name })); + return result.data.data.affected_items.map(item => ({ + label: item.name, + id: item.name, + })); } catch (error) { throw new Error(error); } } optionalDeploymentVariables() { - - let deployment = this.state.serverAddress && `WAZUH_MANAGER='${this.state.serverAddress}' `; - const protocol = false + let deployment = + this.state.serverAddress && + `WAZUH_MANAGER='${this.state.serverAddress}' `; + const protocol = false; if (this.state.selectedOS == 'win') { deployment += `WAZUH_REGISTRATION_SERVER='${this.state.serverAddress}' `; } @@ -281,7 +362,7 @@ export const RegisterAgent = withErrorBoundary( if (this.state.selectedGroup.length) { deployment += `WAZUH_AGENT_GROUP='${this.state.selectedGroup - .map((item) => item.label) + .map(item => item.label) .join(',')}' `; } @@ -295,7 +376,7 @@ export const RegisterAgent = withErrorBoundary( agentNameVariable() { let agentName = `WAZUH_AGENT_NAME='${this.state.agentName}' `; - if(this.state.selectedArchitecture && this.state.agentName !== '') { + if (this.state.selectedArchitecture && this.state.agentName !== '') { return agentName; } else { return ''; @@ -303,239 +384,270 @@ export const RegisterAgent = withErrorBoundary( } resolveRPMPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'redhat5-i386': - return `https://packages.wazuh.com/4.x/yum5/i386/wazuh-agent-${this.state.wazuhVersion}-1.el5.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum5/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.el5.i386.rpm`; case 'redhat5-x86_64': - return `https://packages.wazuh.com/4.x/yum5/x86_64/wazuh-agent-${this.state.wazuhVersion}-1.el5.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum5/x86_64/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.el5.x86_64.rpm`; case 'redhat6-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'redhat6-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'redhat6-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'redhat6-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'redhat7-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'redhat7-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'redhat7-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'redhat7-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'redhat7-powerpc': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.ppc64le.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; + } + } + + resolveAlpinePackage() { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { + case '3.12.12-i386': + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + case '3.12.12-aarch64': + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + case '3.12.12-x86_64': + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + case '3.12.12-armhf': + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + case '3.12.12-powerpc': + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + default: + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; } } resolveORACLELINUXPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'oraclelinux5-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'oraclelinux5-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'oraclelinux5-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'oraclelinux5-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'oraclelinux5-powerpc': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.ppc64le.rpm`; case 'oraclelinux6-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'oraclelinux6-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'oraclelinux6-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'oraclelinux6-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; } } resolveCENTPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'centos5-i386': - return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}.el5.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.el5.i386.rpm`; case 'centos5-x86_64': - return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}.el5.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.el5.x86_64.rpm`; case 'centos6-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'centos6-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'centos6-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'centos6-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'centos7-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'centos7-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'centos7-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'centos7-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'centos7-powerpc': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.ppc64le.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; } } resolveSUSEPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'suse11-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'suse11-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'suse12-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'suse12-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'suse12-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'suse12-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'suse12-powerpc': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.ppc64le.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; } } resolveFEDORAPachage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case '22-i386': - return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}-1.el5.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.el5.i386.rpm`; case '22-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case '22-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case '22-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case '22-powerpc': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.ppc64le.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; } } resolveAMAZONLPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'amazonlinux1-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'amazonlinux1-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'amazonlinux1-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'amazonlinux1-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'amazonlinux1-powerpc': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.ppc64le.rpm`; case 'amazonlinux2-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'amazonlinux2-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'amazonlinux2-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'amazonlinux2-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; case 'amazonlinux2-powerpc': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.ppc64le.rpm`; case 'amazonlinux2022-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.i386.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm`; case 'amazonlinux2022-aarch64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aarch64.rpm`; case 'amazonlinux2022-x86_64': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'amazonlinux2022-armhf': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.armv7hl.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; } } resolveDEBPackage() { switch (`${this.state.selectedArchitecture}`) { case 'i386': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_i386.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_i386.deb`; case 'aarch64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_arm64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_arm64.deb`; case 'armhf': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_armhf.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_armhf.deb`; case 'x86_64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb`; case 'powerpc': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}.ppc64el.deb`; default: - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb`; } } resolveRASPBIANPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'busterorgreater-i386': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_i386.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_i386.deb`; case 'busterorgreater-aarch64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_arm64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_arm64.deb`; case 'busterorgreater-armhf': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_armhf.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_armhf.deb`; case 'busterorgreater-x86_64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb`; case 'busterorgreater-powerpc': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64le.rpm`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}.ppc64el.deb`; default: - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb`; } } resolveUBUNTUPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'ubuntu14-i386': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_i386.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_i386.deb`; case 'ubuntu14-aarch64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_arm64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_arm64.deb`; case 'ubuntu14-armhf': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_armhf.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_armhf.deb`; case 'ubuntu14-x86_64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb`; case 'ubuntu15-i386': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_i386.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_i386.deb`; case 'ubuntu15-aarch64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_arm64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_arm64.deb`; case 'ubuntu15-armhf': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_armhf.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_armhf.deb`; case 'ubuntu15-x86_64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; - case 'ubuntu16-i386': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_i386.deb`; - case 'ubuntu16-aarch64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_arm64.deb`; - case 'ubuntu16-armhf': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_armhf.deb`; - case 'ubuntu16-x86_64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb`; default: - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb`; } } resolveOPENSUSEPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'leap15-x86_64': - return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; case 'leap15-ARM64': - return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm` + return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; } } - + resolveSOLARISPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case 'solaris10-i386': return `https://packages.wazuh.com/4.x/solaris/i386/10/wazuh-agent-${this.state.wazuhVersion}-sol10-i386.pkg`; case 'solaris10-sparc': @@ -543,27 +655,31 @@ export const RegisterAgent = withErrorBoundary( case 'solaris11-i386': return `https://packages.wazuh.com/4.x/solaris/i386/11/wazuh-agent-${this.state.wazuhVersion}-sol11-i386.p5p`; case 'solaris11-sparc': - return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent-${this.state.wazuhVersion}-sol11-sparc.p5p` + return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent-${this.state.wazuhVersion}-sol11-sparc.p5p`; default: return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent-${this.state.wazuhVersion}-sol11-sparc.p5p`; } } resolveAIXPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case '6.1 TL9-powerpc': - return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}.aix.ppc.rpm`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aix.ppc.rpm`; default: - return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}.aix.ppc.rpm`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aix.ppc.rpm`; } } resolveHPPackage() { - switch (`${this.state.selectedVersion}-${this.state.selectedArchitecture}`) { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { case '11.31-itanium2': - return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}-hpux-11v3-ia64.tar`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}-hpux-11v3-ia64.tar`; default: - return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}-hpux-11v3-ia64.tar`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}-hpux-11v3-ia64.tar`; } } @@ -595,8 +711,10 @@ export const RegisterAgent = withErrorBoundary( return this.resolveSUSEPackage(); case 'raspbian': return this.resolveRASPBIANPackage(); + case 'alpine': + return this.resolveAlpinePackage(); default: - return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm`; } } @@ -723,63 +841,67 @@ export const RegisterAgent = withErrorBoundary( } } render() { - const appVersionMajorDotMinor = this.state.wazuhVersion.split('.').slice(0, 2).join('.'); - const urlCheckConnectionDocumentation = webDocumentationLink('user-manual/agents/agent-connection.html', appVersionMajorDotMinor); + const appVersionMajorDotMinor = this.state.wazuhVersion + .split('.') + .slice(0, 2) + .join('.'); + const urlCheckConnectionDocumentation = webDocumentationLink( + 'user-manual/agents/agent-connection.html', + appVersionMajorDotMinor, + ); const textAndLinkToCheckConnectionDocumentation = (

To verify the connection with the Wazuh server, please follow this{' '} - + document.

); const missingOSSelection = this.checkMissingOSSelection(); - const agentName = ( this.setAgentName(event)} + onChange={event => this.setAgentName(event)} /> ); const groupInput = ( <> {!this.state.groups.length && ( <> - )} ); - - const agentGroup = ( - -

Select one or more existing groups

- { - this.setGroupName(group); - }} - isDisabled={!this.state.groups.length} - isClearable={true} - data-test-subj="demoComboBox" - /> -
- ) + +

Select one or more existing groups

+ { + this.setGroupName(group); + }} + isDisabled={!this.state.groups.length} + isClearable={true} + data-test-subj='demoComboBox' + /> +
+ ); const passwordInput = ( this.setWazuhPassword(event)} + onChange={event => this.setWazuhPassword(event)} /> ); @@ -789,181 +911,235 @@ export const RegisterAgent = withErrorBoundary( const customTexts = { rpmText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, centText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, - debText: `curl -so wazuh-agent-${this.state.wazuhVersion - }.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i ./wazuh-agent-${this.state.wazuhVersion - }.deb`, - ubuText: `curl -so wazuh-agent-${this.state.wazuhVersion - }.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i ./wazuh-agent-${this.state.wazuhVersion - }.deb`, - macosText: `curl -so wazuh-agent-${this.state.wazuhVersion - }.pkg https://packages.wazuh.com/4.x/macos/wazuh-agent-${this.state.wazuhVersion - }-1.pkg && sudo launchctl setenv ${this.optionalDeploymentVariables()}${this.agentNameVariable()}&& sudo installer -pkg ./wazuh-agent-${this.state.wazuhVersion - }.pkg -target /`, - winText: `Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-${this.state.wazuhVersion - }-1.msi -OutFile \${env:tmp}\\wazuh-agent-${this.state.wazuhVersion}.msi; msiexec.exe /i \${env:tmp}\\wazuh-agent-${this.state.wazuhVersion - }.msi /q ${this.optionalDeploymentVariables()}${this.agentNameVariable()}`, + debText: `curl -so wazuh-agent-${ + this.state.wazuhVersion + }.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i ./wazuh-agent-${ + this.state.wazuhVersion + }.deb`, + ubuText: `curl -so wazuh-agent-${ + this.state.wazuhVersion + }.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i ./wazuh-agent-${ + this.state.wazuhVersion + }.deb`, + macosText: `curl -so wazuh-agent-${ + this.state.wazuhVersion + }.pkg https://packages.wazuh.com/4.x/macos/wazuh-agent-${ + this.state.wazuhVersion + }-1.pkg && sudo launchctl setenv ${this.optionalDeploymentVariables()}${this.agentNameVariable()}&& sudo installer -pkg ./wazuh-agent-${ + this.state.wazuhVersion + }.pkg -target /`, + winText: `Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-${ + this.state.wazuhVersion + }-1.msi -OutFile \${env:tmp}\\wazuh-agent-${ + this.state.wazuhVersion + }.msi; msiexec.exe /i \${env:tmp}\\wazuh-agent-${ + this.state.wazuhVersion + }.msi /q ${this.optionalDeploymentVariables()}${this.agentNameVariable()}`, openText: `sudo rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()} zypper install -y ${this.optionalPackages()}`, - solText: `sudo curl -so ${this.optionalPackages()} && sudo ${this.agentNameVariable()}&& ${this.state.selectedVersion == 'solaris11' ? 'pkg install -g wazuh-agent.p5p wazuh-agent' : 'pkgadd -d wazuh-agent.pkg'}`, + solText: `sudo curl -so ${this.optionalPackages()} && sudo ${this.agentNameVariable()}&& ${ + this.state.selectedVersion == 'solaris11' + ? 'pkg install -g wazuh-agent.p5p wazuh-agent' + : 'pkgadd -d wazuh-agent.pkg' + }`, aixText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}rpm -ivh ${this.optionalPackages()}`, hpText: `cd / && sudo curl -so ${this.optionalPackages()} && sudo ${this.agentNameVariable()}groupadd wazuh && sudo useradd -G wazuh wazuh && sudo tar -xvf wazuh-agent.tar`, amazonlinuxText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, fedoraText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, oraclelinuxText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, suseText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, - raspbianText: `curl -so wazuh-agent-${this.state.wazuhVersion - }.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i ./wazuh-agent-${this.state.wazuhVersion - }.deb`, + raspbianText: `curl -so wazuh-agent-${ + this.state.wazuhVersion + }.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i ./wazuh-agent-${ + this.state.wazuhVersion + }.deb`, }; const field = `${this.state.selectedOS}Text`; const text = customTexts[field]; const language = this.getHighlightCodeLanguage(this.state.selectedOS); - const warningUpgrade = 'If the installer finds another Wazuh agent in the system, it will upgrade it preserving the configuration.' + const warningUpgrade = + 'If the installer finds another Wazuh agent in the system, it will upgrade it preserving the configuration.'; const windowsAdvice = this.state.selectedOS === 'win' && ( <> - -
    -
  • You will need administrator privileges to perform this installation.
  • -
  • PowerShell 3.0 or greater is required.
  • + +
      +
    • + + You will need administrator privileges to perform this + installation. + +
    • +
    • + PowerShell 3.0 or greater is required. +
    -

    Keep in mind you need to run this command in a Windows PowerShell terminal.

    +

    + Keep in mind you need to run this command in a Windows PowerShell + terminal. +

    ); - const restartAgentCommand = this.restartAgentCommand[this.state.selectedOS]; - const onTabClick = (selectedTab) => { + const restartAgentCommand = + this.restartAgentCommand[this.state.selectedOS]; + const onTabClick = selectedTab => { this.selectSYS(selectedTab.id); }; - const calloutErrorRegistrationServiceInfo = this.state.gotErrorRegistrationServiceInfo ? ( + const calloutErrorRegistrationServiceInfo = this.state + .gotErrorRegistrationServiceInfo ? ( ) : null; const guide = (
    - {(this.state.gotErrorRegistrationServiceInfo) ? ( + {this.state.gotErrorRegistrationServiceInfo ? ( - ) : (this.state.connectionSecure === true && this.state.udpProtocol === false) ? ( + ) : this.state.connectionSecure === true && + this.state.udpProtocol === false ? ( -

    - You can use this command to install and enroll the Wazuh agent in one or more hosts. -

    - - - {windowsAdvice} -
    - - {this.state.wazuhPassword && !this.state.showPassword ? this.obfuscatePassword(text) : text} - - - {(copy) => ( -
    -

    Copy command

    -
    - )} -
    -
    - {this.state.needsPassword && ( - this.setShowPassword(active)} +

    + You can use this command to install and enroll the Wazuh agent + in one or more hosts. +

    + - )} - -
    ) : (this.state.connectionSecure === false) ? - ( + + {windowsAdvice} +
    + + {this.state.wazuhPassword && !this.state.showPassword + ? this.obfuscatePassword(text) + : text} + + + {copy => ( +
    +

    + Copy command +

    +
    + )} +
    +
    + {this.state.needsPassword && ( + this.setShowPassword(active)} + /> + )} + + + ) : this.state.connectionSecure === false ? ( -

    - You can use this command to install and enroll the Wazuh agent in one or more hosts. -

    - - - - Warning: there's no secure protocol configured and agents will not be able to communicate with the manager. - - } - iconType="iInCircle" - /> - - {windowsAdvice} -
    - - {this.state.wazuhPassword && !this.state.showPassword ? this.obfuscatePassword(text) : text} - - - {(copy) => ( -
    -

    Copy command

    -
    - )} -
    -
    - {this.state.needsPassword && ( - this.setShowPassword(active)} +

    + You can use this command to install and enroll the Wazuh agent + in one or more hosts. +

    + - )} - -
    ) : ( - -

    - You can use this command to install and enroll the Wazuh agent in one or more hosts. -

    - + + Warning: there's no{' '} + + secure protocol configured + {' '} + and agents will not be able to communicate with the manager. + + } + iconType='iInCircle' + /> + + {windowsAdvice} +
    + + {this.state.wazuhPassword && !this.state.showPassword + ? this.obfuscatePassword(text) + : text} + + + {copy => ( +
    +

    + Copy command +

    +
    + )} +
    +
    + {this.state.needsPassword && ( + this.setShowPassword(active)} /> - - {windowsAdvice} -
    - - {this.state.wazuhPassword && !this.state.showPassword ? this.obfuscatePassword(text) : text} - - - {(copy) => ( -
    -

    Copy command

    -
    - )} -
    -
    - {this.state.needsPassword && ( - this.setShowPassword(active)} - /> - )} - -
    - )} + )} + + + ) : ( + +

    + You can use this command to install and enroll the Wazuh agent + in one or more hosts. +

    + + + {windowsAdvice} +
    + + {this.state.wazuhPassword && !this.state.showPassword + ? this.obfuscatePassword(text) + : text} + + + {copy => ( +
    +

    + Copy command +

    +
    + )} +
    +
    + {this.state.needsPassword && ( + this.setShowPassword(active)} + /> + )} + +
    + )}
    ); @@ -975,14 +1151,16 @@ export const RegisterAgent = withErrorBoundary( -
    +
    {this.systemSelector()} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1003,14 +1181,16 @@ export const RegisterAgent = withErrorBoundary( -
    +
    {this.systemSelector()} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1031,14 +1211,16 @@ export const RegisterAgent = withErrorBoundary( -
    +
    {this.systemSelectorNet()} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1059,14 +1241,16 @@ export const RegisterAgent = withErrorBoundary( -
    +
    {this.systemSelectorWazuhControlMacos()} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1087,14 +1271,16 @@ export const RegisterAgent = withErrorBoundary( -
    +
    {this.systemSelectorWazuhControl()} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1110,80 +1296,157 @@ export const RegisterAgent = withErrorBoundary( const buttonGroup = (legend, options, idSelected, onChange) => { return ( - ) - } + className={'osButtonsStyle'} + /> + ); + }; - const buttonGroupWithMessage = (legend, options, idSelected, onChange) => { + const buttonGroupWithMessage = ( + legend, + options, + idSelected, + onChange, + ) => { return ( <> - {this.state.selectedVersion == 'solaris10' || this.state.selectedVersion == 'solaris11' ? - Might require some extra installation steps. - - }> - : this.state.selectedVersion == '6.1 TL9' ? - Might require some extra installation steps. - - }> - : this.state.selectedVersion == '11.31' ? - Might require some extra installation steps. - - }> - : this.state.selectedVersion == 'debian7' || this.state.selectedVersion == 'debian8' || this.state.selectedVersion == 'debian9' || this.state.selectedVersion == 'debian10' ? - Might require some extra installation steps. - - }> - : ''} + {this.state.selectedVersion == 'solaris10' || + this.state.selectedVersion == 'solaris11' ? ( + + Might require some extra installation{' '} + + steps + + . + + } + > + ) : this.state.selectedVersion == '6.1 TL9' ? ( + + Might require some extra installation{' '} + + steps + + . + + } + > + ) : this.state.selectedVersion == '11.31' ? ( + + Might require some extra installation{' '} + + steps + + . + + } + > + ) : this.state.selectedVersion == 'debian7' || + this.state.selectedVersion == 'debian8' || + this.state.selectedVersion == 'debian9' || + this.state.selectedVersion == 'debian10' ? ( + + Might require some extra installation{' '} + + steps + + . + + } + > + ) : ( + '' + )} - ) - } + ); + }; const selectedVersionMac = (legend, options, idSelected, onChange) => { return ( - ) - } + className={'osButtonsStyleMac'} + /> + ); + }; - const onChangeServerAddress = async (selectedNodes) => { - if(selectedNodes.length === 0){ + const onChangeServerAddress = async selectedNodes => { + if (selectedNodes.length === 0) { this.setState({ serverAddress: '', udpProtocol: false, - connectionSecure: null - }) - }else{ + connectionSecure: null, + }); + } else { const nodeSelected = selectedNodes[0]; try { const remoteConfig = await getConnectionConfig(nodeSelected); this.setState({ serverAddress: remoteConfig.serverAddress, udpProtocol: remoteConfig.udpProtocol, - connectionSecure: remoteConfig.connectionSecure - }) - }catch(error){ + connectionSecure: remoteConfig.connectionSecure, + }); + } catch (error) { const options = { context: `${RegisterAgent.name}.onChangeServerAddress`, level: UI_LOGGER_LEVELS.ERROR, @@ -1200,352 +1463,583 @@ export const RegisterAgent = withErrorBoundary( this.setState({ serverAddress: nodeSelected.label, udpProtocol: false, - connectionSecure: false - }) + connectionSecure: false, + }); } } - - } - + }; const steps = [ { title: 'Choose the operating system', - children: ( - buttonGroup("Choose the Operating system", osButtons, this.state.selectedOS, (os) => this.selectOS(os)) + children: buttonGroup( + 'Choose the Operating system', + osButtons, + this.state.selectedOS, + os => this.selectOS(os), ), }, ...(this.state.selectedOS == 'rpm' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == 'redhat5' || this.state.selectedVersion == 'redhat6' ? buttonGroupWithMessage("Choose the version", versionButtonsRedHat, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsRedHat, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == 'redhat5' || + this.state.selectedVersion == 'redhat6' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsRedHat, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsRedHat, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'oraclelinux' ? [ - { - title: 'Choose the version', - children: ( - buttonGroup("Choose the version", versionButtonsOracleLinux, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: buttonGroup( + 'Choose the version', + versionButtonsOracleLinux, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'raspbian' ? [ - { - title: 'Choose the version', - children: ( - buttonGroup("Choose the version", versionButtonsRaspbian, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: buttonGroup( + 'Choose the version', + versionButtonsRaspbian, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'amazonlinux' ? [ - { - title: 'Choose the version', - children: ( - buttonGroup("Choose the version", versionButtonAmazonLinux, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: buttonGroup( + 'Choose the version', + versionButtonAmazonLinux, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'cent' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == 'centos5' || this.state.selectedVersion == 'centos6' ? buttonGroupWithMessage("Choose the version", versionButtonsCentos, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsCentos, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == 'centos5' || + this.state.selectedVersion == 'centos6' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsCentos, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsCentos, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'fedora' ? [ - { - title: 'Choose the version', - children: ( - buttonGroup("Choose the version", versionButtonFedora, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: buttonGroup( + 'Choose the version', + versionButtonFedora, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'deb' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == 'debian7' || this.state.selectedVersion == 'debian8' || this.state.selectedVersion == 'debian9' || this.state.selectedVersion == 'debian10' ? buttonGroupWithMessage("Choose the version", versionButtonsDebian, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsDebian, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == 'debian7' || + this.state.selectedVersion == 'debian8' || + this.state.selectedVersion == 'debian9' || + this.state.selectedVersion == 'debian10' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsDebian, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsDebian, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'ubu' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == 'ubuntu14' ? buttonGroupWithMessage("Choose the version", versionButtonsUbuntu, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsUbuntu, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == 'ubuntu14' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsUbuntu, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsUbuntu, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'win' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == 'windowsxp' ? buttonGroupWithMessage("Choose the version", versionButtonsWindows, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsWindows, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == 'windowsxp' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsWindows, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsWindows, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'macos' ? [ - { - title: 'Choose the version', - children: ( - selectedVersionMac("Choose the version", versionButtonsMacOS, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: selectedVersionMac( + 'Choose the version', + versionButtonsMacOS, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'suse' ? [ - { - title: 'Choose the version', - children: ( - selectedVersionMac("Choose the version", versionButtonsSuse, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: selectedVersionMac( + 'Choose the version', + versionButtonsSuse, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'open' ? [ - { - title: 'Choose the version', - children: ( - buttonGroup("Choose the version", versionButtonsOpenSuse, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: buttonGroup( + 'Choose the version', + versionButtonsOpenSuse, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'sol' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == 'solaris10' || this.state.selectedVersion == 'solaris11' ? buttonGroupWithMessage("Choose the version", versionButtonsSolaris, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsSolaris, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == 'solaris10' || + this.state.selectedVersion == 'solaris11' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsSolaris, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsSolaris, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'aix' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == '6.1 TL9' ? buttonGroupWithMessage("Choose the version", versionButtonsAix, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsAix, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == '6.1 TL9' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsAix, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsAix, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), ...(this.state.selectedOS == 'hp' ? [ - { - title: 'Choose the version', - children: ( - this.state.selectedVersion == '11.31' ? buttonGroupWithMessage("Choose the version", versionButtonsHPUX, this.state.selectedVersion, (version) => this.setVersion(version)) : buttonGroup("Choose the version", versionButtonsHPUX, this.state.selectedVersion, (version) => this.setVersion(version)) - ), - }, - ] + { + title: 'Choose the version', + children: + this.state.selectedVersion == '11.31' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonsHPUX, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonsHPUX, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] : []), - ...(this.state.selectedVersion == 'centos5' || this.state.selectedVersion == 'redhat5' || this.state.selectedVersion == 'oraclelinux5' || this.state.selectedVersion == 'suse11' + ...(this.state.selectedVersion == 'centos5' || + this.state.selectedVersion == 'redhat5' || + this.state.selectedVersion == 'oraclelinux5' || + this.state.selectedVersion == 'suse11' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architecturei386Andx86_64, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architecturei386Andx86_64, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), ...(this.state.selectedVersion == 'leap15' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtonsOpenSuse, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsOpenSuse, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), - ...(this.state.selectedVersion == 'centos6' || this.state.selectedVersion == 'oraclelinux6' || this.state.selectedVersion == 'amazonlinux1' || this.state.selectedVersion == 'redhat6' || this.state.selectedVersion == 'amazonlinux2022' || this.state.selectedVersion == 'debian7' || this.state.selectedVersion == 'debian8' || this.state.selectedVersion == 'ubuntu14' || this.state.selectedVersion == 'ubuntu15' || this.state.selectedVersion == 'ubuntu16' + ...(this.state.selectedVersion == 'centos6' || + this.state.selectedVersion == 'oraclelinux6' || + this.state.selectedVersion == 'amazonlinux1' || + this.state.selectedVersion == 'redhat6' || + this.state.selectedVersion == 'amazonlinux2022' || + this.state.selectedVersion == 'debian7' || + this.state.selectedVersion == 'debian8' || + this.state.selectedVersion == 'ubuntu14' || + this.state.selectedVersion == 'ubuntu15' || + this.state.selectedVersion == 'ubuntu16' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtons, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtons, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), - ...(this.state.selectedVersion == 'centos7' || this.state.selectedVersion == 'redhat7' || this.state.selectedVersion == 'amazonlinux2' || this.state.selectedVersion == 'suse12' || this.state.selectedVersion == '22' || this.state.selectedVersion == 'debian9' || this.state.selectedVersion == 'debian10' || this.state.selectedVersion == 'busterorgreater' + ...(this.state.selectedVersion == 'centos7' || + this.state.selectedVersion == 'redhat7' || + this.state.selectedVersion == 'amazonlinux2' || + this.state.selectedVersion == 'suse12' || + this.state.selectedVersion == '22' || + this.state.selectedVersion == 'debian9' || + this.state.selectedVersion == 'debian10' || + this.state.selectedVersion == 'busterorgreater' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtonsWithPPC64LE, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsWithPPC64LE, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), - ...(this.state.selectedVersion == 'windowsxp' || this.state.selectedVersion == 'windows8' + ...(this.state.selectedVersion == 'windowsxp' || + this.state.selectedVersion == 'windows8' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtonsi386, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsi386, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), - ...(this.state.selectedVersion == 'sierra' || this.state.selectedVersion == 'highSierra' || this.state.selectedVersion == 'mojave' || this.state.selectedVersion == 'catalina' || this.state.selectedVersion == 'bigSur' || this.state.selectedVersion == 'monterrey' || this.state.selectedVersion == 'ventura' + ...(this.state.selectedVersion == 'sierra' || + this.state.selectedVersion == 'highSierra' || + this.state.selectedVersion == 'mojave' || + this.state.selectedVersion == 'catalina' || + this.state.selectedVersion == 'bigSur' || + this.state.selectedVersion == 'monterrey' || + this.state.selectedVersion == 'ventura' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtonsMacos, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsMacos, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), - ...(this.state.selectedVersion == 'solaris10' || this.state.selectedVersion == 'solaris11' + ...(this.state.selectedVersion == 'solaris10' || + this.state.selectedVersion == 'solaris11' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtonsSolaris, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsSolaris, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), ...(this.state.selectedVersion == '6.1 TL9' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtonsAix, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsAix, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), ...(this.state.selectedVersion == '11.31' ? [ - { - title: 'Choose the architecture', - children: ( - buttonGroup("Choose the architecture", architectureButtonsHpUx, this.state.selectedArchitecture, (architecture) => this.setArchitecture(architecture)) - ), - }, - ] + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsHpUx, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] : []), { title: 'Wazuh server address', - children: - - , + children: ( + + + + ), }, ...(!(!this.state.needsPassword || this.state.hidePasswordInput) ? [ - { - title: 'Wazuh password', - children: {passwordInput}, - }, - ] + { + title: 'Wazuh password', + children: {passwordInput}, + }, + ] : []), { title: 'Assign a name and a group to the agent', - children: {agentName}{groupInput}{agentGroup}, + children: ( + + {agentName} + {groupInput} + {agentGroup} + + ), }, { title: 'Install and enroll the agent', - children: this.state.gotErrorRegistrationServiceInfo ? + children: this.state.gotErrorRegistrationServiceInfo ? ( calloutErrorRegistrationServiceInfo - : missingOSSelection.length ? ( - - ) : ( -
    {guide}
    - ), + ) : missingOSSelection.length ? ( + + ) : ( +
    {guide}
    + ), }, - ...(this.state.selectedOS == 'rpm' || this.state.selectedOS == 'cent' || this.state.selectedOS == 'suse' || this.state.selectedOS == 'fedora' || this.state.selectedOS == 'oraclelinux' || this.state.selectedOS == 'amazonlinux' || this.state.selectedOS == 'deb' || this.state.selectedOS == 'raspbian' || this.state.selectedOS == 'ubu' || this.state.selectedOS == 'win' || this.state.selectedOS == 'macos' || this.state.selectedOS == 'open' || this.state.selectedOS == 'sol' || this.state.selectedOS == 'aix' || this.state.selectedOS == 'hp' + ...(this.state.selectedOS == 'rpm' || + this.state.selectedOS == 'cent' || + this.state.selectedOS == 'suse' || + this.state.selectedOS == 'fedora' || + this.state.selectedOS == 'oraclelinux' || + this.state.selectedOS == 'amazonlinux' || + this.state.selectedOS == 'deb' || + this.state.selectedOS == 'raspbian' || + this.state.selectedOS == 'ubu' || + this.state.selectedOS == 'win' || + this.state.selectedOS == 'macos' || + this.state.selectedOS == 'open' || + this.state.selectedOS == 'sol' || + this.state.selectedOS == 'aix' || + this.state.selectedOS == 'hp' ? [ - { - title: 'Start the agent', - children: this.state.gotErrorRegistrationServiceInfo ? - calloutErrorRegistrationServiceInfo - : missingOSSelection.length ? ( + { + title: 'Start the agent', + children: this.state.gotErrorRegistrationServiceInfo ? ( + calloutErrorRegistrationServiceInfo + ) : missingOSSelection.length ? ( ) : ( ), - }, - ] + }, + ] : []), ...(!missingOSSelection.length && - this.state.selectedOS !== 'rpm' && - this.state.selectedOS !== 'deb' && - this.state.selectedOS !== 'cent' && - this.state.selectedOS !== 'ubu' && - this.state.selectedOS !== 'win' && - this.state.selectedOS !== 'macos' && - this.state.selectedOS !== 'open' && - this.state.selectedOS !== 'sol' && - this.state.selectedOS !== 'aix' && - this.state.selectedOS !== 'hp' && - this.state.selectedOS !== 'amazonlinux' && - this.state.selectedOS !== 'fedora' && - this.state.selectedOS !== 'oraclelinux' && - this.state.selectedOS !== 'suse' && - this.state.selectedOS !== 'raspbian' && - restartAgentCommand + this.state.selectedOS !== 'rpm' && + this.state.selectedOS !== 'deb' && + this.state.selectedOS !== 'cent' && + this.state.selectedOS !== 'ubu' && + this.state.selectedOS !== 'win' && + this.state.selectedOS !== 'macos' && + this.state.selectedOS !== 'open' && + this.state.selectedOS !== 'sol' && + this.state.selectedOS !== 'aix' && + this.state.selectedOS !== 'hp' && + this.state.selectedOS !== 'amazonlinux' && + this.state.selectedOS !== 'fedora' && + this.state.selectedOS !== 'oraclelinux' && + this.state.selectedOS !== 'suse' && + this.state.selectedOS !== 'raspbian' && + restartAgentCommand ? [ - { - title: 'Start the agent', - children: this.state.gotErrorRegistrationServiceInfo ? - calloutErrorRegistrationServiceInfo - : ( - + { + title: 'Start the agent', + children: this.state.gotErrorRegistrationServiceInfo ? ( + calloutErrorRegistrationServiceInfo + ) : ( + -
    +
    {restartAgentCommand} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1553,14 +2047,14 @@ export const RegisterAgent = withErrorBoundary( ), - }, - ] + }, + ] : []), ]; return (
    - + @@ -1574,18 +2068,18 @@ export const RegisterAgent = withErrorBoundary( {this.props.hasAgents() && ( this.props.addNewAgent(false)} - iconType="cross" + iconType='cross' > Close )} {!this.props.hasAgents() && ( this.props.reload()} - iconType="refresh" + iconType='refresh' > Refresh @@ -1596,7 +2090,7 @@ export const RegisterAgent = withErrorBoundary( {this.state.loading && ( <> - + @@ -1614,5 +2108,5 @@ export const RegisterAgent = withErrorBoundary(
    ); } - } -); \ No newline at end of file + }, +);