Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent deploy command for macOS #5466

Closed
Tracked by #4205
gdiazlo opened this issue May 19, 2023 · 2 comments · Fixed by #5470, #5480, #5479, #5481 or #5483
Closed
Tracked by #4205

Agent deploy command for macOS #5466

gdiazlo opened this issue May 19, 2023 · 2 comments · Fixed by #5470, #5480, #5479, #5481 or #5483
Assignees
Labels
level/task Task issue type/bug Bug issue

Comments

@gdiazlo
Copy link
Member

gdiazlo commented May 19, 2023

Wazuh Elastic Rev Security
4.x4.1 - - -
Browser
all

Description

The command to start the agent in macOS should be run by root, so we need to add sudo as part of the command.

image

The command

/Library/Ossec/bin/wazuh-control start

should be

sudo /Library/Ossec/bin/wazuh-control start

Also, the package name is going to be updated. We must update the installation command with the new name when it is available.

@gdiazlo gdiazlo added type/bug Bug issue level/task Task issue labels May 19, 2023
@gdiazlo gdiazlo moved this to Backlog in Release 4.4.3 May 19, 2023
@havidarou havidarou moved this from Backlog to Blocked in Release 4.4.3 May 19, 2023
@wazuhci wazuhci moved this from Blocked to Backlog in Release 4.4.3 May 19, 2023
@havidarou havidarou moved this from Backlog to Blocked in Release 4.4.3 May 19, 2023
@havidarou havidarou moved this from Blocked to In progress in Release 4.4.3 May 22, 2023
@AlexRuiz7 AlexRuiz7 mentioned this issue May 22, 2023
9 tasks
@Machi3mfl Machi3mfl linked a pull request May 22, 2023 that will close this issue
@jnasselle
Copy link
Member

Hi @gdiazlo ,

As part of wazuh/wazuh-packages#2205 implementation, Deploy a new agent section will need some changes related to deployment variables usage. Now the template will be the next one

echo -e  'WAZUH_MANAGER="192.168.1.10"\nWAZUH_AGENT_GROUP="default"' > /tmp/wazuh_envs

Old environment variables should

  • Be '\n' separated
  • KEY="value"

@github-project-automation github-project-automation bot moved this from In progress to Done in Release 4.4.3 May 23, 2023
@gdiazlo gdiazlo reopened this May 23, 2023
@wazuhci wazuhci moved this from Done to Blocked in Release 4.4.3 May 23, 2023
@asteriscos asteriscos linked a pull request May 23, 2023 that will close this issue
6 tasks
@asteriscos asteriscos linked a pull request May 23, 2023 that will close this issue
6 tasks
@jnasselle
Copy link
Member

jnasselle commented May 23, 2023

Update

Due to some optimizations in terms of usability and macOS availability of certain commands, the final specs about CLI installation command are

  • Creation of a temp file by echo command stdout redirection
    • Command: sudo echo
    • Flags: none
    • Args: &&-separated concatenation of list of KEY='VALUE', being KEY the available development variables and VALUE the one specified by the user
    • Output file: /tmp/wazuh_envs
    • Considerations:
      • Command won't be used if no deployment variable was set.
      • Command Args will be between double quotes, while each of the deployment variables values will be between single quotes
      • Deployment variable values need to be escaped if double quotes exist

Examples:

sudo echo "WAZUH_MANAGER='1.1.1.1' && WAZUH_MANAGER_PORT='7777' && WAZUH_PROTOCOL='udp' && WAZUH_REGISTRATION_SERVER='2.2.2.2' && WAZUH_REGISTRATION_PORT='8888' && WAZUH_REGISTRATION_PASSWORD='password' && WAZUH_KEEP_ALIVE_INTERVAL='10' && WAZUH_TIME_RECONNECT='10' && WAZUH_REGISTRATION_CA='/Library/Ossec/etc/testsslmanager.cert' && WAZUH_REGISTRATION_CERTIFICATE='/Library/Ossec/etc/testsslmanager.cert' && WAZUH_REGISTRATION_KEY='/Library/Ossec/etc/testsslmanager.key' && WAZUH_AGENT_NAME='test-agent' && WAZUH_AGENT_GROUP='test-group' && ENROLLMENT_DELAY='10'" > /tmp/wazuh_envs && sudo installer -pkg wazuh-agent-4.4.3-0.commitb384726.pkg -target /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment