From 1f0e8d3170f64cbb864f35d46798a9430e25404a Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 10:44:48 -0300 Subject: [PATCH 01/28] accordion and alpine os --- .../agent/components/register-agent.js | 1528 +++++++++++------ .../agent/components/wz-accordion.tsx | 56 + .../controllers/agent/wazuh-config/index.ts | 140 +- 3 files changed, 1139 insertions(+), 585 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 1cbc327079..c0864c53d4 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,12 +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 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); @@ -70,7 +101,8 @@ export const RegisterAgent = withErrorBoundary( udpProtocol: false, showPassword: false, showProtocol: true, - connectionSecure: true + connectionSecure: true, + isAccordionOpen: false, }; this.restartAgentCommand = { rpm: this.systemSelector(), @@ -79,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', }; } @@ -93,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; } @@ -151,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 }); @@ -172,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: '', @@ -181,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'; } } @@ -257,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}' `; } @@ -281,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(',')}' `; } @@ -295,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 ''; @@ -303,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': @@ -332,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': @@ -357,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': @@ -386,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': @@ -407,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': @@ -424,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': @@ -476,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': @@ -493,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': @@ -524,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': @@ -543,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: @@ -559,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: @@ -722,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)} /> ); @@ -789,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)} + /> + )} + +
    + )}
    ); @@ -975,14 +1148,16 @@ export const RegisterAgent = withErrorBoundary( -
    +
    {this.systemSelector()} - {(copy) => ( -
    -

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

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

    Copy command

    + {copy => ( +
    +

    + Copy command +

    )} @@ -1110,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 ( - ) - } + className={'osButtonsStyleMac'} + /> + ); + }; - const onChangeServerAddress = async (selectedNodes) => { - if(selectedNodes.length === 0){ + const onChangeServerAddress = async selectedNodes => { + if (selectedNodes.length === 0) { this.setState({ serverAddress: '', udpProtocol: false, - connectionSecure: null - }) - }else{ + connectionSecure: null, + }); + } else { const nodeSelected = selectedNodes[0]; try { const remoteConfig = await getConnectionConfig(nodeSelected); this.setState({ serverAddress: remoteConfig.serverAddress, udpProtocol: remoteConfig.udpProtocol, - connectionSecure: remoteConfig.connectionSecure - }) - }catch(error){ + connectionSecure: remoteConfig.connectionSecure, + }); + } catch (error) { const options = { context: `${RegisterAgent.name}.onChangeServerAddress`, level: UI_LOGGER_LEVELS.ERROR, @@ -1200,352 +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 +

    )} @@ -1553,14 +2041,14 @@ export const RegisterAgent = withErrorBoundary( ), - }, - ] + }, + ] : []), ]; return (
    - + @@ -1574,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 @@ -1596,7 +2084,7 @@ export const RegisterAgent = withErrorBoundary( {this.state.loading && ( <> - + @@ -1614,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 6bcc784ce432364c1fe95911797b9d8185adc170 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 11:26:51 -0300 Subject: [PATCH 02/28] 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 c0864c53d4..e0120bffd5 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, @@ -75,7 +73,7 @@ import { getConnectionConfig, fetchClusterNodesOptions, } from './register-agent-service'; -import { WzAccordion, PrincipalButtonGroup } from './wz-accordion'; +import { PrincipalButtonGroup } from './wz-accordion'; export const RegisterAgent = withErrorBoundary( class RegisterAgent extends Component { @@ -248,7 +246,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'; @@ -616,14 +613,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`; } @@ -1744,6 +1733,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' || @@ -1781,8 +1785,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', @@ -1970,7 +1973,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 117ebb284e97964a56ca849a92b1fa9182b6ec41 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 13:59:14 -0300 Subject: [PATCH 03/28] 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 e0120bffd5..faf81c74dd 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 { @@ -266,6 +267,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'; @@ -835,6 +837,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{' '} @@ -914,13 +931,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' @@ -945,6 +968,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' && ( <> @@ -1004,6 +1033,17 @@ export const RegisterAgent = withErrorBoundary( /> {windowsAdvice} + {this.state.selectedVersion == 'windowsxp' || + this.state.selectedVersion == 'windowsserver2008' ? ( + + ) : ( + '' + )} +
    {this.state.wazuhPassword && !this.state.showPassword @@ -1613,20 +1653,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), + ), }, ] : []), @@ -1819,6 +1851,7 @@ export const RegisterAgent = withErrorBoundary( ] : []), ...(this.state.selectedVersion == 'windowsxp' || + this.state.selectedVersion == 'windowsserver2008' || this.state.selectedVersion == 'windows8' ? [ { @@ -1943,7 +1976,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', @@ -1976,6 +2010,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' || @@ -2017,6 +2052,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 d1fade8a08c4c4d0d5093d1384588b4f55fdef1a Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 14:04:21 -0300 Subject: [PATCH 04/28] 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 faf81c74dd..e23b1630c7 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -268,7 +268,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'; } @@ -1852,7 +1852,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', @@ -2011,7 +2011,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 63e8a3ca4428ecc93c1136d640fd45681765824a Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 15:09:28 -0300 Subject: [PATCH 05/28] 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 e23b1630c7..6b846d763f 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -185,12 +185,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 }); @@ -422,6 +416,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}` @@ -700,6 +713,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`; } @@ -839,19 +854,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{' '} @@ -1769,14 +1771,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), + ), }, ] : []), @@ -1809,6 +1809,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 281f56377fff1211ba0b514d6457e5d9fc028c65 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 15:27:12 -0300 Subject: [PATCH 06/28] 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 6b846d763f..fb95c51627 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -420,15 +420,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 c5a8643463632b25cf1139a7d1d47bcdc639b60e Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 29 Nov 2022 17:38:15 -0300 Subject: [PATCH 07/28] 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 fb95c51627..71ff3a0ac7 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -421,7 +421,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': @@ -830,6 +830,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 []; } @@ -913,8 +920,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 2d754efa3b07cdea6d33dfd8c84e5ead676b1e5e Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 10:25:57 -0300 Subject: [PATCH 08/28] message install and start alpine --- .../agent/components/register-agent.js | 45 +++---- public/styles/component.scss | 112 +++++++++--------- 2 files changed, 71 insertions(+), 86 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 71ff3a0ac7..86ad74ddcf 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -210,14 +210,6 @@ export const RegisterAgent = withErrorBoundary( } selectOS(os) { - if (os == 'macos') { - this.setState({ - selectedOS: os, - selectedVersion: 'sierra', - selectedArchitecture: '', - selectedSYS: '', - }); - } this.setState({ selectedOS: os, selectedVersion: '', @@ -279,7 +271,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'; } @@ -310,6 +303,7 @@ export const RegisterAgent = withErrorBoundary( } setVersion(selectedVersion) { + console.log(selectedVersion, 'sel'); this.setState({ selectedVersion, selectedArchitecture: '' }); } @@ -421,17 +415,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"`; } } @@ -927,17 +921,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 @@ -995,8 +978,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' && ( @@ -2060,7 +2046,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 a44e860759..7fa8976546 100644 --- a/public/styles/component.scss +++ b/public/styles/component.scss @@ -16,124 +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; + display: grid; + grid-template-columns: repeat(5, 1fr); + grid-gap: 10px; } .osButtonsStyleMac { - display: grid; - grid-template-columns: repeat(3, 1fr); - grid-gap: 10px; + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-gap: 10px; } .message { - margin-top: 10px; - display: flex; - flex-direction: row; + margin-top: 10px; + display: flex; + flex-direction: row; } From 021980a486c3f539fa97d5c544b09aec074dee40 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 10:44:54 -0300 Subject: [PATCH 09/28] CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19e1f51f48..8222bc89d5 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) +- 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 @@ -44,6 +45,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed pagination to SCA table [#4653](https://github.com/wazuh/wazuh-kibana-app/issues/4653) - Fixed WAZUH_PROTOCOL param suggestion [#4849](https://github.com/wazuh/wazuh-kibana-app/pull/4849) - Raspbian OS, Ubuntu, Amazon Linux and Amazon Linux 2 commands in the wizard deploy agent now change when a different architecture is selected [#4876](https://github.com/wazuh/wazuh-kibana-app/pull/4876) [#4880](https://github.com/wazuh/wazuh-kibana-app/pull/4880) +- Fixed 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) ## Wazuh v4.3.10 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 4311 @@ -67,7 +69,7 @@ All notable changes to the Wazuh app project will be documented in this file. ### Fixed -- Wazuh.yml review: fixed link to web documentation, improved in-file documentation and fixed some grammatical errors. [#4378](https://github.com/wazuh/wazuh-kibana-app/pull/4378) [#4399](https://github.com/wazuh/wazuh-kibana-app/pull/4399) +- Wazuh.yml review: fixed link to web documentation, improved in-file documentation and fixed some grammatical errors. [#4378](https://github.com/wazuh/wazuh-kibana-app/pull/4378) [#4399](https://github.com/wazuh/wazuh-kibana-app/pull/4399) - Fixed an error during the generation of a group's report, if the request to the Wazuh API fails [#4350](https://github.com/wazuh/wazuh-kibana-app/pull/4350) - Fixed a problem with the group's report, when the group has no agents [#4350](https://github.com/wazuh/wazuh-kibana-app/pull/4350) - Fixed path in logo customization section [#4352](https://github.com/wazuh/wazuh-kibana-app/pull/4352) From 5ad6c7ae42a287334ad54f7a3afe6ed742ba5b5b Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 12:08:36 -0300 Subject: [PATCH 10/28] 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 86ad74ddcf..0c19e373b6 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -577,7 +577,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 bafd0ed4e9e2c0244333fd4a11814924fc8685b0 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 30 Nov 2022 12:13:07 -0300 Subject: [PATCH 11/28] 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 0c19e373b6..4c9a99818b 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -596,7 +596,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 329f5aacdacbba4c3dbafd866daa7a35c6f4304d Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Wed, 7 Dec 2022 08:12:08 -0300 Subject: [PATCH 12/28] Added link for additional steps to alpine os and changelog --- CHANGELOG.md | 3 +- .../agent/components/register-agent.js | 41 ++++++++++++++++--- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8222bc89d5..7b3aceac53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to the Wazuh app project will be documented in this file. - 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) - 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) +- Deploy new agent section: Added link for additional steps to alpine os. [#4933](https://github.com/wazuh/wazuh-kibana-app/pull/4933) ### Changed @@ -45,7 +46,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed pagination to SCA table [#4653](https://github.com/wazuh/wazuh-kibana-app/issues/4653) - Fixed WAZUH_PROTOCOL param suggestion [#4849](https://github.com/wazuh/wazuh-kibana-app/pull/4849) - Raspbian OS, Ubuntu, Amazon Linux and Amazon Linux 2 commands in the wizard deploy agent now change when a different architecture is selected [#4876](https://github.com/wazuh/wazuh-kibana-app/pull/4876) [#4880](https://github.com/wazuh/wazuh-kibana-app/pull/4880) -- Fixed 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) +- 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) ## Wazuh v4.3.10 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 4311 diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 4c9a99818b..e76e906545 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1424,6 +1424,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' || @@ -1780,12 +1801,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), + ), }, ] : []), From f022ac37ebad4abb65aa76b04cba11a6957e2501 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, 12 Dec 2022 07:26:34 -0300 Subject: [PATCH 13/28] clear 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 e76e906545..99606784b0 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -303,7 +303,6 @@ export const RegisterAgent = withErrorBoundary( } setVersion(selectedVersion) { - console.log(selectedVersion, 'sel'); this.setState({ selectedVersion, selectedArchitecture: '' }); } From 82bad518d0893e39824cfc58b481e6c5f06df047 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 12 Dec 2022 13:01:39 -0300 Subject: [PATCH 14/28] 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 99606784b0..ec1be7bd59 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -290,10 +290,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 3a3d326450c8eee0f6cad55efd5cc225f2b42b37 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 12 Dec 2022 13:50:42 -0300 Subject: [PATCH 15/28] 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 ec1be7bd59..e484e80b85 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -109,8 +109,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(), }; } @@ -256,7 +256,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'; } } @@ -2082,7 +2082,6 @@ apk add wazuh-agent`, }, ] : []), - ...(!missingOSSelection.length && this.state.selectedOS !== 'rpm' && this.state.selectedOS !== 'deb' && From df15abf8654ece11dbc8a620f00311ec8ffb7f71 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Fri, 16 Dec 2022 09:01:49 -0300 Subject: [PATCH 16/28] 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 e484e80b85..72b88f8621 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -640,15 +640,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`; } } @@ -948,7 +948,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 072e873bd32a814159679c5d8cfd171fb08ca895 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 17/28] Fix the agent installation command for macOS (#4968) * Fixed the agent installation command for macOS * CHANGELOG * Update CHANGELOG.md --- CHANGELOG.md | 1 + public/controllers/agent/components/register-agent.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5d6bf04f3..81211777bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed pagination to SCA table [#4653](https://github.com/wazuh/wazuh-kibana-app/issues/4653) - Fixed WAZUH_PROTOCOL param suggestion [#4849](https://github.com/wazuh/wazuh-kibana-app/pull/4849) - Raspbian OS, Ubuntu, Amazon Linux and Amazon Linux 2 commands in the wizard deploy agent now change when a different architecture is selected [#4876](https://github.com/wazuh/wazuh-kibana-app/pull/4876) [#4880](https://github.com/wazuh/wazuh-kibana-app/pull/4880) +- Fixed agent installation command for macOS in the deploy new agent section. [#4968](https://github.com/wazuh/wazuh-kibana-app/pull/4968) - 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 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 72b88f8621..f4216fb89a 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -367,6 +367,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 3b19303432017c032b48d64935376018b5f47aa4 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 18/28] 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 | 579 +++++++++--------- 2 files changed, 280 insertions(+), 300 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a1f3d4413..67ccdf7de8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,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 agent installation command for macOS in the deploy new agent section. [#4968](https://github.com/wazuh/wazuh-kibana-app/pull/4968) - 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 Inventory checks table filters by stats [#4999](https://github.com/wazuh/wazuh-kibana-app/pull/4999) - Fixed vulnerabilities default last scan date formatter [#4975](https://github.com/wazuh/wazuh-kibana-app/pull/4975) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index f4216fb89a..04f3fbdf80 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -271,10 +271,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'; } } @@ -856,16 +858,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 = ( @@ -962,7 +962,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()}`, @@ -979,15 +979,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' && ( <> @@ -1036,10 +1056,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 @@ -1074,6 +1103,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 + : ''}
    ), @@ -1237,6 +1389,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''} ), @@ -1267,6 +1422,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''} ), @@ -1297,6 +1455,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''} ), @@ -1327,6 +1488,9 @@ apk add wazuh-agent`,
    {textAndLinkToCheckConnectionDocumentation} + {this.state.selectedOS == 'hp' || this.state.selectedOS == 'sol' + ? messageExtraSteps + : ''}
    ), @@ -1346,139 +1510,6 @@ apk add wazuh-agent`, ); }; - 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 == '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 - - . - - } - > - ) : ( - '' - )} - - ); - }; - const selectedVersionMac = (legend, options, idSelected, onChange) => { return ( 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 +1631,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 +1657,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 +1670,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 +1735,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 +1748,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 +1761,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 +1774,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 +1934,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 +1962,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 +2009,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 561206d25b03673e6e6c1ec04513e58f126f6ea7 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 19 Dec 2022 15:51:08 -0300 Subject: [PATCH 19/28] red hat, centos and windows commands fixed --- .../agent/components/register-agent.js | 69 ++++++++++--------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index f6a67cba38..b057720520 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -83,6 +83,13 @@ export const RegisterAgent = withErrorBoundary( 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 +397,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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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 +474,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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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 +645,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}${this.addToVersion}.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}${this.addToVersion}.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 +958,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 1e21833c784e203e5648aeb8c238ccb59ac05525 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 20 Dec 2022 11:38:08 -0300 Subject: [PATCH 20/28] 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 b057720520..8218d8e01e 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -505,21 +505,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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm${this.wazuhRpmVariable}`; } } @@ -528,17 +528,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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm${this.wazuhRpmVariable}`; } } @@ -547,52 +547,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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.ppc64le.rpm`; case 'amazonlinux2022-i386': - return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}`; } } @@ -601,17 +601,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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}`; } } @@ -620,23 +620,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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}${this.addToVersion}_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}`; } } @@ -658,15 +658,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}`; } } @@ -675,9 +675,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}${this.addToVersion}.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}${this.addToVersion}.aix.ppc.rpm`; + return `https://packages.wazuh.com/4.x/yum/i386/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.aix.ppc.rpm${this.wazuhRpmVariable}`; } } @@ -686,9 +686,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}${this.addToVersion}-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}${this.addToVersion}-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 0f7b597627fdf3c806d6f70dc736a3d03855fd1e Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 20 Dec 2022 13:27:35 -0300 Subject: [PATCH 21/28] 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 8218d8e01e..90e7c96ff9 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -723,7 +723,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}${this.addToVersion}.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}`; } } @@ -931,25 +931,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' @@ -961,23 +956,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 5a6fc635d178d2122c904b4ef02276da33315d84 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Tue, 20 Dec 2022 13:32:52 -0300 Subject: [PATCH 22/28] 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 90e7c96ff9..67ff114740 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1220,14 +1220,6 @@ apk add wazuh-agent`, ) : ( '' )} - {/* - { - - } */} {this.state.needsPassword && ( Date: Wed, 21 Dec 2022 09:03:33 -0300 Subject: [PATCH 23/28] 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 67ff114740..8d7f91527d 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -590,7 +590,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}`; } @@ -609,7 +609,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}`; } @@ -634,7 +634,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 a83cfb1529cf2957036547cd57dea8e97c52ccf3 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 24/28] 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 8d7f91527d..85dbc925bd 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -447,25 +447,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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.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}${this.addToVersion}.x86_64.rpm`; + return `https://packages.wazuh.com/4.x/yum/wazuh-agent-${this.state.wazuhVersion}${this.addToVersion}.x86_64.rpm${this.wazuhRpmVariable}`; } } @@ -565,7 +565,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}${this.addToVersion}.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': @@ -647,7 +647,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 4d8bc4c704c1ee741831f1a98d6100c17d1fd73d 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 25/28] 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 85dbc925bd..70503677cd 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -428,17 +428,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"`; } } @@ -928,7 +928,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 fd65e5823ea92ddae5585e6420a9e662c305163c Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Thu, 22 Dec 2022 08:37:16 -0300 Subject: [PATCH 26/28] comand windows --- .../agent/components/register-agent.js | 98 +++++++++++++++---- 1 file changed, 80 insertions(+), 18 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index 06ec330a44..043608d25b 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -287,7 +287,9 @@ export const RegisterAgent = withErrorBoundary( this.state.selectedVersion === '3.12.12' ) { return '/var/ossec/bin/wazuh-control start'; - } else this.state.selectedVersion === '11.31'; + } else { + this.state.selectedVersion === '11.31'; + } { return '/sbin/init.d/wazuh-agent start'; } @@ -382,7 +384,7 @@ export const RegisterAgent = withErrorBoundary( } if (this.state.udpProtocol) { - deployment += `WAZUH_PROTOCOL='UDP' `; + deployment += "WAZUH_PROTOCOL='UDP' "; } if (this.state.selectedGroup.length) { @@ -452,17 +454,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"'; } } @@ -986,7 +988,7 @@ apk add wazuh-agent`, this.state.selectedVersion == 'windowsserver2008' ? `msiexec.exe /i wazuh-agent-${ this.state.wazuhVersion - }-1.msi /q ${this.optionalDeploymentVariables()}` + }-1.msi /q ${this.optionalDeploymentVariables()}${this.agentNameVariable()}` : `Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-${ this.state.wazuhVersion }-1.msi${ @@ -1023,7 +1025,11 @@ apk add wazuh-agent`, const textAndLinkToCheckConnectionDocumentation = (

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

    @@ -1032,7 +1038,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. @@ -1049,10 +1055,11 @@ apk add wazuh-agent`,

    ); + const windowsAdvice = this.state.selectedOS === 'win' && ( <> -
      +
      • You will need administrator privileges to perform this @@ -1115,8 +1122,17 @@ apk add wazuh-agent`, /> {windowsAdvice} - {this.state.selectedVersion == 'windowsxp' || - this.state.selectedVersion == 'windowsserver2008' ? ( + {this.state.selectedVersion === 'windowsxp' && ( + <> + + + + )} + {this.state.selectedVersion === 'windowsserver2008' && ( <> - ) : ( - '' )}
        @@ -1298,6 +1312,26 @@ apk add wazuh-agent`, /> {windowsAdvice} + {this.state.selectedVersion === 'windowsxp' && ( + <> + + + + )} + {this.state.selectedVersion === 'windowsserver2008' && ( + <> + + + + )}
        {this.state.wazuhPassword && !this.state.showPassword @@ -1336,6 +1370,34 @@ apk add wazuh-agent`, /> {windowsAdvice} + {this.state.selectedVersion === 'windowsxp' && ( + <> + + + + )} + {this.state.selectedVersion === 'windowsserver2008' && ( + <> + + + + )} + <> + + +
        {this.state.wazuhPassword && !this.state.showPassword @@ -2019,7 +2081,7 @@ apk add wazuh-agent`, ) : this.state.agentNameError ? ( ) : missingOSSelection.length ? ( @@ -2057,7 +2119,7 @@ apk add wazuh-agent`, ) : this.state.agentNameError ? ( ) : missingOSSelection.length ? ( From ba9b466d871b7c54223f73ea52077d2ec3b79c00 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Thu, 22 Dec 2022 09:13:48 -0300 Subject: [PATCH 27/28] oracleLinux command --- 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 043608d25b..c6b692d17c 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1008,9 +1008,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 From d96a1c044e57ae48fb63014f1a174ae7145211e9 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Thu, 22 Dec 2022 09:45:01 -0300 Subject: [PATCH 28/28] warningcOMAND --- public/controllers/agent/components/register-agent.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index c6b692d17c..1004a47aee 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -1388,14 +1388,6 @@ apk add wazuh-agent`, )} - <> - - -
        {this.state.wazuhPassword && !this.state.showPassword