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

FIX: Remove AutoShun from IntelMQ as the feed is discontinued #2214

Merged
merged 2 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/codespell.excludelines
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The correct name for the parameter "delimeter" is "delimiter". Please fix your c
WHERE "event_description.text" = 'The infected iot device logged in to a honeypot and issued malicous commands.' AND "classification.taxonomy" = 'intrusions' AND "classification.type" = 'unauthorized-command' AND "classification.identifier" = 'iot' AND "feed.name" = 'Spamhaus CERT';

# from intelmq/tests/lib/test_upgrades.py
"delimeter": ","
"delimeter": ",",
"delimeter": ","
"delimeter": ",",

# from intelmq/lib/upgrades.py
if "delimeter" in bot["parameters"] and "delimiter" in bot["parameters"]:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ CHANGELOG
- Added file name mapping for `SSL-POODLE-Vulnerable-Servers IPv6` (file name `scan6_ssl_poodle`) (PR#2134 by Mateo Durante).
- `intelmq.bots.parsers.cymru.parser_cap_program`: The parser mapped the hostname into `source.fqdn` which is not allowed by the IntelMQ Data Format. Added a check (PR#2215 by Sebastian Waldbauer, fixes #2169)
- `intelmq.bots.parsers.generic.parser_csv`: Use RewindableFileHandle to use the original current line for line recovery (PR#2192 by Sebastian Wagner).
- `intelmq.bots.parsers.autoshun.parser`: Removed, as the feed is discontinued (PR#2214 by Sebastian Waldbauer, fixes #2162).

#### Experts
- `intelmq.bots.experts.domain_valid`: New bot for checking domain's validity (PR#1966 by Marius Karotkis).
Expand Down
Empty file.
63 changes: 0 additions & 63 deletions intelmq/bots/parsers/autoshun/parser.py

This file was deleted.

18 changes: 0 additions & 18 deletions intelmq/etc/feeds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -856,24 +856,6 @@ providers:
revision: 2018-01-20
documentation: https://dsi.ut-capitole.fr/blacklists/
public: true
Autoshun:
Shunlist:
description: You need to register in order to use the list.
additional_information:
bots:
collector:
module: intelmq.bots.collectors.http.collector_http
parameters:
http_url: https://www.autoshun.org/download/?api_key=__APIKEY__&format=html
rate_limit: 3600
name: __FEED__
provider: __PROVIDER__
parser:
module: intelmq.bots.parsers.autoshun.parser
parameters:
revision: 2018-01-20
documentation: https://www.autoshun.org/
public: false
Danger Rulez:
Bruteforce Blocker:
description: Its main purpose is to block SSH bruteforce attacks via firewall.
Expand Down
24 changes: 23 additions & 1 deletion intelmq/lib/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'v300_defaults_file_removal',
'v300_pipeline_file_removal',
'v301_deprecations',
'v310_feed_changes',
]


Expand Down Expand Up @@ -725,6 +726,27 @@ def v301_deprecations(configuration, harmonization, dry_run, **kwargs):
return messages + ' Remove affected bots yourself.' if messages else changed, configuration, harmonization


def v310_feed_changes(configuration, harmonization, dry_run, **kwargs):
"""
Migrates feeds' configuration for changed/fixed parameter
"""
found_autoshun = []
messages = []
for bot_id, bot in configuration.items():
if bot_id == 'global':
continue
if bot["module"] == "intelmq.bots.collectors.http.collector":
if bot["parameters"].get("http_url", "").startswith("https://www.autoshun.org/download"):
found_autoshun.append(bot_id)
if bot["module"] == "intelmq.bots.parsers.autoshun.parser":
found_autoshun.append(bot_id)
if found_autoshun:
messages.append('A discontinued feed "Autoshun" has been found '
f'as bot {", ".join(sorted(found_autoshun))}.')
messages = ' '.join(messages)
return messages + ' Remove affected bots yourself.' if messages else None, configuration, harmonization


UPGRADES = OrderedDict([
((1, 0, 0, 'dev7'), (v100_dev7_modify_syntax, )),
((1, 1, 0), (v110_shadowserver_feednames, v110_deprecations)),
Expand All @@ -749,7 +771,7 @@ def v301_deprecations(configuration, harmonization, dry_run, **kwargs):
((3, 0, 0), (v300_bots_file_removal, v300_defaults_file_removal, v300_pipeline_file_removal, )),
((3, 0, 1), (v301_deprecations, )),
((3, 0, 2), ()),
((3, 1, 0), ()),
((3, 1, 0), (v310_feed_changes, )),
])

ALWAYS = (harmonization, )
Empty file.
17 changes: 0 additions & 17 deletions intelmq/tests/bots/parsers/autoshun/shunlist.html

This file was deleted.

65 changes: 0 additions & 65 deletions intelmq/tests/bots/parsers/autoshun/test_parser.py

This file was deleted.

Loading