Giter Site home page Giter Site logo

wazuh-gmail's Introduction

wazuh-gmail

Gmail relay for wazuh.

Requirements

  • python3 < 3.12
  • wazuh-server

Installation

  1. Clone repository.
git clone https://github.com/dgalus/wazuh-gmail
sudo cp wazuh-gmail /opt
cd /opt/wazuh-gmail
  1. Create python virtual environment and install dependencies.
sudo python3 -m venv venv
./venv/bin/pip install -r requirements.txt
  1. Navigate to your Google API console and
  • create new project or select existing
  • under "Credentials", select "Create credentials" and create a new "OAuth client ID". If you would already have such an ID, you can skip this step and just re-use the one you have
  • you will be asked which type of app will use this ID, choose “Other” and give your app an easy-to-remember name
  • next up comes the most important screen, giving you your client ID and secret key. Write both of these down and do not give these out to others!
  1. Run sudo ./venv/bin/python wazuh-gmail.py --configure.
  • enter Client ID
  • enter Client Secret
  • enter selected gmail email address
  • open URL address generated by script and follow the instructions
  • enter verification code.
  1. Create file /etc/systemd/system/wazuh-gmail.service, insert the following content and save it.
[Unit]
Description=Wazuh Gmail Relay
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/opt/wazuh-gmail
ExecStart=/opt/wazuh-gmail/venv/bin/python /opt/wazuh-gmail/wazuh-gmail.py --run
RemainAfterExit=no
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target
  1. Start service.
sudo systemctl enable wazuh-gmail
sudo systemctl start wazuh-gmail
  1. Open /var/ossec/etc/ossec.conf and check if:
  • there is the following content in section <ossec_config><global>
<email_notification>yes</email_notification>
<smtp_server>127.0.0.1</smtp_server>
<email_from>[email protected]</email_from>
<email_to>[email protected]</email_to>
<email_log_source>alerts.log</email_log_source>
  • there is the following section in <ossec_config>
<alerts>
  <log_alert_level>4</log_alert_level>
  <email_alert_level>12</email_alert_level>
</alerts>
  1. Restart wazuh.
sudo systemctl restart wazuh-gmail

wazuh-gmail's People

Contributors

dgalus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.