Reg-Email config

127 views
Skip to first unread message

Nakova Technologies

unread,
Dec 1, 2022, 12:48:00 AM12/1/22
to Wazuh mailing list
Hi team,
How to disable email alerts for specific agents.

Ifeanyi Onyia Odike

unread,
Dec 1, 2022, 2:25:04 AM12/1/22
to Wazuh mailing list
Hi @nakovatec...@gmail.com

Thank you for using Wazuh!

You can configure your email alerts by specifying an alert level or agent. Please take a look at the documentation Email alerts based on level and agent for more help.
If you need further assistance with this, can you share your /var/ossec/etc/ossec.conf file? Please do not forget to exclude all sensitive information.

I hope this helps.

Regards,

Nakova Technologies

unread,
Dec 1, 2022, 2:50:42 AM12/1/22
to Wazuh mailing list
Hi team,
we have followed the above link for enabling email alerts for specific users. The above documentation said for enabling the email alert process but we are asking for disabling email alerts for the specific user.

Ifeanyi Onyia Odike

unread,
Dec 1, 2022, 3:53:27 AM12/1/22
to Wazuh mailing list
Hi @nakovatec...@gmail.com,

Thank you for your response.

I'm not sure I understand your question.
Do you want to disable email alerts for logs from an agent, or for emails to an email recipient?

Regards,

Nakova Technologies

unread,
Dec 1, 2022, 5:02:35 AM12/1/22
to Wazuh mailing list
HI!
Example;

I configured email alerts for (XYZ) agents.
Now I want to disable one particular agent (Z) email alerts, And I want other agents (XY) email alerts.

Regards,
Jawa

Ifeanyi Onyia Odike

unread,
Dec 1, 2022, 10:00:45 AM12/1/22
to Wazuh mailing list
Alright,

Apologies for the delayed response.

Can you respond with your configuration, and I will assist you with the required modification?

Please do not forget to exclude all sensitive information.

Regards,

Nakova Technologies

unread,
Dec 1, 2022, 11:25:23 PM12/1/22
to Wazuh mailing list
Hi

<!--
  Wazuh - Manager - Default configuration for ubuntu 20.04
  More info at: https://documentation.wazuh.com
  Mailing list: https://groups.google.com/forum/#!forum/wazuh
-->

