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

Implement Wazuh Agent Daemon Mode #140

Closed
Tracked by #126
vikman90 opened this issue Sep 11, 2024 · 0 comments
Closed
Tracked by #126

Implement Wazuh Agent Daemon Mode #140

vikman90 opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels

Comments

@vikman90
Copy link
Member

vikman90 commented Sep 11, 2024

Parent Issue:

Description

The goal is to enhance the Wazuh agent by implementing a daemon (background process) mode. This will allow the agent to run continuously in the background, with the ability to manage it through a set of CLI commands (start, stop, status). The agent will be required to handle process management in both UNIX-like systems (Linux and macOS) and Windows environments. The implementation should follow best practices for daemon processes and system services for each platform.

Functional Requirements

  1. wazuh-agent will act as a CLI by default.
  2. wazuh-agent start:
    • Starts the Wazuh agent in the background.
    • Creates a new process and calls wazuh-agent --daemon.
  3. wazuh-agent --daemon:
    • Starts the Wazuh agent as a daemon/background service.
  4. wazuh-agent status:
    • Reports the current status of the Wazuh agent daemon (running/stopped).
  5. wazuh-agent stop:
    • Locates and terminates the background Wazuh agent process.

Non-Functional Requirements

  • Compatibility with both UNIX (Linux/macOS) and Windows.
  • Logs and errors should be appropriately handled and logged in respective system logs (e.g., syslog for UNIX, Event Viewer for Windows).

Plan

  1. Implement Daemon Mode for UNIX-based Systems (Linux, macOS) #141
    • Implement process forking, logging, and background operation.
    • Create system integration scripts for init systems (systemd, launchd).
  2. Implement Daemon Mode for Windows #142
    • Implement the service wrapper for the Wazuh agent using Windows APIs.
    • Integrate with Windows Service Manager (service start/stop/status).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

4 participants