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

Import Manager integration to Elastic #264

Closed
Tracked by #250
AlexRuiz7 opened this issue Jun 10, 2024 · 3 comments · Fixed by #266
Closed
Tracked by #250

Import Manager integration to Elastic #264

AlexRuiz7 opened this issue Jun 10, 2024 · 3 comments · Fixed by #266
Assignees
Labels
level/task Task issue request/operational Operational requests type/enhancement Enhancement issue

Comments

@AlexRuiz7
Copy link
Member

Description

Import Manager integration to Elastic.

Tasks

  • Import code.
  • Add a Docker environment.
  • Test the integration works.
  • Keep the folder layout well organized.
@AlexRuiz7 AlexRuiz7 added level/task Task issue request/operational Operational requests type/enhancement Enhancement issue labels Jun 10, 2024
@AlexRuiz7 AlexRuiz7 self-assigned this Jun 11, 2024
@f-galland f-galland self-assigned this Jun 11, 2024
@f-galland
Copy link
Member

I added a class to the event-generator script that allows it to connect to the datagram socket of the Wazuh Manager under /var/ossec/queue/sockets/queue that looks like the following:

class PublisherSocket(Publisher):
    def __init__(self, path):
        super()
        self.path = path

    def publish(self, event: str):
        event_dict = json.loads(event)
        full_log = event_dict['full_log']
        location = event_dict['location']
        message = '1:{}:{}'.format(location, full_log)
        sock = socket(AF_UNIX, SOCK_DGRAM)
        sock.connect(self.path)
        sock.send(message.encode())
        sock.close()

But the sample alerts.json file does not include a full_log field (as most real world alerts do), so we need to discuss whether we want to change our sample data or move to some other technique.

@f-galland
Copy link
Member

In the end I discarded the above work and managed to get the events generator script to write to the manager's /var/ossec/logs/alerts/alerts.json directly.

@f-galland
Copy link
Member

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue request/operational Operational requests type/enhancement Enhancement issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants