From e925506126dced5ddb84649aaf3ec30e4c2aeec1 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 12:13:07 -0300 Subject: [PATCH 01/34] command raspbian --- public/controllers/agent/components/register-agent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 75ea299c52..e6ded3bbc0 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -487,7 +487,7 @@ export const RegisterAgent = withErrorBoundary( case 'busterorgreater-x86_64': return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_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}.ppc64el.deb`; default: return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; } From 5570429a95269eaacd56c15c797bd9fd6760061b Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 10:44:48 -0300 Subject: [PATCH 02/34] accordion and alpine os --- .../agent/components/register-agent.js | 1531 +++++++++++------ .../agent/components/wz-accordion.tsx | 56 + .../controllers/agent/wazuh-config/index.ts | 140 +- 3 files changed, 1140 insertions(+), 587 deletions(-) create mode 100644 public/controllers/agent/components/wz-accordion.tsx diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index e6ded3bbc0..5b546f0a00 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -9,7 +9,7 @@ * * Find more information about this on the LICENSE file. */ -import React, { Component, Fragment } from 'react'; +import React, { Component, Fragment, useState } from 'react'; import { version } from '../../../../package.json'; import { WazuhConfig } from '../../../react-services/wazuh-config'; import { @@ -33,7 +33,8 @@ import { EuiProgress, EuiIcon, EuiSwitch, - EuiLink + EuiLink, + EuiAccordion, } from '@elastic/eui'; import { WzRequest } from '../../../react-services/wz-request'; import { withErrorBoundary } from '../../../components/common/hocs'; @@ -41,13 +42,42 @@ 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 './register-agent.scss' -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, + osPrincipalButtons, + 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 { WzAccordion, PrincipalButtonGroup } from './wz-accordion'; export const RegisterAgent = withErrorBoundary( - class RegisterAgent extends Component { constructor(props) { super(props); @@ -71,7 +101,8 @@ export const RegisterAgent = withErrorBoundary( udpProtocol: false, showPassword: false, showProtocol: true, - connectionSecure: true + connectionSecure: true, + isAccordionOpen: false, }; this.restartAgentCommand = { rpm: this.systemSelector(), @@ -80,7 +111,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', }; } @@ -94,7 +125,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; } @@ -152,19 +186,29 @@ export const RegisterAgent = withErrorBoundary( } } + // componentDidUpdate() { + // if (this.state.selectedOS == 'macos') { + // this.setVersion('sierra'); + // } + // } + 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 }); @@ -173,6 +217,14 @@ export const RegisterAgent = withErrorBoundary( } selectOS(os) { + if (os == 'macos') { + this.setState({ + selectedOS: os, + selectedVersion: 'sierra', + selectedArchitecture: '', + selectedSYS: '', + }); + } this.setState({ selectedOS: os, selectedVersion: '', @@ -182,28 +234,61 @@ 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') { + 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'; } } @@ -258,16 +343,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}' `; } @@ -282,7 +371,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(',')}' `; } @@ -296,7 +385,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 ''; @@ -304,7 +393,9 @@ 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`; case 'redhat5-x86_64': @@ -333,7 +424,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; case 'oraclelinux5-aarch64': @@ -358,7 +451,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; case 'centos5-x86_64': @@ -387,7 +482,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; case 'suse11-x86_64': @@ -408,7 +505,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; case '22-aarch64': @@ -425,7 +524,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; case 'amazonlinux1-aarch64': @@ -477,7 +578,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; case 'busterorgreater-aarch64': @@ -494,7 +597,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; case 'ubuntu14-aarch64': @@ -525,18 +630,22 @@ export const RegisterAgent = withErrorBoundary( } 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`; 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}.armv7hl.rpm`; default: return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.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': @@ -544,14 +653,16 @@ 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`; default: @@ -560,7 +671,9 @@ export const RegisterAgent = withErrorBoundary( } 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`; default: @@ -723,64 +836,69 @@ export const RegisterAgent = withErrorBoundary( return 'bash'; } } + 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)} /> ); @@ -790,181 +908,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)} + /> + )} + +
    + )}
    ); @@ -976,14 +1148,16 @@ export const RegisterAgent = withErrorBoundary( -
    +
    {this.systemSelector()} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1111,80 +1293,158 @@ 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 ( - ) - } + onChange={onChange} + 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, @@ -1201,352 +1461,579 @@ 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)) + 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' ? [ - { - 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 +

    )} @@ -1554,14 +2041,14 @@ export const RegisterAgent = withErrorBoundary( ), - }, - ] + }, + ] : []), ]; return (
    - + @@ -1575,18 +2062,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 @@ -1597,7 +2084,7 @@ export const RegisterAgent = withErrorBoundary( {this.state.loading && ( <> - + @@ -1615,5 +2102,5 @@ export const RegisterAgent = withErrorBoundary(
    ); } - } -); \ No newline at end of file + }, +); diff --git a/public/controllers/agent/components/wz-accordion.tsx b/public/controllers/agent/components/wz-accordion.tsx new file mode 100644 index 0000000000..fbe80402dc --- /dev/null +++ b/public/controllers/agent/components/wz-accordion.tsx @@ -0,0 +1,56 @@ +import React, { useState } from 'react'; +import { + EuiPanel, + EuiSpacer, + EuiAccordion, + EuiButtonGroup, + htmlIdGenerator, +} from '@elastic/eui'; +import { osButtons } from '../wazuh-config'; + +export const PrincipalButtonGroup = ({ + legend, + options, + idSelected, + onChange, +}) => { + return ( + <> + + + + + + + ); +}; + +export const WzAccordion = ({ children }) => { + const [isAccordionOpen, setIsAccordionOpen] = useState(false); + const rightArrowAccordionId = htmlIdGenerator('wz-accordion')(); + return ( + setIsAccordionOpen(isOpen)} + > + + {children} + + ); +}; diff --git a/public/controllers/agent/wazuh-config/index.ts b/public/controllers/agent/wazuh-config/index.ts index 964c60c004..c6ff4843e5 100644 --- a/public/controllers/agent/wazuh-config/index.ts +++ b/public/controllers/agent/wazuh-config/index.ts @@ -40,12 +40,11 @@ const architectureButtonsWithPPC64LE = [ }, ]; - const architectureButtonsi386 = [ { id: 'i386', label: 'i386', - } + }, ]; const architecturei386Andx86_64 = [ @@ -67,19 +66,19 @@ const architectureButtonsSolaris = [ { id: 'sparc', label: 'SPARC', - } + }, ]; const architectureButtonsMacos = [ { id: 'intel', - label: 'Intel' + label: 'Intel', }, { id: 'applesilicon', - label: 'Apple Silicon' - } -] + label: 'Apple Silicon', + }, +]; const architectureButtonsOpenSuse = [ { @@ -89,21 +88,21 @@ const architectureButtonsOpenSuse = [ { id: 'ARM64', label: 'ARM64', - } + }, ]; const architectureButtonsAix = [ { id: 'powerpc', label: 'PowerPC', - } + }, ]; const architectureButtonsHpUx = [ { id: 'itanium2', label: 'Itanium2', - } + }, ]; const versionButtonAmazonLinux = [ @@ -118,8 +117,8 @@ const versionButtonAmazonLinux = [ { id: 'amazonlinux2022', label: 'Amazon Linux 2022', - } -] + }, +]; const versionButtonsRedHat = [ { @@ -167,15 +166,15 @@ const versionButtonsDebian = [ { id: 'debian10', label: 'Debian 10 or higher', - } + }, ]; const versionButtonFedora = [ { id: '22', - label: 'Fedora 22 or later' - } -] + label: 'Fedora 22 or higher', + }, +]; const versionButtonsUbuntu = [ { @@ -189,7 +188,7 @@ const versionButtonsUbuntu = [ { id: 'ubuntu16', label: 'Ubuntu 16 or higher', - } + }, ]; const versionButtonsWindows = [ @@ -200,7 +199,7 @@ const versionButtonsWindows = [ { id: 'windows8', label: 'Windows 8 or higher', - } + }, ]; const versionButtonsSuse = [ @@ -211,36 +210,13 @@ const versionButtonsSuse = [ { id: 'suse12', label: 'SUSE 12', - } + }, ]; const versionButtonsMacOS = [ { id: 'sierra', - label: 'macOS Sierra', - }, - { - id: 'highSierra', - label: 'macOS High Sierra', - }, - { - id: 'mojave', - label: 'macOS Mojave', - }, - { - id: 'catalina', - label: 'macOS Catalina', - }, - { - id: 'bigSur', - label: 'macOS Big Sur', - }, - { - id: 'monterrey', - label: 'macOS Monterrey', - }, - { id: 'ventura', - label: 'macOS Ventura', + label: 'macOS Sierra or higher', }, ]; @@ -248,7 +224,7 @@ const versionButtonsOpenSuse = [ { id: 'leap15', label: 'OpenSuse Leap 15 or higher', - } + }, ]; const versionButtonsSolaris = [ @@ -259,21 +235,21 @@ const versionButtonsSolaris = [ { id: 'solaris11', label: 'Solaris 11', - } + }, ]; const versionButtonsAix = [ { id: '6.1 TL9', label: 'AIX 6.1 TL9 or higher', - } + }, ]; const versionButtonsHPUX = [ { id: '11.31', label: 'HP-UX 11.31 or higher', - } + }, ]; const versionButtonsOracleLinux = [ @@ -284,21 +260,21 @@ const versionButtonsOracleLinux = [ { id: 'oraclelinux6', label: 'Oracle Linux 6 or later', - } + }, ]; const versionButtonsRaspbian = [ { id: 'busterorgreater', label: 'Raspbian Buster or greater', - } + }, ]; /** * Order the OS Buttons Alphabetically by label - * @param a - * @param b - * @returns + * @param a + * @param b + * @returns */ const orderOSAlphabetically = (a, b) => { if (a.label.toUpperCase() < b.label.toUpperCase()) { @@ -308,9 +284,9 @@ const orderOSAlphabetically = (a, b) => { return 1; } return 0; -} +}; -const osButtons = [ +const osPrincipalButtons = [ { id: 'rpm', label: 'Red Hat Enterprise Linux', @@ -319,10 +295,6 @@ const osButtons = [ id: 'cent', label: 'CentOS', }, - { - id: 'deb', - label: 'Debian', - }, { id: 'ubu', label: 'Ubuntu', @@ -335,6 +307,13 @@ const osButtons = [ id: 'macos', label: 'macOS', }, +]; + +const osButtons = [ + { + id: 'deb', + label: 'Debian', + }, { id: 'open', label: 'OpenSuse', @@ -347,30 +326,61 @@ const osButtons = [ id: 'aix', label: 'AIX', }, - { + { id: 'hp', label: 'HP-UX', }, - { + { id: 'amazonlinux', label: 'Amazon Linux', }, - { + { id: 'fedora', label: 'Fedora', }, - { + { id: 'oraclelinux', label: 'Oracle Linux', }, - { + { id: 'suse', label: 'SUSE', }, - { + { id: 'raspbian', label: 'Raspbian OS', }, + { + id: 'alpine', + label: 'Alpine', + }, ].sort(orderOSAlphabetically); -export { architectureButtons, architecturei386Andx86_64, versionButtonsRaspbian, versionButtonsSuse, architectureButtonsWithPPC64LE, versionButtonsOracleLinux, versionButtonFedora, versionButtonsRedHat, versionButtonsCentos, architectureButtonsMacos, osButtons, versionButtonsDebian, versionButtonsUbuntu, versionButtonAmazonLinux, versionButtonsWindows, versionButtonsMacOS, versionButtonsOpenSuse, versionButtonsSolaris, versionButtonsAix, versionButtonsHPUX, architectureButtonsi386, architectureButtonsSolaris, architectureButtonsAix, architectureButtonsHpUx, architectureButtonsOpenSuse }; +export { + architectureButtons, + architecturei386Andx86_64, + versionButtonsRaspbian, + versionButtonsSuse, + architectureButtonsWithPPC64LE, + versionButtonsOracleLinux, + versionButtonFedora, + versionButtonsRedHat, + versionButtonsCentos, + architectureButtonsMacos, + osButtons, + osPrincipalButtons, + versionButtonsDebian, + versionButtonsUbuntu, + versionButtonAmazonLinux, + versionButtonsWindows, + versionButtonsMacOS, + versionButtonsOpenSuse, + versionButtonsSolaris, + versionButtonsAix, + versionButtonsHPUX, + architectureButtonsi386, + architectureButtonsSolaris, + architectureButtonsAix, + architectureButtonsHpUx, + architectureButtonsOpenSuse, +}; From 14bd6f062dafb4382ca18eaa75e013676f57abf8 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 7 Dec 2022 12:46:19 -0300 Subject: [PATCH 03/34] styles --- public/controllers/agent/components/register-agent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 5b546f0a00..53e7cc20e5 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -75,6 +75,7 @@ import { getConnectionConfig, fetchClusterNodesOptions, } from './register-agent-service'; +import './register-agent.scss'; import { WzAccordion, PrincipalButtonGroup } from './wz-accordion'; export const RegisterAgent = withErrorBoundary( @@ -1298,7 +1299,8 @@ export const RegisterAgent = withErrorBoundary( options={options} idSelected={idSelected} onChange={onChange} - className={'osButtonsStyle'} + // className={'osButtonsStyle'} + className={'wz-flex'} /> ); }; From 28f5e30dd5add16e7350734926153b798195ea87 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 11:26:51 -0300 Subject: [PATCH 04/34] changes --- .../agent/components/register-agent.js | 32 ++++++++++--------- .../agent/components/wz-accordion.tsx | 1 + .../controllers/agent/wazuh-config/index.ts | 6 +--- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 53e7cc20e5..05e09193b2 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -34,7 +34,6 @@ import { EuiIcon, EuiSwitch, EuiLink, - EuiAccordion, } from '@elastic/eui'; import { WzRequest } from '../../../react-services/wz-request'; import { withErrorBoundary } from '../../../components/common/hocs'; @@ -59,7 +58,6 @@ import { versionButtonsRedHat, versionButtonsCentos, architectureButtonsMacos, - osButtons, osPrincipalButtons, versionButtonsDebian, versionButtonsUbuntu, @@ -76,7 +74,7 @@ import { fetchClusterNodesOptions, } from './register-agent-service'; import './register-agent.scss'; -import { WzAccordion, PrincipalButtonGroup } from './wz-accordion'; +import { PrincipalButtonGroup } from './wz-accordion'; export const RegisterAgent = withErrorBoundary( class RegisterAgent extends Component { @@ -249,7 +247,6 @@ export const RegisterAgent = withErrorBoundary( 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'; @@ -617,14 +614,6 @@ export const RegisterAgent = withErrorBoundary( return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_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`; default: return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; } @@ -1746,6 +1735,21 @@ export const RegisterAgent = withErrorBoundary( }, ] : []), + ...(this.state.selectedOS == 'alpine' + ? [ + { + title: 'Choose the version', + children: + this.state.selectedVersion == '11.31' && + buttonGroup( + 'Choose the version', + versionButtonsHPUX, + this.state.selectedVersion, + version => this.setVersion(version), + ), + }, + ] + : []), ...(this.state.selectedVersion == 'centos5' || this.state.selectedVersion == 'redhat5' || this.state.selectedVersion == 'oraclelinux5' || @@ -1783,8 +1787,7 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion == 'debian7' || this.state.selectedVersion == 'debian8' || this.state.selectedVersion == 'ubuntu14' || - this.state.selectedVersion == 'ubuntu15' || - this.state.selectedVersion == 'ubuntu16' + this.state.selectedVersion == 'ubuntu15' ? [ { title: 'Choose the architecture', @@ -1972,7 +1975,6 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion == 'busterorgreater' || this.state.selectedVersion == 'busterorgreater' || this.state.selectedVersion === 'ubuntu15' || - this.state.selectedVersion === 'ubuntu16' || this.state.selectedVersion === 'leap15' ? tabSystemD : this.state.selectedVersion == 'windowsxp' || diff --git a/public/controllers/agent/components/wz-accordion.tsx b/public/controllers/agent/components/wz-accordion.tsx index fbe80402dc..d675f500e1 100644 --- a/public/controllers/agent/components/wz-accordion.tsx +++ b/public/controllers/agent/components/wz-accordion.tsx @@ -48,6 +48,7 @@ export const WzAccordion = ({ children }) => { arrowDisplay='right' buttonContent={isAccordionOpen ? 'Show less' : 'Show more'} onToggle={(isOpen: boolean) => setIsAccordionOpen(isOpen)} + className={'action-btn-td'} > {children} diff --git a/public/controllers/agent/wazuh-config/index.ts b/public/controllers/agent/wazuh-config/index.ts index c6ff4843e5..2e9234bb4c 100644 --- a/public/controllers/agent/wazuh-config/index.ts +++ b/public/controllers/agent/wazuh-config/index.ts @@ -183,11 +183,7 @@ const versionButtonsUbuntu = [ }, { id: 'ubuntu15', - label: 'Ubuntu 15', - }, - { - id: 'ubuntu16', - label: 'Ubuntu 16 or higher', + label: 'Ubuntu 15 or higher', }, ]; From 2f57447939997785532c9fd3e179079e28963677 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 13:59:14 -0300 Subject: [PATCH 05/34] changes --- .../agent/components/register-agent.js | 80 ++++++++++++++----- .../controllers/agent/wazuh-config/index.ts | 14 +++- 2 files changed, 71 insertions(+), 23 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 05e09193b2..d2adc288cc 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -67,6 +67,7 @@ import { versionButtonsSolaris, versionButtonsAix, versionButtonsHPUX, + versionButtonAlpine, } from '../wazuh-config'; import ServerAddress from '../register-agent/steps/server-address'; import { @@ -267,6 +268,7 @@ export const RegisterAgent = withErrorBoundary( systemSelectorNet() { if ( this.state.selectedVersion === 'windowsxp' || + this.state.selectedVersion === 'windowsserver2008' || this.state.selectedVersion === 'windows8' ) { return 'update-rc.d wazuh-agent defaults && service wazuh-agent start'; @@ -836,6 +838,21 @@ export const RegisterAgent = withErrorBoundary( 'user-manual/agents/agent-connection.html', appVersionMajorDotMinor, ); + const urlWindowsPackage = `https://packages.wazuh.com/4.x/windows/wazuh-agent-${this.state.wazuhVersion}-1.msi`; + + // 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()}`; + + // `https://packages.wazuh.com/${this.state.wazuhVersion}/windows/wazuh-agent-${this.state.wazuhVersion}-1.msi` + + // # Provide MSI package URL and request the user to download the package and run the following command: + // msiexec.exe /i wazuh-agent.msi /q WAZUH_MANAGER='172.31.76.147' WAZUH_REGISTRATION_SERVER='172.31.76.147' + const textAndLinkToCheckConnectionDocumentation = (

    To verify the connection with the Wazuh server, please follow this{' '} @@ -915,13 +932,19 @@ export const RegisterAgent = withErrorBoundary( }-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()}`, + winText: + this.state.selectedVersion == 'windowsxp' || + this.state.selectedVersion == 'windowsserver2008' + ? `msiexec.exe /i wazuh-agent-${ + this.state.wazuhVersion + }-1.msi /q ${this.optionalDeploymentVariables()}` + : `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' @@ -946,6 +969,12 @@ export const RegisterAgent = withErrorBoundary( 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 warningCommand = ( +

    + Download from this link + the package to use with the command. +

    + ); const windowsAdvice = this.state.selectedOS === 'win' && ( <> @@ -1005,6 +1034,17 @@ export const RegisterAgent = withErrorBoundary( /> {windowsAdvice} + {this.state.selectedVersion == 'windowsxp' || + this.state.selectedVersion == 'windowsserver2008' ? ( + + ) : ( + '' + )} +
    {this.state.wazuhPassword && !this.state.showPassword @@ -1615,20 +1655,12 @@ export const RegisterAgent = withErrorBoundary( ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsWindows, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1821,6 +1853,7 @@ export const RegisterAgent = withErrorBoundary( ] : []), ...(this.state.selectedVersion == 'windowsxp' || + this.state.selectedVersion == 'windowsserver2008' || this.state.selectedVersion == 'windows8' ? [ { @@ -1945,7 +1978,8 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedOS == 'open' || this.state.selectedOS == 'sol' || this.state.selectedOS == 'aix' || - this.state.selectedOS == 'hp' + this.state.selectedOS == 'hp' || + this.state.selectedOS == 'alpine' ? [ { title: 'Start the agent', @@ -1978,6 +2012,7 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion === 'leap15' ? tabSystemD : this.state.selectedVersion == 'windowsxp' || + this.state.selectedVersion == 'windowsserver2008' || this.state.selectedVersion == 'windows8' ? tabNet : this.state.selectedVersion == 'sierra' || @@ -2019,6 +2054,7 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedOS !== 'oraclelinux' && this.state.selectedOS !== 'suse' && this.state.selectedOS !== 'raspbian' && + this.state.selectedOS !== 'alpine' && restartAgentCommand ? [ { diff --git a/public/controllers/agent/wazuh-config/index.ts b/public/controllers/agent/wazuh-config/index.ts index 2e9234bb4c..7cde5f0b2d 100644 --- a/public/controllers/agent/wazuh-config/index.ts +++ b/public/controllers/agent/wazuh-config/index.ts @@ -192,6 +192,10 @@ const versionButtonsWindows = [ id: 'windowsxp', label: 'Windows XP', }, + { + id: 'windowsserver2008', + label: 'Windows Server 2008', + }, { id: 'windows8', label: 'Windows 8 or higher', @@ -255,7 +259,7 @@ const versionButtonsOracleLinux = [ }, { id: 'oraclelinux6', - label: 'Oracle Linux 6 or later', + label: 'Oracle Linux 6 or higher', }, ]; @@ -266,6 +270,13 @@ const versionButtonsRaspbian = [ }, ]; +const versionButtonAlpine = [ + { + id: '3.12.12', + label: '3.12.12 or higher', + }, +]; + /** * Order the OS Buttons Alphabetically by label * @param a @@ -362,6 +373,7 @@ export { versionButtonFedora, versionButtonsRedHat, versionButtonsCentos, + versionButtonAlpine, architectureButtonsMacos, osButtons, osPrincipalButtons, From 42037dc4876462889cccbf294676dddacfc975c7 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 14:04:21 -0300 Subject: [PATCH 06/34] changes --- public/controllers/agent/components/register-agent.js | 6 +++--- public/controllers/agent/wazuh-config/index.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index d2adc288cc..371aa09a69 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -269,7 +269,7 @@ export const RegisterAgent = withErrorBoundary( if ( this.state.selectedVersion === 'windowsxp' || this.state.selectedVersion === 'windowsserver2008' || - this.state.selectedVersion === 'windows8' + this.state.selectedVersion === 'windows7' ) { return 'update-rc.d wazuh-agent defaults && service wazuh-agent start'; } @@ -1854,7 +1854,7 @@ export const RegisterAgent = withErrorBoundary( : []), ...(this.state.selectedVersion == 'windowsxp' || this.state.selectedVersion == 'windowsserver2008' || - this.state.selectedVersion == 'windows8' + this.state.selectedVersion == 'windows7' ? [ { title: 'Choose the architecture', @@ -2013,7 +2013,7 @@ export const RegisterAgent = withErrorBoundary( ? tabSystemD : this.state.selectedVersion == 'windowsxp' || this.state.selectedVersion == 'windowsserver2008' || - this.state.selectedVersion == 'windows8' + this.state.selectedVersion == 'windows7' ? tabNet : this.state.selectedVersion == 'sierra' || this.state.selectedVersion == 'highSierra' || diff --git a/public/controllers/agent/wazuh-config/index.ts b/public/controllers/agent/wazuh-config/index.ts index 7cde5f0b2d..9dad7565ac 100644 --- a/public/controllers/agent/wazuh-config/index.ts +++ b/public/controllers/agent/wazuh-config/index.ts @@ -197,8 +197,8 @@ const versionButtonsWindows = [ label: 'Windows Server 2008', }, { - id: 'windows8', - label: 'Windows 8 or higher', + id: 'windows7', + label: 'Windows 7 or higher', }, ]; From ccf353687ddad87b7393f035d0eaffa22e68bb2f Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 15:09:28 -0300 Subject: [PATCH 07/34] changes --- .../agent/components/register-agent.js | 67 +++++++++++-------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 371aa09a69..1e223247d3 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -186,12 +186,6 @@ export const RegisterAgent = withErrorBoundary( } } - // componentDidUpdate() { - // if (this.state.selectedOS == 'macos') { - // this.setVersion('sierra'); - // } - // } - getEnrollDNSConfig = () => { let serverAddress = this.configuration['enrollment.dns'] || ''; this.setState({ defaultServerAddress: serverAddress }); @@ -423,6 +417,25 @@ export const RegisterAgent = withErrorBoundary( } } + resolveAlpinePackage() { + switch ( + `${this.state.selectedVersion}-${this.state.selectedArchitecture}` + ) { + case 'alpine-i386': + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.i386.rpm`; + case 'alpine-aarch64': + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; + case 'alpine-x86_64': + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + case 'alpine-armhf': + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.armv7hl.rpm`; + case 'alpine-powerpc': + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + default: + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + } + } + resolveORACLELINUXPackage() { switch ( `${this.state.selectedVersion}-${this.state.selectedArchitecture}` @@ -701,6 +714,8 @@ 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`; } @@ -840,19 +855,6 @@ export const RegisterAgent = withErrorBoundary( ); const urlWindowsPackage = `https://packages.wazuh.com/4.x/windows/wazuh-agent-${this.state.wazuhVersion}-1.msi`; - // 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()}`; - - // `https://packages.wazuh.com/${this.state.wazuhVersion}/windows/wazuh-agent-${this.state.wazuhVersion}-1.msi` - - // # Provide MSI package URL and request the user to download the package and run the following command: - // msiexec.exe /i wazuh-agent.msi /q WAZUH_MANAGER='172.31.76.147' WAZUH_REGISTRATION_SERVER='172.31.76.147' - const textAndLinkToCheckConnectionDocumentation = (

    To verify the connection with the Wazuh server, please follow this{' '} @@ -1771,14 +1773,12 @@ export const RegisterAgent = withErrorBoundary( ? [ { title: 'Choose the version', - children: - this.state.selectedVersion == '11.31' && - buttonGroup( - 'Choose the version', - versionButtonsHPUX, - this.state.selectedVersion, - version => this.setVersion(version), - ), + children: buttonGroup( + 'Choose the version', + versionButtonAlpine, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1811,6 +1811,19 @@ export const RegisterAgent = withErrorBoundary( }, ] : []), + ...(this.state.selectedVersion == '3.12.12' + ? [ + { + title: 'Choose the architecture', + children: buttonGroup( + 'Choose the architecture', + architectureButtonsWithPPC64LE, + this.state.selectedArchitecture, + architecture => this.setArchitecture(architecture), + ), + }, + ] + : []), ...(this.state.selectedVersion == 'centos6' || this.state.selectedVersion == 'oraclelinux6' || this.state.selectedVersion == 'amazonlinux1' || From 48d809ba86061d5cb288092e4d17e36bce0fd672 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 15:27:12 -0300 Subject: [PATCH 08/34] alpine versions commands --- public/controllers/agent/components/register-agent.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 1e223247d3..81fc517610 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -421,15 +421,15 @@ export const RegisterAgent = withErrorBoundary( switch ( `${this.state.selectedVersion}-${this.state.selectedArchitecture}` ) { - case 'alpine-i386': + case '3.12.12-i386': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.i386.rpm`; - case 'alpine-aarch64': + case '3.12.12-aarch64': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; - case 'alpine-x86_64': + case '3.12.12-x86_64': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; - case 'alpine-armhf': + case '3.12.12-armhf': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.armv7hl.rpm`; - case 'alpine-powerpc': + case '3.12.12-powerpc': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; default: return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; From a7cb4d9b1bd6ca905233a0c5fe07a7036dc720da Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 17:38:15 -0300 Subject: [PATCH 09/34] commands for alpine and architecture macos --- .../agent/components/register-agent.js | 25 ++++++++++++++++++- .../agent/components/wz-accordion.tsx | 6 +++-- .../controllers/agent/wazuh-config/index.ts | 8 ++---- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 81fc517610..ac92ee82b8 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -422,7 +422,7 @@ export const RegisterAgent = withErrorBoundary( `${this.state.selectedVersion}-${this.state.selectedArchitecture}` ) { case '3.12.12-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.i386.rpm`; + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/trash/alpine/v3.12/main"`; case '3.12.12-aarch64': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; case '3.12.12-x86_64': @@ -831,6 +831,13 @@ export const RegisterAgent = withErrorBoundary( ? ['OS architecture'] : []), ]; + case 'alpine': + return [ + ...(!this.state.selectedVersion ? ['OS version'] : []), + ...(this.state.selectedVersion && !this.state.selectedArchitecture + ? ['OS architecture'] + : []), + ]; default: return []; } @@ -914,8 +921,24 @@ export const RegisterAgent = withErrorBoundary( const codeBlock = { zIndex: '100', }; + const customTexts = { rpmText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, + alpineText: `wget -O /etc/apk/keys/alpine-devel@wazuh.com-633d7457.rsa.pub ${this.optionalPackages()} >> /etc/apk/repositories && \ +apk update && \ +apk add wazuh-agent`, + + // wget -O /etc/apk/keys/alpine-devel@wazuh.com-633d7457.rsa.pub https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \ + // echo "https://packages.wazuh.com/trash/alpine/v3.12/main" >> /etc/apk/repositories && \ + // apk update && \ + // apk add wazuh-agent + + // armando comando + + // wget -O /etc/apk/keys/alpine-devel@wazuh.com-633d7457.rsa.pub ${this.optionalPackages()} >> /etc/apk/repositories && \ + // apk update && \ + // apk add wazuh-agent + centText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, debText: `curl -so wazuh-agent-${ this.state.wazuhVersion diff --git a/public/controllers/agent/components/wz-accordion.tsx b/public/controllers/agent/components/wz-accordion.tsx index d675f500e1..eafaf073cd 100644 --- a/public/controllers/agent/components/wz-accordion.tsx +++ b/public/controllers/agent/components/wz-accordion.tsx @@ -45,13 +45,15 @@ export const WzAccordion = ({ children }) => { return ( setIsAccordionOpen(isOpen)} className={'action-btn-td'} > - {children} + + {children} + ); }; diff --git a/public/controllers/agent/wazuh-config/index.ts b/public/controllers/agent/wazuh-config/index.ts index 9dad7565ac..24e6cbe5ac 100644 --- a/public/controllers/agent/wazuh-config/index.ts +++ b/public/controllers/agent/wazuh-config/index.ts @@ -71,12 +71,8 @@ const architectureButtonsSolaris = [ const architectureButtonsMacos = [ { - id: 'intel', - label: 'Intel', - }, - { - id: 'applesilicon', - label: 'Apple Silicon', + id: 'intel/applesilicon', + label: 'Intel/Apple Silicon', }, ]; From 3f56129d84b9b77838fd9903001ca13ea30f5eee Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 10:25:57 -0300 Subject: [PATCH 10/34] changes, alpine versions commands, commands for alpine and architecture macos, essage install and start alpine --- .../agent/components/register-agent.js | 45 +++---- public/styles/component.scss | 112 ++++++++++-------- 2 files changed, 80 insertions(+), 77 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index ac92ee82b8..4a627ec717 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -211,14 +211,6 @@ export const RegisterAgent = withErrorBoundary( } selectOS(os) { - if (os == 'macos') { - this.setState({ - selectedOS: os, - selectedVersion: 'sierra', - selectedArchitecture: '', - selectedSYS: '', - }); - } this.setState({ selectedOS: os, selectedVersion: '', @@ -280,7 +272,8 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion === 'solaris10' || this.state.selectedVersion === 'solaris11' || this.state.selectedVersion === '6.1 TL9' || - this.state.selectedVersion === '11.31' + this.state.selectedVersion === '11.31' || + this.state.selectedVersion === '3.12.12' ) { return '/var/ossec/bin/wazuh-control start'; } @@ -311,6 +304,7 @@ export const RegisterAgent = withErrorBoundary( } setVersion(selectedVersion) { + console.log(selectedVersion, 'sel'); this.setState({ selectedVersion, selectedArchitecture: '' }); } @@ -422,17 +416,17 @@ export const RegisterAgent = withErrorBoundary( `${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/trash/alpine/v3.12/main"`; + 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/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.aarch64.rpm`; + 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/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + 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/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.armv7hl.rpm`; + 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/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.ppc64le.rpm`; + 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/4.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`; + return `https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; } } @@ -928,17 +922,6 @@ export const RegisterAgent = withErrorBoundary( apk update && \ apk add wazuh-agent`, - // wget -O /etc/apk/keys/alpine-devel@wazuh.com-633d7457.rsa.pub https://packages.wazuh.com/key/alpine-devel%40wazuh.com-633d7457.rsa.pub && \ - // echo "https://packages.wazuh.com/trash/alpine/v3.12/main" >> /etc/apk/repositories && \ - // apk update && \ - // apk add wazuh-agent - - // armando comando - - // wget -O /etc/apk/keys/alpine-devel@wazuh.com-633d7457.rsa.pub ${this.optionalPackages()} >> /etc/apk/repositories && \ - // apk update && \ - // apk add wazuh-agent - centText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, debText: `curl -so wazuh-agent-${ this.state.wazuhVersion @@ -996,8 +979,11 @@ apk add wazuh-agent`, 'If the installer finds another Wazuh agent in the system, it will upgrade it preserving the configuration.'; const warningCommand = (

    - Download from this link - the package to use with the command. + Please + download + the package from our repository and copy it to the Windows system + where you are going to install it. Then run the following command to + perform the installation:

    ); const windowsAdvice = this.state.selectedOS === 'win' && ( @@ -2062,7 +2048,8 @@ apk add wazuh-agent`, : this.state.selectedVersion == 'solaris10' || this.state.selectedVersion == 'solaris11' || this.state.selectedVersion == '6.1 TL9' || - this.state.selectedVersion == '11.31' + this.state.selectedVersion == '11.31' || + this.state.selectedVersion == '3.12.12' ? tabWazuhControl : tabSysV } diff --git a/public/styles/component.scss b/public/styles/component.scss index 733122d86f..7fa8976546 100644 --- a/public/styles/component.scss +++ b/public/styles/component.scss @@ -16,106 +16,122 @@ /* Custom nav bar styles */ -.wz-nav-bar .md-nav-bar{ - height: auto !important; +.wz-nav-bar .md-nav-bar { + height: auto !important; } .wz-nav-item button, .wz-no-padding { - padding: 0 5px!important; + padding: 0 5px !important; } .wz-nav-item button.md-primary { - color: rgb(0, 121, 165) !important; - background: #f5fafb !important; - border-bottom: 2px solid #006BB4; + color: rgb(0, 121, 165) !important; + background: #f5fafb !important; + border-bottom: 2px solid #006bb4; } .wz-nav-item button.md-unselected { - color: rgba(0, 0, 0, 0.87) !important; + color: rgba(0, 0, 0, 0.87) !important; } .wz-nav-bar md-nav-ink-bar { - color: rgb(0, 121, 165) !important; - background: rgb(0, 121, 165) !important; + color: rgb(0, 121, 165) !important; + background: rgb(0, 121, 165) !important; } .wz-nav-bar md-nav-ink-bar._md-left, .wz-nav-bar md-nav-ink-bar._md-right { - transition: none !important; + transition: none !important; } /* Custom tooltip styles */ .wz-tooltip { - background-color: rgba(0,0,0,0.87) !important; - color: #FFF !important; + background-color: rgba(0, 0, 0, 0.87) !important; + color: #fff !important; } /* Custom switch styles */ .wz-switch { - margin: 0 !important; + margin: 0 !important; } /* Custom chips styles */ .wz-chips .md-chips { - box-shadow: none !important; - padding-bottom: 0; + box-shadow: none !important; + padding-bottom: 0; } .wz-chip { - font-size: 12px; - color: white; - background-color: #006BB4; - height: 26px !important; - line-height: 26px !important; - margin: 0 8px 0 0 !important; + font-size: 12px; + color: white; + background-color: #006bb4; + height: 26px !important; + line-height: 26px !important; + margin: 0 8px 0 0 !important; } - .sca-chart-widget { - margin: 0 auto; - //width:350px; - margin-top:50px; - background-color: #222D3A; - border-radius: 5px; - box-shadow: 0px 0px 1px 0px #06060d; - + margin: 0 auto; + //width:350px; + margin-top: 50px; + background-color: #222d3a; + border-radius: 5px; + box-shadow: 0px 0px 1px 0px #06060d; } -.sca-chart-header{ - background-color: #29384D; - height:40px; - color:#929DAF; - text-align: center; - line-height: 40px; - border-top-left-radius: 7px; - border-top-right-radius: 7px; - font-weight: 400; - font-size: 1.5em; - text-shadow: 1px 1px #06060d; +.sca-chart-header { + background-color: #29384d; + height: 40px; + color: #929daf; + text-align: center; + line-height: 40px; + border-top-left-radius: 7px; + border-top-right-radius: 7px; + font-weight: 400; + font-size: 1.5em; + text-shadow: 1px 1px #06060d; } -.sca-chart{ - padding:12px; +.sca-chart { + padding: 12px; } .sca-chart-shadow { - -webkit-filter: drop-shadow( 0px 3px 3px rgba(0,0,0,.5) ); - filter: drop-shadow( 0px 3px 3px rgba(0,0,0,.5) ); + -webkit-filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.5)); + filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.5)); } kbn-dis doc-table .kbnDocViewer__warning { - display: none; + display: none; } /* Custom Breadcrumb styles*/ .header__breadcrumbsWithExtensionContainer .euiHeaderBreadcrumbs { - flex-grow: 1; - margin-right: 12px; + flex-grow: 1; + margin-right: 12px; } .header__breadcrumbsWithExtensionContainer .header__breadcrumbsAppendExtension { - flex-grow: 0; + flex-grow: 0; +} + +.osButtonsStyle { + display: grid; + grid-template-columns: repeat(5, 1fr); + grid-gap: 10px; +} + +.osButtonsStyleMac { + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-gap: 10px; +} + +.message { + margin-top: 10px; + display: flex; + flex-direction: row; } From 1743a8d25f1bc336823c3f2ce3341b25600d5002 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 12:08:36 -0300 Subject: [PATCH 11/34] command debian --- public/controllers/agent/components/register-agent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 4a627ec717..9d0bcb0be9 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -578,7 +578,7 @@ export const RegisterAgent = withErrorBoundary( case 'x86_64': return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_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}.ppc64el.deb`; default: return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb`; } From 4d998fcfcb25d2d4eb3923e3cdfbfb90c04b7a20 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 12:13:07 -0300 Subject: [PATCH 12/34] command raspbian From 5c2cc61ae5e04695cd98c920f79922fba68762a8 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 12:13:07 -0300 Subject: [PATCH 13/34] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af682f3f73..cef003970d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Added powerPC architecture in redhat7, in the section 'Deploy new agent'. [4833](https://github.com/wazuh/wazuh-kibana-app/pull/4833) - Added a centralized service to handle the requests [#4831](https://github.com/wazuh/wazuh-kibana-app/pull/4831) - Added data-test-subj create policy [#4873](https://github.com/wazuh/wazuh-kibana-app/pull/4873) +- Deploy new agent section: Added extra steps message and new command for windows xp and windows server 2008, added alpine agent with all its steps. [#4974](https://github.com/wazuh/wazuh-kibana-app/pull/4974) ### Changed @@ -45,6 +46,7 @@ All notable changes to the Wazuh app project will be documented in this file. - 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 a bug that caused the flyouts to close when clicking inside them [#4638](https://github.com/wazuh/wazuh-kibana-app/pull/4638) +- Deploy new agent section: Fixed the way macos versions and architectures were displayed, fixed the way agents were displayed, fixed the way ubuntu versions were displayed. [#4974](https://github.com/wazuh/wazuh-kibana-app/pull/4974) ### Removed From efdb99ccbd52d35277d9f8522be04a996574d95a Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 7 Dec 2022 13:20:40 -0300 Subject: [PATCH 14/34] adaptanding styles 4.4-7.10 to 4.4-2.3-wzd --- .../agent/components/register-agent.js | 43 ++++++++++++++++--- .../agent/components/wz-accordion.tsx | 4 +- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 9d0bcb0be9..3051e0e247 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1426,6 +1426,27 @@ apk add wazuh-agent`, } > + ) : this.state.selectedVersion == '3.12.12' ? ( + + Might require some extra installation{' '} + + steps + + . + + } + > ) : this.state.selectedVersion == 'debian7' || this.state.selectedVersion == 'debian8' || this.state.selectedVersion == 'debian9' || @@ -1465,7 +1486,7 @@ apk add wazuh-agent`, options={options} idSelected={idSelected} onChange={onChange} - className={'osButtonsStyleMac'} + // className={'osButtonsStyleMac'} /> ); }; @@ -1782,12 +1803,20 @@ apk add wazuh-agent`, ? [ { title: 'Choose the version', - children: buttonGroup( - 'Choose the version', - versionButtonAlpine, - this.state.selectedVersion, - version => this.setVersion(version), - ), + children: + this.state.selectedVersion == '3.12.12' + ? buttonGroupWithMessage( + 'Choose the version', + versionButtonAlpine, + this.state.selectedVersion, + version => this.setVersion(version), + ) + : buttonGroup( + 'Choose the version', + versionButtonAlpine, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), diff --git a/public/controllers/agent/components/wz-accordion.tsx b/public/controllers/agent/components/wz-accordion.tsx index eafaf073cd..674e8922f6 100644 --- a/public/controllers/agent/components/wz-accordion.tsx +++ b/public/controllers/agent/components/wz-accordion.tsx @@ -22,7 +22,7 @@ export const PrincipalButtonGroup = ({ options={options} idSelected={idSelected} onChange={onChange} - className={'osButtonsStyle'} + className={'wz-flex'} /> @@ -32,7 +32,7 @@ export const PrincipalButtonGroup = ({ options={osButtons} idSelected={idSelected} onChange={onChange} - className={'osButtonsStyle'} + className={'wz-flex'} /> From a60e806bd116821bfaca825ef0b9b6e5dcdb4862 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 7 Dec 2022 14:16:30 -0300 Subject: [PATCH 15/34] background panel --- .../agent/components/wz-accordion.tsx | 2 +- public/styles/common.scss | 323 +++++++++--------- 2 files changed, 168 insertions(+), 157 deletions(-) diff --git a/public/controllers/agent/components/wz-accordion.tsx b/public/controllers/agent/components/wz-accordion.tsx index 674e8922f6..910a955c8b 100644 --- a/public/controllers/agent/components/wz-accordion.tsx +++ b/public/controllers/agent/components/wz-accordion.tsx @@ -51,7 +51,7 @@ export const WzAccordion = ({ children }) => { className={'action-btn-td'} > - + {children} diff --git a/public/styles/common.scss b/public/styles/common.scss index dfecffdcad..e59875e4d9 100644 --- a/public/styles/common.scss +++ b/public/styles/common.scss @@ -25,7 +25,7 @@ /* Custom healthcheck and blank screen styles */ -.kbnGlobalBannerList{ +.kbnGlobalBannerList { display: none; } @@ -262,9 +262,10 @@ box-shadow: none !important; } -.btn-as-i:hover, .btn-as-i:focus { +.btn-as-i:hover, +.btn-as-i:focus { background: none !important; - color: #006bb4!important; + color: #006bb4 !important; } /* Custom reporting button styles */ @@ -304,8 +305,8 @@ /* Custom input filter box styles */ -input[type="search"].euiFieldSearch{ - box-sizing: inherit!important; +input[type='search'].euiFieldSearch { + box-sizing: inherit !important; } .input-filter-box { @@ -363,7 +364,9 @@ input[type="search"].euiFieldSearch{ box-shadow: none; } -:focus:not(.wz-button):not(.input-filter-box):not(.kuiLocalSearchInput):not(.euiTextArea):not(.euiPanel.euiPopover__panel.euiPopover__panel-isOpen) { +:focus:not(.wz-button):not(.input-filter-box):not(.kuiLocalSearchInput):not( + .euiTextArea + ):not(.euiPanel.euiPopover__panel.euiPopover__panel-isOpen) { box-shadow: none !important; } @@ -418,8 +421,9 @@ input[type="search"].euiFieldSearch{ /* Custom plugin plaform styles */ -md-content.md-default-theme, md-content{ - background: transparent!important; +md-content.md-default-theme, +md-content { + background: transparent !important; } .wz-border-none, @@ -430,7 +434,7 @@ md-content.md-default-theme, md-content{ .wz-border-0 { border: 0px; } -.table{ +.table { margin: 0 !important; } .wz-md-tab .md-tab, @@ -439,7 +443,7 @@ md-content.md-default-theme, md-content{ } .table-hover > tbody > tr:hover { - background-color: #fafbfd!important; + background-color: #fafbfd !important; } /* .table > tbody { @@ -458,7 +462,7 @@ md-content.md-default-theme, md-content{ } .euiTab.euiTab-isSelected { - font-weight: 600!important; + font-weight: 600 !important; } .sca-checksum { @@ -504,7 +508,7 @@ md-sidenav { color: #b4bcc2; } -.conApp .euiProgress{ +.conApp .euiProgress { z-index: 2000; } @@ -780,7 +784,7 @@ md-switch.md-checked .md-thumb { display: block; } -.wz-ellipsis{ +.wz-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -850,12 +854,12 @@ wz-xml-file-editor { background: #ecf6fb !important; } -.table-striped > tbody > tr:nth-of-type(odd){ - background-color: transparent!important; +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: transparent !important; } -.table-striped > tbody > tr:nth-of-type(odd):hover{ - background-color: #fafbfd!important; +.table-striped > tbody > tr:nth-of-type(odd):hover { + background-color: #fafbfd !important; } .table-striped-duo > tbody tr:not(.euiTableRow):nth-child(2n + 1):not(:hover), @@ -987,40 +991,40 @@ wz-xml-file-editor { white-space: nowrap; } -.registerAgent{ +.registerAgent { min-height: calc(100vh - 100px); background: #fafbfd; } -.application{ +.application { background: #fafbfd; } -.application.tab-health-check wz-menu{ +.application.tab-health-check wz-menu { display: none; } -.health-check table tr td{ - border-top: none!important; +.health-check table tr td { + border-top: none !important; } -.health-check{ +.health-check { padding-top: 5%; max-width: 700px; margin: 0 auto; text-align: center; } -.health-check dl.euiDescriptionList dd{ +.health-check dl.euiDescriptionList dd { white-space: nowrap; } -.health-check dl.euiDescriptionList dd>span:first-child{ +.health-check dl.euiDescriptionList dd > span:first-child { display: inline-block; width: 26px; } -.health-check .euiCodeBlock{ +.health-check .euiCodeBlock { max-height: 0; margin-top: 0; transition: all 0.25s ease-out; @@ -1028,14 +1032,14 @@ wz-xml-file-editor { border: 0px solid #0001; } -.health-check .euiCodeBlock.visible{ +.health-check .euiCodeBlock.visible { border: 1px solid #0001; max-height: 700px; margin-top: 16px; visibility: visible; } -.wz-hover-transform-y1:hover{ +.wz-hover-transform-y1:hover { -webkit-transform: translateY(-1px) !important; transform: translateY(-1px) !important; } @@ -1049,30 +1053,30 @@ wz-xml-file-editor { } } -.health-check-loader{ +.health-check-loader { height: 120px; width: 120px; margin: 0 auto; } -.health-check-logo{ +.health-check-logo { width: 140px; z-index: 1; margin: 0 auto; } .health-check { - .euiDescriptionList__title{ - width: 60%!important; + .euiDescriptionList__title { + width: 60% !important; } - .euiDescriptionList__description{ - text-align: left!important; - width: 40%!important; + .euiDescriptionList__description { + text-align: left !important; + width: 40% !important; } } .CodeMirror-gutters { - z-index: 1!important; + z-index: 1 !important; } .refresh-report-button { @@ -1080,27 +1084,28 @@ wz-xml-file-editor { text-align: right; } -.monitoring-discover{ +.monitoring-discover { margin: -12px -6px 26px -6px; } -.euiBadge, .euiBadge__childButton{ - font-size: 12px!important; +.euiBadge, +.euiBadge__childButton { + font-size: 12px !important; } -.wz-link{ - cursor:pointer; - color: #006BB4; +.wz-link { + cursor: pointer; + color: #006bb4; text-decoration: none; } -.wzTableCellFilter{ +.wzTableCellFilter { text-align: right; height: 0; cursor: pointer; } -.wz-md-card:not(.fullscreen) .sca-vis.table-scrollable .kbnAggTable__paginated{ +.wz-md-card:not(.fullscreen) .sca-vis.table-scrollable .kbnAggTable__paginated { height: 150px; } @@ -1148,20 +1153,23 @@ wz-xml-file-editor { } .header-global-wrapper + .app-wrapper:not(.hidden-chrome) { - top: 48px!important; - left: 48px!important; + top: 48px !important; + left: 48px !important; } .reqCard { cursor: default !important; } -.reqCard:hover, .reqCard:focus { +.reqCard:hover, +.reqCard:focus { transform: translateY(0px) !important; - box-shadow: 0 2px 2px -1px rgba(152, 162, 179, 0.3), 0 1px 5px -2px rgba(152, 162, 179, 0.3) !important; + box-shadow: 0 2px 2px -1px rgba(152, 162, 179, 0.3), + 0 1px 5px -2px rgba(152, 162, 179, 0.3) !important; } -.reqCard:hover .euiCard__title, .reqCard:focus .euiCard__title { +.reqCard:hover .euiCard__title, +.reqCard:focus .euiCard__title { text-decoration: none !important; } @@ -1169,17 +1177,17 @@ wz-xml-file-editor { width: auto; } -@media only screen and (max-width: 1000px){ +@media only screen and (max-width: 1000px) { .flyout-no-overlap { max-width: 90%; } } -@media only screen and (min-width: 1000px) and (max-width: 1400px){ +@media only screen and (min-width: 1000px) and (max-width: 1400px) { .flyout-no-overlap { max-width: 85%; } } -@media only screen and (min-width: 1400px){ +@media only screen and (min-width: 1400px) { .flyout-no-overlap { max-width: 60%; } @@ -1216,7 +1224,6 @@ wz-xml-file-editor { color: #377dbb !important; } - .list-of-files-fail { margin-top: 10px; margin-bottom: 10px; @@ -1234,46 +1241,49 @@ wz-xml-file-editor { color: #000 !important; } -.logtest-side{ +.logtest-side { height: calc(100vh - 95px); margin-top: -50px; z-index: 10; - position : fixed; + position: fixed; right: 0; width: calc(30% - 16px); } -.logtest .euiFlyoutFooter, .logtest-side .euiFlyoutFooter{ +.logtest .euiFlyoutFooter, +.logtest-side .euiFlyoutFooter { margin: 0 -16px; - background: transparent; + background: transparent; } -.logtest-side .euiFlyoutFooter{ +.logtest-side .euiFlyoutFooter { margin: 0 -16px; } -.logtest .euiFlyoutFooter{ - margin: 0 -16px -16px -16px; +.logtest .euiFlyoutFooter { + margin: 0 -16px -16px -16px; } -.logtest .euiCodeBlock{ +.logtest .euiCodeBlock { border: 1px solid #e1e2e3; } -.logtest .euiTextArea, .logtest-side .euiTextArea{ +.logtest .euiTextArea, +.logtest-side .euiTextArea { max-height: 500px; resize: none; } -md-chips.md-default-theme .md-chips, md-chips .md-chips{ +md-chips.md-default-theme .md-chips, +md-chips .md-chips { box-shadow: none; } -.min-guide-width{ +.min-guide-width { min-width: 675px !important; } -.table-vis-container{ +.table-vis-container { overflow: auto !important; } @@ -1284,8 +1294,8 @@ md-chips.md-default-theme .md-chips, md-chips .md-chips{ .title-pin:hover:after { padding-left: 5px; font-size: 12px; - content: "\f00e"; - font-family: "FontAwesome"; + content: '\f00e'; + font-family: 'FontAwesome'; color: #0b6bb4; position: absolute; } @@ -1307,19 +1317,19 @@ md-chips.md-default-theme .md-chips, md-chips .md-chips{ margin-left: 25px; } -.AgentsTable__soBadge{ - font-size: 18px!important; +.AgentsTable__soBadge { + font-size: 18px !important; padding-right: 3px; } -.AgentsTable__soBadge--windows{ +.AgentsTable__soBadge--windows { color: lightskyblue; } -.AgentsTable__soBadge--darwin{ +.AgentsTable__soBadge--darwin { color: gray; } -.euiStatLink .euiStat__title{ +.euiStatLink .euiStat__title { cursor: pointer; } @@ -1340,7 +1350,7 @@ md-chips.md-default-theme .md-chips, md-chips .md-chips{ border: solid 1px #d9d9d9; } -.react-code-mirror > .CodeMirror.CodeMirror-wrap.cm-s-default{ +.react-code-mirror > .CodeMirror.CodeMirror-wrap.cm-s-default { height: 100% !important; } @@ -1364,40 +1374,40 @@ md-chips.md-default-theme .md-chips, md-chips .md-chips{ max-width: none !important; } -.sideMenuButton .euiButtonEmpty__content{ - justify-content: left!important; +.sideMenuButton .euiButtonEmpty__content { + justify-content: left !important; } -.wz-log-viewer{ +.wz-log-viewer { border: solid #8080806b 1px; } -.wz-load-extra{ +.wz-load-extra { color: #257dbd; text-align: center; cursor: pointer; } -.wz-load-extra:hover{ +.wz-load-extra:hover { text-decoration: underline; } -.hide-close-button{ +.hide-close-button { display: none; } -.WzNotReadyButton{ +.WzNotReadyButton { z-index: 9999; } -.WzNotReadyButton:focus{ +.WzNotReadyButton:focus { background-color: transparent !important; } -.WzNotReadyButton{ +.WzNotReadyButton { z-index: 9999; } -.WzNotReadyButton:focus{ +.WzNotReadyButton:focus { background-color: transparent !important; } @@ -1411,54 +1421,53 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu padding-right: 0; } - .euiSuggestItem .euiSuggestItem__label { flex-basis: 25%; min-width: 25%; } -.codeEditorWrapper{ +.codeEditorWrapper { border: 1px solid #e9edf3; } -.codeEditorWrapper .ace-tm .ace_gutter{ +.codeEditorWrapper .ace-tm .ace_gutter { border: none !important; } -.codeEditorWrapper .ace-tm .ace_print-margin{ - visibility: hidden!important; +.codeEditorWrapper .ace-tm .ace_print-margin { + visibility: hidden !important; } -.euiTableHeaderCellCheckbox{ - width: 32px!important; +.euiTableHeaderCellCheckbox { + width: 32px !important; } .kbnDis-no-padding .globalQueryBar:not(:empty) { - padding: 0px 0px 16px 0px!important; + padding: 0px 0px 16px 0px !important; } -.euiCodeBlock.euiCodeBlock-isFullScreen{ - border: 1px solid #D3DAE6; +.euiCodeBlock.euiCodeBlock-isFullScreen { + border: 1px solid #d3dae6; border-radius: 4px; margin: 22px; } -.euiCodeBlock.euiCodeBlock-isFullScreen .euiCodeBlock__controls{ +.euiCodeBlock.euiCodeBlock-isFullScreen .euiCodeBlock__controls { padding-right: 16px; } -.globalFilterGroup__wrapper{ +.globalFilterGroup__wrapper { max-height: 100px; - height: auto!important; + height: auto !important; } -.agent-selection-table-loading::before{ +.agent-selection-table-loading::before { position: absolute; content: ''; margin-left: 24px; width: 100%; height: 2px; - background-color: #006BB4; + background-color: #006bb4; -webkit-animation: euiBasicTableLoading 1000ms linear; animation: euiBasicTableLoading 1000ms linear; -webkit-animation-iteration-count: infinite; @@ -1487,16 +1496,18 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu padding: 0 3px; } -.wz-discover.hide-filter-control .globalFilterGroup__branch, kbn-dis.hide-filter-control .globalFilterGroup__branch { +.wz-discover.hide-filter-control .globalFilterGroup__branch, +kbn-dis.hide-filter-control .globalFilterGroup__branch { display: none; } /* Change custom discover size */ -.wz-discover > .globalQueryBar > -.kbnQueryBar--withDatePicker > -.euiFlexItem.euiFlexItem--flexGrowZero > -.euiFlexGroup > -.euiFlexItem.kbnQueryBar__datePickerWrapper { +.wz-discover + > .globalQueryBar + > .kbnQueryBar--withDatePicker + > .euiFlexItem.euiFlexItem--flexGrowZero + > .euiFlexGroup + > .euiFlexItem.kbnQueryBar__datePickerWrapper { max-width: 300px; } @@ -1506,16 +1517,18 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu } /* Change custom discover size */ - .wz-discover > .globalQueryBar > - .euiFlexGroup.kbnQueryBar.kbnQueryBar--withDatePicker { + .wz-discover + > .globalQueryBar + > .euiFlexGroup.kbnQueryBar.kbnQueryBar--withDatePicker { flex-wrap: wrap; margin-left: 0; margin-right: 0; } - .wz-discover > .globalQueryBar > - .euiFlexGroup.kbnQueryBar.kbnQueryBar--withDatePicker > - .euiFlexItem { + .wz-discover + > .globalQueryBar + > .euiFlexGroup.kbnQueryBar.kbnQueryBar--withDatePicker + > .euiFlexItem { width: 100% !important; -ms-flex-preferred-size: 100% !important; flex-basis: 100% !important; @@ -1524,27 +1537,28 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu margin-bottom: 16px !important; } - .wz-discover > .globalQueryBar > - .kbnQueryBar--withDatePicker > :first-child { + .wz-discover > .globalQueryBar > .kbnQueryBar--withDatePicker > :first-child { order: 1; margin-top: -8px; } - .wz-discover > .globalQueryBar > - .kbnQueryBar--withDatePicker > - .euiFlexItem.euiFlexItem--flexGrowZero > - .euiFlexGroup > - .euiFlexItem.kbnQueryBar__datePickerWrapper > - .euiFlexGroup { + .wz-discover + > .globalQueryBar + > .kbnQueryBar--withDatePicker + > .euiFlexItem.euiFlexItem--flexGrowZero + > .euiFlexGroup + > .euiFlexItem.kbnQueryBar__datePickerWrapper + > .euiFlexGroup { width: 100%; } - .wz-discover > .globalQueryBar > - .kbnQueryBar--withDatePicker > - .euiFlexItem.euiFlexItem--flexGrowZero > - .euiFlexGroup > - .euiFlexItem.kbnQueryBar__datePickerWrapper { - flex-grow: 1!important; + .wz-discover + > .globalQueryBar + > .kbnQueryBar--withDatePicker + > .euiFlexItem.euiFlexItem--flexGrowZero + > .euiFlexGroup + > .euiFlexItem.kbnQueryBar__datePickerWrapper { + flex-grow: 1 !important; max-width: none; } } @@ -1561,22 +1575,21 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu overflow: hidden; } } - } + } } @media (min-width: 1600px) { - .agents-evolution-visualization{ + .agents-evolution-visualization { width: 35vw; } .agents-details-card { width: 55vw; } - } @media (max-width: 1599px) { - .agents-evolution-visualization{ + .agents-evolution-visualization { width: 30vw; } @@ -1586,23 +1599,23 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu } @media (max-width: 1439px) { - .agents-evolution-visualization{ + .agents-evolution-visualization { width: 25vw; } } -@media only screen and (max-width: 1200px){ - .agents-evolution-visualization-group{ +@media only screen and (max-width: 1200px) { + .agents-evolution-visualization-group { flex-wrap: wrap; } - .agents-evolution-visualization{ + .agents-evolution-visualization { width: 100vw; } .agents-details-card { width: 100vw; } - .agents-status-pie{ + .agents-status-pie { flex-grow: 1 !important; } } @@ -1629,12 +1642,11 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu background-color: transparent !important; } - .ace_scrollbar-v { - margin-top: -10px!important; + margin-top: -10px !important; } .ace_autocomplete { - width: 390px!important; + width: 390px !important; } .wz-devtools { @@ -1642,14 +1654,13 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu margin: 16px; } .wz-devtools-tab .euiButtonEmpty__text { - height:24px; + height: 24px; text-decoration: none !important; } - .history-list { background-color: white; - border: 1px solid #80808061; + border: 1px solid #80808061; max-height: 25vh; overflow: auto; border-radius: 5px; @@ -1658,20 +1669,20 @@ div.euiPopover__panel.euiPopover__panel-isOpen.euiPopover__panel--bottom.wz-menu .history-list-item { padding: 10px; font-size: 14px; - border-bottom: 1px solid #80808061 ; + border-bottom: 1px solid #80808061; } .history-list-item:hover { - background-color:#a4a0e11a; + background-color: #a4a0e11a; } .history-list-item-active { - background-color:#a09dd326 !important; + background-color: #a09dd326 !important; } .history-list-item:last-child { padding: 10px; - border:none; + border: none; } iframe.width-changed { @@ -1691,7 +1702,7 @@ iframe.width-changed { } @media only screen and (max-width: 1200px) { - .wideElementsDevTools { + .wideElementsDevTools { display: none; } /* .selectDevTools { @@ -1703,7 +1714,7 @@ iframe.width-changed { } .code-block-log-viewer-container { - max-width: calc(100vw - 41*2px); + max-width: calc(100vw - 41 * 2px); } .dscFieldDetails__barContainer { @@ -1741,26 +1752,26 @@ iframe.width-changed { .wz-user-select-none { -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .wz-flex-basis-auto { flex-basis: auto !important; } -.wz-euiCard-no-title{ +.wz-euiCard-no-title { .euiCard__title, - .euiCard__description - { + .euiCard__description { display: none; } } /* Custom Searchbar styles */ -.application .filters-search-bar .globalQueryBar, .app-container .filters-search-bar .globalQueryBar { +.application .filters-search-bar .globalQueryBar, +.app-container .filters-search-bar .globalQueryBar { padding: 0 !important; } @@ -1776,7 +1787,7 @@ iframe.width-changed { @media only screen and (max-width: 767px) { .header-global-wrapper + .app-wrapper:not(.hidden-chrome) { - left: 0!important; + left: 0 !important; } .agents-details-card { @@ -1798,11 +1809,11 @@ iframe.width-changed { } .wz-flex { - display: flex; + display: flex; } .wz-callout-message { - margin-top: 10px; - display: flex; - flex-direction: row; + margin-top: 10px; + display: flex; + flex-direction: row; } From 3099adbe2f98984a421aa93fdfe08a4aff21b85c Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 7 Dec 2022 14:18:32 -0300 Subject: [PATCH 16/34] cleaning code --- public/controllers/agent/components/register-agent.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 3051e0e247..a48657bfdb 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -9,7 +9,7 @@ * * Find more information about this on the LICENSE file. */ -import React, { Component, Fragment, useState } from 'react'; +import React, { Component, Fragment } from 'react'; import { version } from '../../../../package.json'; import { WazuhConfig } from '../../../react-services/wazuh-config'; import { @@ -304,7 +304,6 @@ export const RegisterAgent = withErrorBoundary( } setVersion(selectedVersion) { - console.log(selectedVersion, 'sel'); this.setState({ selectedVersion, selectedArchitecture: '' }); } From f35a06f97d8fe9d3aa3d9f95973a44371bc23bd9 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 12 Dec 2022 13:01:39 -0300 Subject: [PATCH 17/34] clean code --- public/controllers/agent/components/register-agent.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index a48657bfdb..7b58412dda 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -291,10 +291,6 @@ export const RegisterAgent = withErrorBoundary( this.setState({ agentName: event.target.value }); } - setAgentName(event) { - this.setState({ agentName: event.target.value }); - } - setGroupName(selectedGroup) { this.setState({ selectedGroup }); } From a0b17e888175b22116468d52af5bf0620d5a8069 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 12 Dec 2022 13:50:42 -0300 Subject: [PATCH 18/34] fixed windows command --- public/controllers/agent/components/register-agent.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 7b58412dda..a4834aca62 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -110,8 +110,8 @@ export const RegisterAgent = withErrorBoundary( deb: this.systemSelector(), ubu: this.systemSelector(), oraclelinux: this.systemSelector(), - macos: 'sudo /Library/Ossec/bin/wazuh-control start', - win: 'NET START WazuhSvc', + macos: this.systemSelectorWazuhControlMacos(), + win: this.systemSelectorNet(), }; } @@ -257,7 +257,7 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion === 'windowsserver2008' || this.state.selectedVersion === 'windows7' ) { - return 'update-rc.d wazuh-agent defaults && service wazuh-agent start'; + return 'NET START WazuhSvc'; } } @@ -2084,7 +2084,6 @@ apk add wazuh-agent`, }, ] : []), - ...(!missingOSSelection.length && this.state.selectedOS !== 'rpm' && this.state.selectedOS !== 'deb' && From 95132f6a9cb12836b2a208b7b70d52e89e247e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chantal=20Bel=C3=A9n=20kelm?= <99441266+chantal-kelm@users.noreply.github.com> Date: Thu, 15 Dec 2022 07:56:51 -0300 Subject: [PATCH 19/34] Update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc4b6bdb81..8c51062a19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Added powerPC architecture in redhat7, in the section 'Deploy new agent'. [4833](https://github.com/wazuh/wazuh-kibana-app/pull/4833) - Added a centralized service to handle the requests [#4831](https://github.com/wazuh/wazuh-kibana-app/pull/4831) - Added data-test-subj create policy [#4873](https://github.com/wazuh/wazuh-kibana-app/pull/4873) -- Deploy new agent section: Added extra steps message and new command for windows xp and windows server 2008, added alpine agent with all its steps. [#4974](https://github.com/wazuh/wazuh-kibana-app/pull/4974) +- Deploy new agent section: Added extra steps message and new command for windows xp and windows server 2008, added alpine agent with all its steps. [#4933](https://github.com/wazuh/wazuh-kibana-app/pull/4933) ### Changed @@ -47,7 +47,7 @@ All notable changes to the Wazuh app project will be documented in this file. - 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 a bug that caused the flyouts to close when clicking inside them [#4638](https://github.com/wazuh/wazuh-kibana-app/pull/4638) -- Deploy new agent section: Fixed the way macos versions and architectures were displayed, fixed the way agents were displayed, fixed the way ubuntu versions were displayed. [#4974](https://github.com/wazuh/wazuh-kibana-app/pull/4974) +- Deploy new agent section: Fixed the way macos versions and architectures were displayed, fixed the way agents were displayed, fixed the way ubuntu versions were displayed. [#4933](https://github.com/wazuh/wazuh-kibana-app/pull/4933) ### Removed From 0fb2f43aae92af317024c4bbc0e06b31639ed41d Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 19 Dec 2022 11:46:57 -0300 Subject: [PATCH 20/34] clean code --- public/controllers/agent/components/register-agent.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index b36aca6cf2..d8f16ca27d 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1335,7 +1335,6 @@ apk add wazuh-agent`, options={options} idSelected={idSelected} onChange={onChange} - // className={'osButtonsStyle'} className={'wz-flex'} /> ); @@ -1482,7 +1481,6 @@ apk add wazuh-agent`, options={options} idSelected={idSelected} onChange={onChange} - // className={'osButtonsStyleMac'} /> ); }; From 480c4b8728310c182a1010b9bfa67df338ff6fbb Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 19 Dec 2022 13:27:23 -0300 Subject: [PATCH 21/34] clean code --- public/controllers/agent/components/register-agent.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index d8f16ca27d..c750ff3532 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -34,7 +34,6 @@ import { EuiIcon, EuiSwitch, EuiLink, - EuiLink, } from '@elastic/eui'; import { WzRequest } from '../../../react-services/wz-request'; import { withErrorBoundary } from '../../../components/common/hocs'; From b2354231df41d3feed249a6982819577a7a9ce27 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Fri, 16 Dec 2022 09:01:49 -0300 Subject: [PATCH 22/34] deploy new agent section: command fixed for solaris --- .../controllers/agent/components/register-agent.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index c750ff3532..35fcc1516b 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -641,15 +641,15 @@ export const RegisterAgent = withErrorBoundary( `${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`; + return `https://packages.wazuh.com/4.x/solaris/i386/10/wazuh-agent_v${this.state.wazuhVersion}-sol10-i386.pkg`; case 'solaris10-sparc': - return `https://packages.wazuh.com/4.x/solaris/sparc/10/wazuh-agent-${this.state.wazuhVersion}-sol10-sparc.pkg`; + return `https://packages.wazuh.com/4.x/solaris/sparc/10/wazuh-agent_v${this.state.wazuhVersion}-sol10-sparc.pkg`; case 'solaris11-i386': - return `https://packages.wazuh.com/4.x/solaris/i386/11/wazuh-agent-${this.state.wazuhVersion}-sol11-i386.p5p`; + return `https://packages.wazuh.com/4.x/solaris/i386/11/wazuh-agent_v${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_v${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`; + return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent_v${this.state.wazuhVersion}-sol11-sparc.p5p`; } } @@ -949,7 +949,7 @@ apk add 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()}&& ${ + solText: `sudo curl -so wazuh-agent.p5p ${this.optionalPackages()}/wazuh-agent.p5p ${this.agentNameVariable()}&& ${ this.state.selectedVersion == 'solaris11' ? 'pkg install -g wazuh-agent.p5p wazuh-agent' : 'pkgadd -d wazuh-agent.pkg' From 269c3d2b68c28494e390d3c362de3ceec6ed026b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chantal=20Bel=C3=A9n=20kelm?= <99441266+chantal-kelm@users.noreply.github.com> Date: Fri, 16 Dec 2022 13:01:57 -0300 Subject: [PATCH 23/34] Fix the agent installation command for macOS (#4968) * Fixed the agent installation command for macOS * CHANGELOG * Update CHANGELOG.md --- public/controllers/agent/components/register-agent.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 35fcc1516b..a5575e2a36 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -368,6 +368,14 @@ export const RegisterAgent = withErrorBoundary( agentNameVariable() { let agentName = `WAZUH_AGENT_NAME='${this.state.agentName}' `; + if ( + this.state.selectedOS === 'macos' && + this.state.selectedArchitecture && + this.state.agentName !== '' + ) { + return agentName.replace(/=/g, ' '); + } + if (this.state.selectedArchitecture && this.state.agentName !== '') { return agentName; } else { From cdf05aa4053768f0e38052c7c40915680965d081 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:07:20 -0300 Subject: [PATCH 24/34] Fix agent deployment instructions for HP-UX and Solaris (#4943) * removing auto-deploy variables in hp and solaris * hide wazuh server address sections, assign group and assign name to agent when os is hp or solaris * update hp command * removing auto-deploy variables in alpine * move message additional installation steps * links and messages os * changelog --- CHANGELOG.md | 1 + .../agent/components/register-agent.js | 446 +++++++++++------- 2 files changed, 280 insertions(+), 167 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8ab0ffd6d..bd085d30fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ All notable changes to the Wazuh app project will be documented in this file. - 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 a bug that caused the flyouts to close when clicking inside them [#4638](https://github.com/wazuh/wazuh-kibana-app/pull/4638) - Deploy new agent section: Fixed the way macos versions and architectures were displayed, fixed the way agents were displayed, fixed the way ubuntu versions were displayed. [#4933](https://github.com/wazuh/wazuh-kibana-app/pull/4933) +- Fixed agent deployment instructions for HP-UX and Solaris. [#4943](https://github.com/wazuh/wazuh-kibana-app/pull/4943) - Fixed agent installation command for macOS in the deploy new agent section. [#4968](https://github.com/wazuh/wazuh-kibana-app/pull/4968) - Fixed vulnerabilities default last scan date formatter [#4975](https://github.com/wazuh/wazuh-kibana-app/pull/4975) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index a5575e2a36..b4b3162170 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -272,10 +272,12 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion === 'solaris10' || this.state.selectedVersion === 'solaris11' || this.state.selectedVersion === '6.1 TL9' || - this.state.selectedVersion === '11.31' || this.state.selectedVersion === '3.12.12' ) { return '/var/ossec/bin/wazuh-control start'; + } else this.state.selectedVersion === '11.31'; + { + return '/sbin/init.d/wazuh-agent start'; } } @@ -857,16 +859,14 @@ export const RegisterAgent = withErrorBoundary( 'user-manual/agents/agent-connection.html', appVersionMajorDotMinor, ); - const urlWindowsPackage = `https://packages.wazuh.com/4.x/windows/wazuh-agent-${this.state.wazuhVersion}-1.msi`; - const textAndLinkToCheckConnectionDocumentation = ( -

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

    + const urlWazuhAgentEnrollment = webDocumentationLink( + 'user-manual/agent-enrollment/index.html', + appVersionMajorDotMinor, ); + + const urlWindowsPackage = `https://packages.wazuh.com/4.x/windows/wazuh-agent-${this.state.wazuhVersion}-1.msi`; + const missingOSSelection = this.checkMissingOSSelection(); const agentName = ( @@ -963,7 +963,7 @@ apk add 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`, + hpText: `cd / && sudo curl -so ${this.optionalPackages()} && sudo 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()}`, @@ -980,15 +980,35 @@ apk add wazuh-agent`, 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 warningCommand = ( + const textAndLinkToCheckConnectionDocumentation = ( +

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

    + ); + const messageExtraSteps = (

    - Please - download - the package from our repository and copy it to the Windows system - where you are going to install it. Then run the following command to - perform the installation: + After installing the agent, you need to enroll it in the Wazuh server. + Check the Wazuh agent enrollment{' '} + + Wazuh agent enrollment{' '} + + section to learn more.

    ); + const warningCommand = ( + <> +

    + Please + download + the package from our repository and copy it to the Windows system + where you are going to install it. Then run the following command to + perform the installation: +

    + + ); const windowsAdvice = this.state.selectedOS === 'win' && ( <> @@ -1037,10 +1057,17 @@ apk add wazuh-agent`, ) : 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. -

    + {this.state.agentName.length > 0 ? ( +

    + You can use this command to install and enroll the Wazuh + agent. +

    + ) : ( +

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

    + )} + <> + + + ) : ( '' )} -
    {this.state.wazuhPassword && !this.state.showPassword @@ -1075,6 +1104,126 @@ apk add wazuh-agent`, )}
    + {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 == '3.12.12' ? ( + + 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.needsPassword && ( {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''}
    ), @@ -1238,6 +1390,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''} ), @@ -1268,6 +1423,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''} ), @@ -1298,6 +1456,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''} ), @@ -1328,6 +1489,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''}
    ), @@ -1530,6 +1694,7 @@ apk add wazuh-agent`, } } }; + console.log(this.state.selectedOS, 'oss'); const steps = [ { @@ -1547,21 +1712,12 @@ apk add wazuh-agent`, ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsRedHat, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1608,21 +1764,12 @@ apk add wazuh-agent`, ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsCentos, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1643,23 +1790,12 @@ apk add wazuh-agent`, ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsDebian, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1667,20 +1803,12 @@ apk add wazuh-agent`, ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsUbuntu, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1740,21 +1868,12 @@ apk add wazuh-agent`, ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsSolaris, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1762,20 +1881,12 @@ apk add wazuh-agent`, ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsAix, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1783,20 +1894,12 @@ apk add wazuh-agent`, ? [ { 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), - ), + children: buttonGroup( + 'Choose the version', + versionButtonsHPUX, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1804,20 +1907,12 @@ apk add wazuh-agent`, ? [ { title: 'Choose the version', - children: - this.state.selectedVersion == '3.12.12' - ? buttonGroupWithMessage( - 'Choose the version', - versionButtonAlpine, - this.state.selectedVersion, - version => this.setVersion(version), - ) - : buttonGroup( - 'Choose the version', - versionButtonAlpine, - this.state.selectedVersion, - version => this.setVersion(version), - ), + children: buttonGroup( + 'Choose the version', + versionButtonAlpine, + this.state.selectedVersion, + version => this.setVersion(version), + ), }, ] : []), @@ -1972,18 +2067,26 @@ apk add wazuh-agent`, }, ] : []), - { - title: 'Wazuh server address', - children: ( - - - - ), - }, + ...(!( + this.state.selectedOS == 'hp' || + this.state.selectedOS == 'sol' || + this.state.selectedOS == 'alpine' + ) + ? [ + { + title: 'Wazuh server address', + children: ( + + + + ), + }, + ] + : []), ...(!(!this.state.needsPassword || this.state.hidePasswordInput) ? [ { @@ -1992,16 +2095,24 @@ apk add wazuh-agent`, }, ] : []), - { - title: 'Assign a name and a group to the agent', - children: ( - - {agentName} - {groupInput} - {agentGroup} - - ), - }, + ...(!( + this.state.selectedOS == 'hp' || + this.state.selectedOS == 'sol' || + this.state.selectedOS == 'alpine' + ) + ? [ + { + title: 'Assign a name and a group to the agent', + children: ( + + {agentName} + {groupInput} + {agentGroup} + + ), + }, + ] + : []), { title: 'Install and enroll the agent', children: this.state.gotErrorRegistrationServiceInfo ? ( @@ -2031,7 +2142,8 @@ apk add wazuh-agent`, this.state.selectedOS == 'sol' || this.state.selectedOS == 'aix' || this.state.selectedOS == 'hp' || - this.state.selectedOS == 'alpine' + this.state.selectedOS == 'alpine' || + this.state.selectedOS == '' ? [ { title: 'Start the agent', From edcf126ac34da615e7b026ce4ea2fbc54561b670 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 19 Dec 2022 15:51:08 -0300 Subject: [PATCH 25/34] red hat, centos and windows commands fixed --- .../agent/components/register-agent.js | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index b4b3162170..907ad59790 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -83,6 +83,14 @@ export const RegisterAgent = withErrorBoundary( super(props); this.wazuhConfig = new WazuhConfig(); this.configuration = this.wazuhConfig.getConfig(); + this.addToVersion = '-1'; + this.wazuhRpmVariable = '/wazuh-agent.rpm'; + this.wazuhDebVariable = '/wazuh-agent.deb'; + this.wazuhMsiVariable = '/wazuh-agent.msi'; + this.wazuhPkgVariable = '/wazuh-agent.pkg'; + this.wazuhP5pVariable = '/wazuh-agent.p5p'; + this.wazuhTarVariable = '/wazuh-agent.tar'; + this.state = { status: 'incomplete', selectedOS: '', @@ -390,29 +398,29 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } @@ -467,29 +475,29 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } @@ -638,11 +646,11 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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}.armv7hl.rpm${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } @@ -951,11 +959,9 @@ apk add wazuh-agent`, }-1.msi /q ${this.optionalDeploymentVariables()}` : `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()}`, + }-1.msi${ + this.wazuhMsiVariable + } -OutFile \${env:tmp}\\wazuh-agent.msi; msiexec.exe /i \${env:tmp}\\wazuh-agent.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 wazuh-agent.p5p ${this.optionalPackages()}/wazuh-agent.p5p ${this.agentNameVariable()}&& ${ this.state.selectedVersion == 'solaris11' From 7e38a16b6268f222235bacee76ff2bdbac9f1ffe Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 20 Dec 2022 11:38:08 -0300 Subject: [PATCH 26/34] Deploy new agent section: change the commands for all os --- .../agent/components/register-agent.js | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 907ad59790..902a3762e9 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -506,21 +506,21 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } @@ -529,17 +529,17 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } @@ -548,52 +548,52 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; case 'amazonlinux2-powerpc': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}.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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; case 'powerpc': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64el.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64el.deb${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; } } @@ -602,17 +602,17 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; case 'busterorgreater-powerpc': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64el.deb`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64el.deb${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; } } @@ -621,23 +621,23 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; case 'ubuntu15-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}_amd64.deb${this.wazuhDebVariable}`; 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${this.wazuhDebVariable}`; } } @@ -659,15 +659,15 @@ export const RegisterAgent = withErrorBoundary( `${this.state.selectedVersion}-${this.state.selectedArchitecture}` ) { case 'solaris10-i386': - return `https://packages.wazuh.com/4.x/solaris/i386/10/wazuh-agent_v${this.state.wazuhVersion}-sol10-i386.pkg`; + return `https://packages.wazuh.com/4.x/solaris/i386/10/wazuh-agent_v${this.state.wazuhVersion}-sol10-i386.pkg${this.wazuhPkgVariable}`; case 'solaris10-sparc': - return `https://packages.wazuh.com/4.x/solaris/sparc/10/wazuh-agent_v${this.state.wazuhVersion}-sol10-sparc.pkg`; + return `https://packages.wazuh.com/4.x/solaris/sparc/10/wazuh-agent_v${this.state.wazuhVersion}-sol10-sparc.pkg${this.wazuhPkgVariable}`; case 'solaris11-i386': - return `https://packages.wazuh.com/4.x/solaris/i386/11/wazuh-agent_v${this.state.wazuhVersion}-sol11-i386.p5p`; + return `https://packages.wazuh.com/4.x/solaris/i386/11/wazuh-agent_v${this.state.wazuhVersion}-sol11-i386.p5p${this.wazuhP5pVariable}`; case 'solaris11-sparc': - return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent_v${this.state.wazuhVersion}-sol11-sparc.p5p`; + return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent_v${this.state.wazuhVersion}-sol11-sparc.p5p${this.wazuhP5pVariable}`; default: - return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent_v${this.state.wazuhVersion}-sol11-sparc.p5p`; + return `https://packages.wazuh.com/4.x/solaris/sparc/11/wazuh-agent_v${this.state.wazuhVersion}-sol11-sparc.p5p${this.wazuhP5pVariable}`; } } @@ -676,9 +676,9 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } @@ -687,9 +687,9 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhTarVariable}`; 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${this.wazuhTarVariable}`; } } From ae555684fca49c6e80a29debb41a20f85582f73e Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 20 Dec 2022 13:27:35 -0300 Subject: [PATCH 27/34] Deploy new agent section: change commands for all os --- .../agent/components/register-agent.js | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 902a3762e9..a8df5fc3a4 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -724,7 +724,7 @@ export const RegisterAgent = withErrorBoundary( 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${this.wazuhRpmVariable}`; } } @@ -932,25 +932,20 @@ export const RegisterAgent = withErrorBoundary( alpineText: `wget -O /etc/apk/keys/alpine-devel@wazuh.com-633d7457.rsa.pub ${this.optionalPackages()} >> /etc/apk/repositories && \ apk update && \ apk add wazuh-agent`, - 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-${ + debText: `curl -so wazuh-agent.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i .${ + this.wazuhDebVariable + }`, + ubuText: `curl -so wazuh-agent.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i .${ + this.wazuhDebVariable + }`, + macosText: `curl -so wazuh-agent.pkg https://packages.wazuh.com/4.x/macos/wazuh-agent-${ this.state.wazuhVersion - }.pkg -target /`, + }-1.pkg${ + this.wazuhPkgVariable + } && sudo launchctl setenv ${this.optionalDeploymentVariables()}${this.agentNameVariable()}&& sudo installer -pkg .${ + this.wazuhPkgVariable + } -target /`, winText: this.state.selectedVersion == 'windowsxp' || this.state.selectedVersion == 'windowsserver2008' @@ -962,23 +957,27 @@ apk add wazuh-agent`, }-1.msi${ this.wazuhMsiVariable } -OutFile \${env:tmp}\\wazuh-agent.msi; msiexec.exe /i \${env:tmp}\\wazuh-agent.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 wazuh-agent.p5p ${this.optionalPackages()}/wazuh-agent.p5p ${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.state.selectedVersion == 'solaris11' + ? 'wazuh-agent.p5p' + : 'wazuh-agent.pkg' + } ${this.optionalPackages()}${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 groupadd wazuh && sudo useradd -G wazuh wazuh && sudo tar -xvf wazuh-agent.tar`, + hpText: `cd / && sudo curl -so wazuh-agent.tar ${this.optionalPackages()} && sudo 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()}`, + oraclelinuxText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}${ + this.wazuhRpmVariable + }`, 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.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i .${ + this.wazuhDebVariable + }`, }; const field = `${this.state.selectedOS}Text`; From 884107f40d1e29dec589547b53f2a302df7e2964 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 20 Dec 2022 13:32:52 -0300 Subject: [PATCH 28/34] clean code --- public/controllers/agent/components/register-agent.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index a8df5fc3a4..12ca44256d 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1221,14 +1221,6 @@ apk add wazuh-agent`, ) : ( '' )} - {/* - { - - } */} {this.state.needsPassword && ( Date: Wed, 21 Dec 2022 09:03:33 -0300 Subject: [PATCH 29/34] update commands --- public/controllers/agent/components/register-agent.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 12ca44256d..2af3dd8516 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -591,7 +591,7 @@ export const RegisterAgent = withErrorBoundary( case 'x86_64': return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb${this.wazuhDebVariable}`; case 'powerpc': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64el.deb${this.wazuhDebVariable}`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_ppc64el.deb${this.wazuhDebVariable}`; default: return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb${this.wazuhDebVariable}`; } @@ -610,7 +610,7 @@ export const RegisterAgent = withErrorBoundary( case 'busterorgreater-x86_64': return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb${this.wazuhDebVariable}`; case 'busterorgreater-powerpc': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}.ppc64el.deb${this.wazuhDebVariable}`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_ppc64el.deb${this.wazuhDebVariable}`; default: return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb${this.wazuhDebVariable}`; } @@ -635,7 +635,7 @@ export const RegisterAgent = withErrorBoundary( case 'ubuntu15-armhf': return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_armhf.deb${this.wazuhDebVariable}`; case 'ubuntu15-x86_64': - return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}_amd64.deb${this.wazuhDebVariable}`; + return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb${this.wazuhDebVariable}`; default: return `https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}${this.addToVersion}_amd64.deb${this.wazuhDebVariable}`; } From fc83f3f29fbdb0b062a577be51d3309e55973c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chantal=20Bel=C3=A9n=20kelm?= <99441266+chantal-kelm@users.noreply.github.com> Date: Wed, 21 Dec 2022 09:13:27 -0300 Subject: [PATCH 30/34] Deploy new agents: Update commands --- .../agent/components/register-agent.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 2af3dd8516..da9edb1559 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -448,25 +448,25 @@ export const RegisterAgent = withErrorBoundary( `${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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; } } @@ -566,7 +566,7 @@ export const RegisterAgent = withErrorBoundary( case 'amazonlinux2-armhf': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm${this.wazuhRpmVariable}`; 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${this.wazuhRpmVariable}`; case 'amazonlinux2022-i386': return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.i386.rpm${this.wazuhRpmVariable}`; case 'amazonlinux2022-aarch64': @@ -648,7 +648,7 @@ export const RegisterAgent = withErrorBoundary( case 'leap15-x86_64': return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm${this.wazuhRpmVariable}`; case 'leap15-ARM64': - return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}.armv7hl.rpm${this.wazuhRpmVariable}`; + return `https://packages.wazuh.com/4.x/yum/x86_64/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.armv7hl.rpm${this.wazuhRpmVariable}`; default: return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm${this.wazuhRpmVariable}`; } From 4e7dd1c4c5e47ef9bfbe78d80fb39ddb68aa9985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chantal=20Bel=C3=A9n=20kelm?= <99441266+chantal-kelm@users.noreply.github.com> Date: Wed, 21 Dec 2022 09:52:50 -0300 Subject: [PATCH 31/34] Deploy new agents: Update commands --- .../controllers/agent/components/register-agent.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index da9edb1559..7a0cdc5c6d 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -429,17 +429,17 @@ export const RegisterAgent = withErrorBoundary( `${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"`; + return `https://packages.wazuh.com/key/cicd%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"`; + return `https://packages.wazuh.com/key/cicd%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"`; + return `https://packages.wazuh.com/key/cicd%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"`; + return `https://packages.wazuh.com/key/cicd%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"`; + return `https://packages.wazuh.com/key/cicd%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"`; + return `https://packages.wazuh.com/key/cicd%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; } } @@ -929,7 +929,7 @@ export const RegisterAgent = withErrorBoundary( const customTexts = { rpmText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, - alpineText: `wget -O /etc/apk/keys/alpine-devel@wazuh.com-633d7457.rsa.pub ${this.optionalPackages()} >> /etc/apk/repositories && \ + alpineText: `wget -O /etc/apk/keys/cicd@wazuh.com-633d7457.rsa.pub ${this.optionalPackages()} >> /etc/apk/repositories && \ apk update && \ apk add wazuh-agent`, centText: `sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}yum install -y ${this.optionalPackages()}`, From dc47606c9bdecae39f6e491979c6d44d1656a170 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 21 Dec 2022 14:03:33 -0300 Subject: [PATCH 32/34] update commnads --- .../agent/components/register-agent.js | 60 +++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 7a0cdc5c6d..4e1c77e9e4 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -34,6 +34,9 @@ import { EuiIcon, EuiSwitch, EuiLink, + EuiFormRow, + EuiFormControlLayout, + EuiForm, } from '@elastic/eui'; import { WzRequest } from '../../../react-services/wz-request'; import { withErrorBoundary } from '../../../components/common/hocs'; @@ -102,6 +105,8 @@ export const RegisterAgent = withErrorBoundary( wazuhVersion: '', serverAddress: '', agentName: '', + agentNameError: false, + badCharacters: [], wazuhPassword: '', groups: [], selectedGroup: [], @@ -298,7 +303,26 @@ export const RegisterAgent = withErrorBoundary( } setAgentName(event) { + const validation = /^[a-z0-9-_.]+$/i; this.setState({ agentName: event.target.value }); + if ( + validation.test(event.target.value) || + event.target.value.length <= 0 + ) { + this.setState({ agentNameError: false }); + this.setState({ badCharacters: [] }); + } else { + let badCharacters = event.target.value + .split('') + .map(char => char.replace(validation, '')) + .join(''); + badCharacters = badCharacters + .split('') + .map(char => char.replace(/\s/, 'whitespace')); + const characters = [...new Set(badCharacters)]; + this.setState({ badCharacters: characters }); + this.setState({ agentNameError: true }); + } } setGroupName(selectedGroup) { @@ -878,11 +902,24 @@ export const RegisterAgent = withErrorBoundary( const missingOSSelection = this.checkMissingOSSelection(); const agentName = ( - this.setAgentName(event)} - /> + + ` "${char}"`)} + ${this.state.badCharacters.length <= 1 ? 'is' : 'are'} + not valid. Allowed characters are A-Z, a-z, ".", "-", "_"`, + ]} + > + this.setAgentName(event)} + /> + + ); const groupInput = ( <> @@ -1649,6 +1686,7 @@ apk add wazuh-agent`, options={options} idSelected={idSelected} onChange={onChange} + // className={'osButtonsStyleMac'} /> ); }; @@ -2113,6 +2151,12 @@ apk add wazuh-agent`, title: 'Install and enroll the agent', children: this.state.gotErrorRegistrationServiceInfo ? ( calloutErrorRegistrationServiceInfo + ) : this.state.agentNameError ? ( + ) : missingOSSelection.length ? ( ) : missingOSSelection.length ? ( Date: Wed, 21 Dec 2022 14:25:39 -0300 Subject: [PATCH 33/34] merge 4.4-2.4-wzd --- .../agent/components/register-agent.js | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 4e1c77e9e4..d77427f52e 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -288,8 +288,7 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion === '3.12.12' ) { return '/var/ossec/bin/wazuh-control start'; - } else this.state.selectedVersion === '11.31'; - { + } else { return '/sbin/init.d/wazuh-agent start'; } } @@ -453,17 +452,17 @@ export const RegisterAgent = withErrorBoundary( `${this.state.selectedVersion}-${this.state.selectedArchitecture}` ) { case '3.12.12-i386': - return `https://packages.wazuh.com/key/cicd%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + return 'https://packages.wazuh.com/key/cicd%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/cicd%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + return 'https://packages.wazuh.com/key/cicd%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/cicd%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + return 'https://packages.wazuh.com/key/cicd%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/cicd%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + return 'https://packages.wazuh.com/key/cicd%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/cicd%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + return 'https://packages.wazuh.com/key/cicd%40wazuh.com-633d7457.rsa.pub && echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"'; default: - return `https://packages.wazuh.com/key/cicd%40wazuh.com-633d7457.rsa.pub && \echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"`; + return 'https://packages.wazuh.com/key/cicd%40wazuh.com-633d7457.rsa.pub && echo "https://packages.wazuh.com/4.x/alpine/v3.12/main"'; } } @@ -1025,7 +1024,11 @@ apk add wazuh-agent`, const textAndLinkToCheckConnectionDocumentation = (

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

    @@ -1034,7 +1037,7 @@ apk add wazuh-agent`,

    After installing the agent, you need to enroll it in the Wazuh server. Check the Wazuh agent enrollment{' '} - + Wazuh agent enrollment{' '} section to learn more. @@ -1054,7 +1057,7 @@ apk add wazuh-agent`, const windowsAdvice = this.state.selectedOS === 'win' && ( <> -

      +
      • You will need administrator privileges to perform this @@ -2154,7 +2157,7 @@ apk add wazuh-agent`, ) : this.state.agentNameError ? ( ) : missingOSSelection.length ? ( @@ -2192,7 +2195,7 @@ apk add wazuh-agent`, ) : this.state.agentNameError ? ( ) : missingOSSelection.length ? ( From af4c54a60f26843c589df4dbf8d34009c8e9ba56 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 21 Dec 2022 15:53:19 -0300 Subject: [PATCH 34/34] command oracliLinux --- public/controllers/agent/components/register-agent.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index d77427f52e..a2767c893e 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1007,9 +1007,7 @@ apk add wazuh-agent`, hpText: `cd / && sudo curl -so wazuh-agent.tar ${this.optionalPackages()} && sudo 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()}${ - this.wazuhRpmVariable - }`, + 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.deb ${this.optionalPackages()} && sudo ${this.optionalDeploymentVariables()}${this.agentNameVariable()}dpkg -i .${ this.wazuhDebVariable