<ossec_config>
  <global>
    <jsonout_output>yes</jsonout_output>
    <alerts_log>yes</alerts_log>
    <logall>yes</logall>
    <logall_json>yes</logall_json>
    <email_notification>yes</email_notification>
    <smtp_server>localhost</smtp_server>
    <mailto:email_from>in...@gmail.com</email_from>
    <mailto:email_to>d...@gmail.com</email_to>
    <email_maxperhour>50</email_maxperhour>
    <email_log_source>alerts.log</email_log_source>
    <agents_disconnection_time>10m</agents_disconnection_time>
    <agents_disconnection_alert_time>0</agents_disconnection_alert_time>
  </global>
 
  <alerts>
    <log_alert_level>3</log_alert_level>
    <email_alert_level>5</email_alert_level>
  </alerts>
 
  <!-- Choose between "plain", "json", or "plain,json" for the format of internal logs -->
  <logging>
    <log_format>plain</log_format>
  </logging>
 
  <remote>
    <connection>secure</connection>
    <port>1514</port>
    <protocol>tcp</protocol>
    <queue_size>131072</queue_size>
  </remote>

  <remote>
    <connection>syslog</connection>
    <port>514</port>
    <protocol>udp</protocol>
    <allowed-ips>10.0.0.1</allowed-ips>
  </remote>

  <!-- Policy monitoring -->
  <rootcheck>
    <disabled>no</disabled>
    <check_files>yes</check_files>
    <check_trojans>yes</check_trojans>
    <check_dev>yes</check_dev>
    <check_sys>yes</check_sys>
    <check_pids>yes</check_pids>
    <check_ports>yes</check_ports>
    <check_if>yes</check_if>

    <!-- Frequency that rootcheck is executed - every 12 hours -->
    <frequency>43200</frequency>

    <rootkit_files>etc/rootcheck/rootkit_files.txt</rootkit_files>
    <rootkit_trojans>etc/rootcheck/rootkit_trojans.txt</rootkit_trojans>

    <skip_nfs>yes</skip_nfs>
  </rootcheck>
 
  <wodle name="cis-cat">
    <disabled>no</disabled>
    <timeout>1800</timeout>
    <interval>1d</interval>
    <scan-on-start>yes</scan-on-start>

    <java_path>wodles/java</java_path>
    <ciscat_path>wodles/ciscat</ciscat_path>
  </wodle>

  <!-- Osquery integration -->
  <wodle name="osquery">
    <disabled>yes</disabled>
    <run_daemon>yes</run_daemon>
    <log_path>/var/log/osquery/osqueryd.results.log</log_path>
    <config_path>/etc/osquery/osquery.conf</config_path>
    <add_labels>yes</add_labels>
  </wodle>
 
      <wodle name="aws-s3">
        <disabled>no</disabled>
        <interval>10m</interval>
        <run_on_start>yes</run_on_start>
        <skip_on_error>yes</skip_on_error>
        <bucket type="config">
        <name>wazuh-aws-wodle</name>
        <path>config</path>
        <aws_profile>default</aws_profile>
        </bucket>
      </wodle>

  <!-- System inventory -->
  <wodle name="syscollector">
    <disabled>no</disabled>
    <interval>1h</interval>
    <scan_on_start>yes</scan_on_start>
    <hardware>yes</hardware>
    <os>yes</os>
    <network>yes</network>
    <packages>yes</packages>
    <ports all="no">yes</ports>
    <processes>yes</processes>

    <!-- Database synchronization settings -->
    <synchronization>
      <max_eps>10</max_eps>
    </synchronization>
  </wodle>

  <sca>
    <enabled>yes</enabled>
    <scan_on_start>yes</scan_on_start>
    <interval>12h</interval>
    <skip_nfs>yes</skip_nfs>
  </sca>

  <vulnerability-detector>
    <enabled>yes</enabled>
    <interval>5m</interval>
    <ignore_time>6h</ignore_time>
    <run_on_start>yes</run_on_start>

    <!-- Ubuntu OS vulnerabilities -->
    <provider name="canonical">
      <enabled>yes</enabled>
      <os>trusty</os>
      <os>xenial</os>
      <os>bionic</os>
      <os>focal</os>
      <update_interval>1h</update_interval>
    </provider>

    <!-- Debian OS vulnerabilities -->  
    <provider name="debian">
      <enabled>yes</enabled>
      <os>stretch</os>
      <os>buster</os>
      <update_interval>1h</update_interval>
    </provider>

    <!-- RedHat OS vulnerabilities -->  
    <provider name="redhat">
      <enabled>no</enabled>
      <os>5</os>
      <os>6</os>
      <os>7</os>
      <os>8</os>
      <update_interval>1h</update_interval>
    </provider>

    <!-- Windows OS vulnerabilities -->
    <provider name="msu">
      <enabled>yes</enabled>
      <update_interval>1h</update_interval>
    </provider>

    <!-- Aggregate vulnerabilities -->
    <provider name="nvd">
      <enabled>yes</enabled>
      <update_from_year>2010</update_from_year>
      <update_interval>1h</update_interval>
    </provider>

  </vulnerability-detector>

  <!-- File integrity monitoring -->
  <syscheck>
    <disabled>no</disabled>

    <!-- Frequency that syscheck is executed default every 12 hours -->
    <frequency>43200</frequency>

    <scan_on_start>yes</scan_on_start>

    <!-- Generate alert when new file detected -->
    <alert_new_files>yes</alert_new_files>

    <!-- Don't ignore files that change more than 'frequency' times -->
    <auto_ignore frequency="10" timeframe="3600">no</auto_ignore>

    <!-- Directories to check  (perform all possible verifications) -->
    <directories>/etc,/usr/bin,/usr/sbin</directories>
    <directories>/bin,/sbin,/boot</directories>

    <!-- Files/directories to ignore -->
    <ignore>/etc/mtab</ignore>
    <ignore>/etc/hosts.deny</ignore>
    <ignore>/etc/mail/statistics</ignore>
    <ignore>/etc/random-seed</ignore>
    <ignore>/etc/random.seed</ignore>
    <ignore>/etc/adjtime</ignore>
    <ignore>/etc/httpd/logs</ignore>
    <ignore>/etc/utmpx</ignore>
    <ignore>/etc/wtmpx</ignore>
    <ignore>/etc/cups/certs</ignore>
    <ignore>/etc/dumpdates</ignore>
    <ignore>/etc/svc/volatile</ignore>

    <!-- File types to ignore -->
    <ignore type="sregex">.log$|.swp$</ignore>

    <!-- Check the file, but never compute the diff -->
    <nodiff>/etc/ssl/private.key</nodiff>

    <skip_nfs>yes</skip_nfs>
    <skip_dev>yes</skip_dev>
    <skip_proc>yes</skip_proc>
    <skip_sys>yes</skip_sys>

    <!-- Nice value for Syscheck process -->
    <process_priority>10</process_priority>

    <!-- Maximum output throughput -->
    <max_eps>100</max_eps>

    <!-- Database synchronization settings -->
    <synchronization>
      <enabled>yes</enabled>
      <interval>5m</interval>
      <max_interval>1h</max_interval>
      <max_eps>10</max_eps>
    </synchronization>
  </syscheck>

    <global>
    <white_list>127.0.0.1</white_list>
    <white_list>^localhost.localdomain$</white_list>
    <white_list>127.0.0.53</white_list>
  </global>

  <command>
    <name>disable-account</name>
    <executable>disable-account</executable>
    <timeout_allowed>yes</timeout_allowed>
  </command>

  <command>
    <name>restart-wazuh</name>
    <executable>restart-wazuh</executable>
  </command>

  <command>
    <name>firewall-drop</name>
    <executable>firewall-drop</executable>
    <timeout_allowed>yes</timeout_allowed>
  </command>

  <command>
    <name>host-deny</name>
    <executable>host-deny</executable>
    <timeout_allowed>yes</timeout_allowed>
  </command>

  <command>
    <name>route-null</name>
    <executable>route-null</executable>
    <timeout_allowed>yes</timeout_allowed>
  </command>
 
  <command>
    <name>windowsfirewall</name>
    <executable>firewall.cmd</executable>
    <timeout_allowed>yes</timeout_allowed>
  </command>

  <command>
    <name>win_route-null</name>
    <executable>route-null.exe</executable>
    <timeout_allowed>yes</timeout_allowed>
  </command>

  <command>
    <name>netsh</name>
    <executable>netsh.exe</executable>
    <timeout_allowed>yes</timeout_allowed>
  </command>

 
  <active-response>
    <command>firewall-drop</command>
      <location>localhost</location>
      <rules_id>60122</rules_id>
      <timeout>1000</timeout>
  </active-response>

  <!-- Log analysis -->
  <localfile>
    <log_format>command</log_format>
    <command>df -P</command>
    <frequency>360</frequency>
  </localfile>

  <localfile>
    <log_format>full_command</log_format>
    <command>netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d</command>
    <alias>netstat listening ports</alias>
    <frequency>360</frequency>
  </localfile>

  <localfile>
    <log_format>full_command</log_format>
    <command>last -n 20</command>
    <frequency>360</frequency>
  </localfile>

  <ruleset>
    <!-- Default ruleset -->
    <decoder_dir>ruleset/decoders</decoder_dir>
    <rule_dir>ruleset/rules</rule_dir>
    <rule_exclude>0215-policy_rules.xml</rule_exclude>
    <list>etc/lists/audit-keys</list>
    <list>etc/lists/amazon/aws-eventnames</list>
    <list>etc/lists/security-eventchannel</list>
    <list>etc/lists/usb-devices</list>

    <!-- User-defined ruleset -->
    <decoder_dir>etc/decoders</decoder_dir>
    <rule_dir>etc/rules</rule_dir>
    <list>etc/lists/usb-devices</list>
  </ruleset>

  <rule_test>
    <enabled>yes</enabled>
    <threads>1</threads>
    <max_sessions>64</max_sessions>
    <session_timeout>15m</session_timeout>
  </rule_test>

  <!-- Configuration for wazuh-authd -->
  <auth>
    <disabled>no</disabled>
    <port>1515</port>
    <use_source_ip>no</use_source_ip>
    <force_insert>yes</force_insert>
    <force_time>0</force_time>
    <purge>yes</purge>
    <use_password>no</use_password>
    <ciphers>HIGH:!ADH:!EXP:!MD5:!RC4:!3DES:!CAMELLIA:@STRENGTH</ciphers>
    <!-- <ssl_agent_ca></ssl_agent_ca> -->
    <ssl_verify_host>no</ssl_verify_host>
    <ssl_manager_cert>etc/sslmanager.cert</ssl_manager_cert>
    <ssl_manager_key>etc/sslmanager.key</ssl_manager_key>
    <ssl_auto_negotiate>no</ssl_auto_negotiate>
  </auth>

  <cluster>
    <name>wazuh</name>
    <node_name>node01</node_name>
    <node_type>master</node_type>
    <key></key>
    <port>1516</port>
    <bind_addr>0.0.0.0</bind_addr>
    <nodes>
        <node>NODE_IP</node>
    </nodes>
    <hidden>no</hidden>
    <disabled>yes</disabled>
  </cluster>

