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

ENH: Using msgpack instead of json #1819

Draft
wants to merge 45 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c30a5c9
REL: 2.3.2 Maintenance version
Apr 27, 2021
63b848a
DOC: Document new Sieve bot functionality
monoidic Apr 26, 2021
e03c14d
ENH: New expert bot for uWhoisd (#1918)
Rafiot Apr 30, 2021
2dab6a1
New Bot for Fireeye Appliances
CysihZ Feb 15, 2021
e5f55e1
MAINT+BUG: Various fixes in fireeye bots, tests and documentation
May 3, 2021
f25c996
rename fireeye collector to fireeye mas
May 4, 2021
a325159
DOC: bots: add anchors for all sections
May 11, 2021
2ddb625
ENH: Add condition negation to the Sieve DSL
monoidic May 11, 2021
7476e31
DOC: Update Sieve bot documentation regarding DSL updates
monoidic May 11, 2021
184d8ff
FIX: skip sieve expert tests
monoidic May 11, 2021
ad7f6ab
FIX: RDAP checks if entity is valid entity-type
waldbauer-certat May 12, 2021
1f24793
BUG/DOC: updated feodotracker browse parser confiuration
May 10, 2021
9639874
ENH: add honeypot_brute_force and corresponding tests
May 18, 2021
7c79954
ENH: add honeypot_ddos_amp and corresponding tests (#1950)
May 18, 2021
89cec4c
DOC+ENH: shadowserver support for new feeds
May 18, 2021
c48716e
ENH: Added cache mixin
waldbauer-certat May 10, 2021
0810f7d
FIX: Removed some old cache code
waldbauer-certat May 10, 2021
3816ef0
DOC: add license information to all the files
May 18, 2021
a869320
ENH: Split Sieve string/numeric methods into single/multivalue variants
monoidic May 21, 2021
4b4ac75
ENH: Use f-strings in Sieve expert
monoidic May 21, 2021
bdec455
ENH: add event_ip_spoofer shadowserver config and corresponding tests
May 19, 2021
0926b38
ENH: add event4_honeypot_darknet shadowserver config & tests
May 19, 2021
df77cda
ENH: add event46_sinkhole shadowserver config & tests
May 20, 2021
cffc303
FIX: change copyright header syntax in md files
May 31, 2021
0adf048
ENH: add Shadowserver scan_exchange config & tests
May 27, 2021
9aec5f5
ENH+DOC: shadowserver exchange feed
May 31, 2021
8f115c8
ENH: support event-sinkhole-http-referer in shadowserver parser
monoidic May 27, 2021
b6dcaf9
DOC for PR#1971
May 31, 2021
a5941ce
DOC/ENH: shadowserver feed
May 31, 2021
8e0463b
DOC: add changelog entry for PR#1975
Jun 7, 2021
9754252
DOC: azure collector: document minimum azure version
Jun 7, 2021
c7f9cd2
DOC: Document the licenses of all the files
Jun 1, 2021
1443ebf
ENH: tweaks to shadowserver config
monoidic May 21, 2021
30eeb56
ENH: support event-sinkhole-http-referer in shadowserver parser
monoidic May 27, 2021
9b05242
DOC: eventdb: describe the events table itself
Jun 10, 2021
8c21411
harm: rename compromised to system-compromise
Jun 17, 2021
f64c422
harm: remove type defacement
Jun 17, 2021
75acec4
DOC: Document templated SMTP output bot
creideiki Jun 18, 2021
37acdea
DEP: rmeove deprecated ripencc expert
Jun 17, 2021
2ca649e
DEP: modify expert: remove compat with old format
Jun 17, 2021
ac2ae40
DEP: remove deprecated database update scripts
Jun 17, 2021
b55afef
DOC: n6: add more illustrations
Jun 16, 2021
94fa7f8
ENH: Aggregate expert
waldbauer-certat Jun 21, 2021
e97db41
[ENH] Using msgpack instead of json
waldbauer-certat Jun 24, 2021
1253c3e
FIX: More generic way of using different (de)-serializers
waldbauer-certat May 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 225 additions & 0 deletions .github/workflows/scripts/ansible-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# SPDX-FileCopyrightText: 2021 Birger Schacht
#
# SPDX-License-Identifier: CC0-1.0
cymru-whois-expert:
bot_id: cymru-whois-expert
description: Cymru Whois (IP to ASN) is the bot responsible to add network information
to the events (BGP, ASN, AS Name, Country, etc..).
enabled: true
group: Expert
groupname: experts
module: intelmq.bots.experts.cymru_whois.expert
name: Cymru Whois
parameters:
destination_queues:
_default: [file-output-queue]
overwrite: true
redis_cache_db: 5
redis_cache_host: 127.0.0.1
redis_cache_password: null
redis_cache_port: 6379
redis_cache_ttl: 86400
run_mode: continuous
deduplicator-expert:
bot_id: deduplicator-expert
description: Deduplicator is the bot responsible for detection and removal of duplicate
messages. Messages get cached for <redis_cache_ttl> seconds. If found in the cache,
it is assumed to be a duplicate.
enabled: true
group: Expert
groupname: experts
module: intelmq.bots.experts.deduplicator.expert
name: Deduplicator
parameters:
destination_queues:
_default: [taxonomy-expert-queue]
filter_keys: raw,time.observation
filter_type: blacklist
redis_cache_db: 6
redis_cache_host: 127.0.0.1
redis_cache_port: 6379
redis_cache_ttl: 86400
run_mode: continuous
feodo-tracker-browse-collector:
description: Generic URL Fetcher is the bot responsible to get the report from an
URL.
enabled: true
group: Collector
module: intelmq.bots.collectors.http.collector_http
name: URL Fetcher
parameters:
destination_queues:
_default: [feodo-tracker-browse-parser-queue]
extract_files: false
http_password: null
http_url: https://feodotracker.abuse.ch/browse
http_url_formatting: false
http_username: null
name: Feodo Tracker Browse
provider: Abuse.ch
rate_limit: 86400
ssl_client_certificate: null
run_mode: continuous
feodo-tracker-browse-parser:
description: HTML Table Parser is a bot configurable to parse different html table
data.
enabled: true
group: Parser
module: intelmq.bots.parsers.html_table.parser
name: HTML Table
parameters:
attribute_name: ''
attribute_value: ''
columns: time.source,source.ip,malware.name,status,extra.SBL,source.as_name,source.geolocation.cc
default_url_protocol: http://
destination_queues:
_default: [deduplicator-expert-queue]
ignore_values: ',,,,Not listed,,'
skip_table_head: true
split_column: ''
split_index: 0
split_separator: ''
table_index: 0
time_format: null
type: c2server
run_mode: continuous
file-input:
bod_id: foobar
description: foobar
enabled: true
group: Collectors
module: intelmq.bots.collectors.file.collector_file
name: File Input
parameters:
delete_file: false
destination_queues:
_default: [file-output-queue]
path: /assets
postfix: .txt
run_mode: scheduled
file-output:
bot_id: file-output
description: File is the bot responsible to send events to a file.
enabled: true
group: Output
groupname: outputs
module: intelmq.bots.outputs.file.output
name: File
parameters: {file: /var/lib/intelmq/bots/file-output/events.txt, hierarchical_output: false,
single_key: null}
run_mode: continuous
gethostbyname-1-expert:
bot_id: gethostbyname-1-expert
description: fqdn2ip is the bot responsible to parsing the ip from the fqdn.
enabled: true
group: Expert
groupname: experts
module: intelmq.bots.experts.gethostbyname.expert
name: Gethostbyname
parameters:
destination_queues:
_default: [cymru-whois-expert-queue]
run_mode: continuous
gethostbyname-2-expert:
bot_id: gethostbyname-2-expert
description: fqdn2ip is the bot responsible to parsing the ip from the fqdn.
enabled: true
group: Expert
groupname: experts
module: intelmq.bots.experts.gethostbyname.expert
name: Gethostbyname
parameters:
destination_queues:
_default: [cymru-whois-expert-queue]
run_mode: continuous
malc0de-parser:
bot_id: malc0de-parser
description: Malc0de Parser is the bot responsible to parse the IP Blacklist and
either Windows Format or Bind Format reports and sanitize the information.
enabled: true
group: Parser
groupname: parsers
module: intelmq.bots.parsers.malc0de.parser
name: Malc0de
parameters:
destination_queues:
_default: [deduplicator-expert-queue]
run_mode: continuous
malc0de-windows-format-collector:
bot_id: malc0de-windows-format-collector
description: ''
enabled: true
group: Collector
groupname: collectors
module: intelmq.bots.collectors.http.collector_http
name: Malc0de Windows Format
parameters:
destination_queues:
_default: [malc0de-parser-queue]
http_password: null
http_url: https://malc0de.com/bl/BOOT
http_username: null
name: Windows Format
provider: Malc0de
rate_limit: 10800
ssl_client_certificate: null
run_mode: continuous
spamhaus-drop-collector:
bot_id: spamhaus-drop-collector
description: ''
enabled: true
group: Collector
groupname: collectors
module: intelmq.bots.collectors.http.collector_http
name: Spamhaus Drop
parameters:
destination_queues:
_default: [spamhaus-drop-parser-queue]
http_password: null
http_url: https://www.spamhaus.org/drop/drop.txt
http_username: null
name: Drop
provider: Spamhaus
rate_limit: 3600
ssl_client_certificate: null
run_mode: continuous
spamhaus-drop-parser:
bot_id: spamhaus-drop-parser
description: Spamhaus Drop Parser is the bot responsible to parse the DROP, EDROP,
DROPv6, and ASN-DROP reports and sanitize the information.
enabled: true
group: Parser
groupname: parsers
module: intelmq.bots.parsers.spamhaus.parser_drop
name: Spamhaus Drop
parameters:
destination_queues:
_default: [deduplicator-expert-queue]
run_mode: continuous
taxonomy-expert:
bot_id: taxonomy-expert
description: Taxonomy is the bot responsible to apply the eCSIRT Taxonomy to all
events.
enabled: true
group: Expert
groupname: experts
module: intelmq.bots.experts.taxonomy.expert
name: Taxonomy
parameters:
destination_queues:
_default: [url2fqdn-expert-queue]
run_mode: continuous
url2fqdn-expert:
bot_id: url2fqdn-expert
description: url2fqdn is the bot responsible to parsing the fqdn from the url.
enabled: true
group: Expert
groupname: experts
module: intelmq.bots.experts.url2fqdn.expert
name: URL2FQDN
parameters:
destination_queues:
_default: [gethostbyname-1-expert-queue, gethostbyname-2-expert-queue]
load_balance: true
overwrite: false
run_mode: continuous
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,19 @@ Update allowed classification fields to version 1.3 (2021-05-18) (by Sebastian W
- Add support for new field `SourceIpInfo.SourceIpv4Int` (PR#1940 by Sebastian Wagner).
- Fix mapping of "ConnectionType" fields, this is not `protocol.application`. Now mapped to `extra.*.connection_type` (PR#1940 by Sebastian Wagner).
- `intelmq.bots.parsers.shadowserver._config`:
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
- Add support for the new feeds *Honeypot-Amplification-DDoS-Events*, *Honeypot-Brute-Force-Events*, *Honeypot-Darknet*, *IP-Spoofer-Events*, *Sinkhole-Events*, *Sinkhole-HTTP-Events*, *Vulnerable-Exchange-Server*, *Sinkhole-Events-HTTP-Referer* (PR#1950, PR#1952, PR#1953, PR#1954, PR#1970 by Birger Schacht and Sebastian Wagner, PR#1971 by Mikk Margus Möll).
=======
- Add support for the new feeds *Honeypot-Amplification-DDoS-Events*, *Honeypot-Brute-Force-Events*, *Honeypot-Darknet*, *IP-Spoofer-Events*, *Sinkhole-Events*, *Sinkhole-HTTP-Events* (PR#1950, PR#1952, PR#1953 and PR#1954 by Birger Schacht and Sebastian Wagner).
>>>>>>> 366505cc6 (ENH: add event46_sinkhole shadowserver config & tests)
=======
- Add support for the new feeds *Honeypot-Amplification-DDoS-Events*, *Honeypot-Brute-Force-Events*, *Honeypot-Darknet*, *IP-Spoofer-Events*, *Sinkhole-Events*, *Sinkhole-HTTP-Events*, *Vulnerable-Exchange-Server* (PR#1950, PR#1952, PR#1953, PR#1954, PR#1970 by Birger Schacht and Sebastian Wagner).
>>>>>>> 4d3f4d647 (ENH+DOC: shadowserver exchange feed)
=======
- Add support for the new feeds *Honeypot-Amplification-DDoS-Events*, *Honeypot-Brute-Force-Events*, *Honeypot-Darknet*, *IP-Spoofer-Events*, *Sinkhole-Events*, *Sinkhole-HTTP-Events*, *Vulnerable-Exchange-Server*, *Sinkhole-Events-HTTP-Referer* (PR#1950, PR#1952, PR#1953, PR#1954, PR#1970 by Birger Schacht and Sebastian Wagner, PR#1971 by Mikk Margus Möll).
>>>>>>> f056ff7d4 (DOC for PR#1971)

#### Experts
- `intelmq.bots.experts.splunk_saved_search.expert`:
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ UPDATE events
UPDATE events
SET "classification.taxonomy" = 'information-content-security', "classification.type" = 'unauthorised-information-modification'
WHERE "classification.taxonomy" = 'intrusions', "classification.type" = 'defacement'
UPDATE events
SET "classification.taxonomy" = 'information-content-security', "classification.type" = 'unauthorised-information-modification'
WHERE "classification.taxonomy" = 'intrusions', "classification.type" = 'defacement'
UPDATE events
SET "classification.taxonomy" = 'malicious-code'
WHERE "classification.taxonomy" = 'malicious code';
Expand Down Expand Up @@ -284,7 +287,7 @@ CentOS 7 (with EPEL) provides both Python 3.4 and Python 3.6. If IntelMQ was ins
type and reloads them afterwards. Removes any external dependencies (such as curl or wget).
This is a replacement for shell scripts such as `update-tor-nodes`, `update-asn-data`,
`update-geoip-data`, `update-rfiprisk-data`.

Usage:
```
intelmq.bots.experts.asn_lookup.expert --update-database
Expand Down
2 changes: 2 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Build-Depends: debhelper (>= 4.1.16),
python3-sphinx-rtd-theme,
python3-termstyle,
python3-tz,
python3-msgpack,
quilt,
rsync,
safe-rm
Expand All @@ -41,6 +42,7 @@ Depends: bash-completion,
python3-ruamel.yaml,
python3-termstyle (>= 0.1.10),
python3-tz,
python3-msgpack,
redis-server,
systemd,
${misc:Depends},
Expand Down
34 changes: 32 additions & 2 deletions docs/user/bots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ Requires the `kafka python library <https://pypi.org/project/kafka/>`_.
* `ssl_ca_certificate`: Optional string of path to trusted CA certificate. Only used by some bots.


.. _intelmq.bots.collectors.misp.collector:


.. _intelmq.bots.collectors.misp.collector:

MISP Generic
Expand Down Expand Up @@ -641,6 +644,9 @@ Requires the rsync executable
* `temp_directory`: The temporary directory for rsync to use for rsync'd files. Optional. Default: `$VAR_STATE_PATH/rsync_collector`. `$VAR_STATE_PATH` is `/var/run/intelmq/` or `/opt/intelmq/var/run/`.


.. _intelmq.bots.collectors.shadowserver.collector_reports_api:


.. _intelmq.bots.collectors.shadowserver.collector_reports_api:

Shadowserver Reports API
Expand Down Expand Up @@ -1700,6 +1706,7 @@ It is required to look up the correct configuration.

Look at the documentation in the bot's ``_config.py`` file for more information.

.. _intelmq.bots.parsers.shodan.parser:

.. _intelmq.bots.parsers.shodan.parser:

Expand Down Expand Up @@ -1788,7 +1795,6 @@ Aggregate
**Configuration Parameters**

* **Cache parameters** (see in section :ref:`common-parameters`)

* TTL is not used, using it would result in data loss.
* **fields** Given fields which are used to aggregate like `classification.type, classification.identifier`
* **threshold** If the aggregated event is lower than the given threshold after the timespan, the event will get dropped.
Expand Down Expand Up @@ -1856,6 +1862,8 @@ Use this command to create/update the database and reload the bot:
The database is fetched from `routeviews.org <http://www.routeviews.org/routeviews/>`_ and licensed under the Creative Commons Attribution 4.0 International license (see the `routeviews FAQ <http://www.routeviews.org/routeviews/index.php/faq/#faq-6666>`_).


.. _intelmq.bots.experts.csv_converter.expert:

.. _intelmq.bots.experts.csv_converter.expert:

CSV Converter
Expand Down Expand Up @@ -1924,6 +1932,8 @@ RemoveAffix
Remove part of string from string, example: `www.` from domains.


.. _intelmq.bots.experts.domain_suffix.expert:

.. _intelmq.bots.experts.domain_suffix.expert:

Domain Suffix
Expand Down Expand Up @@ -2696,6 +2706,8 @@ RDAP
}


.. _intelmq.bots.experts.recordedfuture_iprisk.expert:

.. _intelmq.bots.experts.recordedfuture_iprisk.expert:

RecordedFuture IP risk
Expand Down Expand Up @@ -2986,6 +2998,23 @@ The following operators may be used to match events:
* Boolean values can be matched with `==` or `!=` followed by `true` or `false`. Example:
``if extra.has_known_vulns == true { ... }``

* `:equals` tests for equality between lists, including order. Example for checking a hostname-port pair:
``if extra.host_tuple :equals ['dns.google', 53] { ... }``
* `:setequals` tests for set-based equality (ignoring duplicates and value order) between a list of given values. Example for checking for the first nameserver of two domains, regardless of the order they are given in the list:
``if extra.hostnames :setequals ['ns1.example.com', 'ns1.example.mx'] { ... }``

* `:overlaps` tests if there is at least one element in common between the list specified by a key and a list of values. Example for checking if at least one of the ICS, database or vulnerable tags is given:
``if extra.tags :overlaps ['ics', 'database', 'vulnerable'] { ... } ``

* `:subsetof` tests if the list of values from the given key only contains values from a set of values specified as the argument. Example for checking for a host that has only ns1.example.com and/or ns2.[...] as its apparent hostname:
``if extra.hostnames :subsetof ['ns1.example.com', 'ns2.example.com'] { ... }``

* `:supersetof` tests if the list of values from the given key is a superset of the values specified as the argument. Example for matching hosts with at least the IoT and vulnerable tags:
``if extra.tags :supersetof ['iot', 'vulnerable'] { ... }``

* Boolean values can be matched with `==` or `!=` followed by `true` or `false`. Example:
``if extra.has_known_vulns == true { ... }``

* The combination of multiple expressions can be done using parenthesis and boolean operators:

``if (source.ip == '127.0.0.1') && (comment == 'add field' || classification.taxonomy == 'vulnerable') { ... }``
Expand Down Expand Up @@ -3396,7 +3425,6 @@ Events without `source.url`, `source.fqdn`, `source.ip`, or `source.asn`, are ig
only contains the domain. uWhoisd will automatically strip the subdomain part if it is present in the request.

Example: `https://www.theguardian.co.uk`

* TLD: `co.uk` (uWhoisd uses the `Mozilla public suffix list <https://publicsuffix.org/list/>`_ as a reference)
* Domain: `theguardian.co.uk`
* Subdomain: `www`
Expand Down Expand Up @@ -4099,6 +4127,8 @@ Then, set the `database` parameter to the `your-db.db` file path.

.. _intelmq.bots.outputs.stomp.output:

.. _intelmq.bots.outputs.stomp.output:

STOMP
^^^^^

Expand Down
Loading