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 #1406

Closed
Tracked by #4205
AlexRuiz7 opened this issue May 24, 2023 · 1 comment · Fixed by #1407
Closed
Tracked by #4205

Agent deploy command for macOS #1406

AlexRuiz7 opened this issue May 24, 2023 · 1 comment · Fixed by #1407
Assignees
Labels
level/task Task issue type/bug Bug issue

Comments

@AlexRuiz7
Copy link
Member

Description

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

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.

@AlexRuiz7 AlexRuiz7 added type/bug Bug issue level/task Task issue labels May 24, 2023
@wazuhci wazuhci moved this to In progress in Release 4.4.3 May 24, 2023
@AlexRuiz7
Copy link
Member Author

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 /

Originally posted by @jnasselle in wazuh/wazuh-dashboard-plugins#5466 (comment)

@asteriscos asteriscos linked a pull request May 24, 2023 that will close this issue
3 tasks
@github-project-automation github-project-automation bot moved this from In progress to Done in Release 4.4.3 May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/bug Bug issue
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants