> an email to wazuh+unsubscribe@googlegroups.com.
>> an email to wazuh+unsubscribe@googlegroups.com.
<!-- AlienVault IP Reputation Integration -->
<group name="ipreputation,">
<rule id="100100" level="10">
<list field="srcip" lookup="address_match_key">etc/lists/blacklist-alienvault</list>
<description>Source IP in black list.</description>
</rule>
<rule id="100101" level="10">
<list field="src_ip" lookup="address_match_key">etc/lists/blacklist-alienvault</list>
<description>Source IP in black list.</description>
</rule>
<rule id="100102" level="10">
<list field="dstip" lookup="address_match_key">etc/lists/blacklist-alienvault</list>
<description>Dest IP in black list.</description>
</rule>
<rule id="100103" level="10">
<list field="dst_ip" lookup="address_match_key">etc/lists/blacklist-alienvault</list>
<description>Dest IP in black list.</description>
</rule>
</group>
<wodle name="command">
<disabled>no</disabled>
<tag>test</tag>
<command>/bin/bash /root/update_CDB.sh</command>
<interval>1d</interval>
<ignore_output>yes</ignore_output>
<run_on_start>yes</run_on_start>
</wodle>
#!/bin/bash
/var/ossec/bin/ossec-makelists
/var/ossec/bin/ossec-control restartHi Dimitry
I have reported this problem, we will solve as soon as possible. The script you search is the following.
Kind regards, Eva
#!/usr/bin/env python
#
# Convert IP list to CDB list
# Copyright (C) 2016 Wazuh Inc.
#
# This program is a free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public
# License (version 2) as published by the FSF - Free Software
# Foundation.
#
import re
from sys import exit, argv
try:
if len(argv) != 3:
print("Bad arguments. Try: iplist-to-cdblist.py input output")
exit(1)
ip_regex = re.compile("^((?:[0-9]{1,3}\.){3}[0-9]{1,3})(?:/(\d{1,2}){0,1}|)")
first_time = True
cdir_conversion = {"32": 4, "24": 3, "16": 2, "8": 1}
fo = open(argv[2], 'w')
with open(argv[1]) as f:
for line in f:
match = ip_regex.match(line.rstrip('\r\n'))
if not match: # Read just lines that start with an IP
continue
ip = match.group(1)
mask = match.group(2)
if mask: # Convert allowed masks (32, 24, 16, 8)
ip = ip.split('.')
if mask in cdir_conversion:
ip = '.'.join(ip[:cdir_conversion[mask]])
if mask != "32":
ip += "."
else:
continue
ip += ":" # CDB List format
if first_time:
fo.write(ip)
first_time = False
else:
fo.write("\n" + ip)
fo.close()
print("[{0}] -> [{1}]".format(argv[1], argv[2]))
except Exception as e:
print("Error:\n{0}\nExiting...".format(e))
exit(1)
>> an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/1d76afbf-1df6-40a2-8c86-c5eefdeca4can%40googlegroups.com.