</ossec_config>
------------------------------------------------------------------------------------------------------------------------------>>>>>>>>>>>>>>

Ifeanyi Onyia Odike

unread,
Dec 2, 2022, 11:12:00 AM12/2/22
to Wazuh mailing list
Hi @nakovatec...@gmail.com,

Looking at your configuration, you have not specified the <event_location>.
The event_location field can be configured to monitor a specific log, hostname, or network (IP).

For example, the configuration below will send an email to y...@example.com when the set rules trigger on server1.

<email_alerts>
  <email_to>y...@example.com</email_to>
  <event_location>server1</event_location>
  <do_not_delay />
</email_alerts>


You can follow the example used in this Multiple options and multiple emails use case for guidance.

I hope this resolves your query.

Regards,

Sharo V

unread,
Dec 5, 2022, 12:09:06 AM12/5/22
to Wazuh mailing list
Hi,
Below is the use case for the email alerts,

A server is generating various alerts in Wazuh. They are all genuine. Due to some reasons, we don't want to implement auto response. But we don't want to get email alerts for that particular agent.

The documentation shows how to forward the Wazuh alerts by email. What we need is how to block email alerts.

Please let us know how to do that.

Thanks
Sharo

Ifeanyi Onyia Odike

unread,
Dec 5, 2022, 8:12:26 AM12/5/22
to Wazuh mailing list
Hi Sharo,

Thank you for your email. 
The documentation earlier shared speaks to this configuration, however, I'll set this up locally on my environment and revert with a configuration you can use for your scenario.

Regards,

Sharo V

unread,
Dec 5, 2022, 10:23:00 AM12/5/22
to Ifeanyi Onyia Odike, Wazuh mailing list
Thanks for your reply.

Will wait for your response.

Thanks
S

--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/f1e370cd-0ee4-4117-b23c-e489f20cad92n%40googlegroups.com.

Ifeanyi Onyia Odike

unread,
Dec 6, 2022, 12:39:13 PM12/6/22
to Wazuh mailing list
Hi @Sharo,

This query is still being looked into and a response will be provided as soon as possible.
Apologies for the delays.

Regards,

Sharo V

unread,
Dec 8, 2022, 1:15:29 AM12/8/22
to Wazuh mailing list
Thanks for the update

Ifeanyi Onyia Odike

unread,
Dec 9, 2022, 2:00:24 AM12/9/22
to Wazuh mailing list
Hi Sharo,

Thank you for your patience.

I have not been able to find a way around this. The best I could find was specifying the agent, hostname, and log file you want to receive email alerts.

As earlier described, you can use the <event_location> tag for this, and separate the agents using the pipe | symbol. Please see the example below.

<email_alerts> 
  <email_to>al...@test.com</email_to> 
  <event_location>server1|server2</event_location> 
</email_alerts>

I will continue with further probes on possible alternatives.

I hope this helps.

Sharo V

unread,
Dec 12, 2022, 5:04:37 AM12/12/22
to Ifeanyi Onyia Odike, Wazuh mailing list
Thanks for your response

Reply all
Reply to author
Forward
0 new messages