Skip to content

Commit 1eb14d6

Browse files
waldbauer-certatsebix
authored andcommitted
FIX: Remove AutoShun from IntelMQ as the feed is discontinued
Fixes #2162 Signed-off-by: Sebastian Waldbauer <waldbauer@cert.at>
1 parent 469dc49 commit 1eb14d6

File tree

9 files changed

+154
-268
lines changed

9 files changed

+154
-268
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ CHANGELOG
7777
- Added file name mapping for `SSL-POODLE-Vulnerable-Servers IPv6` (file name `scan6_ssl_poodle`) (PR#2134 by Mateo Durante).
7878
- `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)
7979
- `intelmq.bots.parsers.generic.parser_csv`: Use RewindableFileHandle to use the original current line for line recovery (PR#2192 by Sebastian Wagner).
80+
- `intelmq.bots.parsers.autoshun.parser`: Removed, as the feed is discontinued (PR#2214 by Sebastian Waldbauer, fixes #2162).
8081

8182
#### Experts
8283
- `intelmq.bots.experts.domain_valid`: New bot for checking domain's validity (PR#1966 by Marius Karotkis).

intelmq/bots/parsers/autoshun/__init__.py

Whitespace-only changes.

intelmq/bots/parsers/autoshun/parser.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

intelmq/etc/feeds.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -856,24 +856,6 @@ providers:
856856
revision: 2018-01-20
857857
documentation: https://dsi.ut-capitole.fr/blacklists/
858858
public: true
859-
Autoshun:
860-
Shunlist:
861-
description: You need to register in order to use the list.
862-
additional_information:
863-
bots:
864-
collector:
865-
module: intelmq.bots.collectors.http.collector_http
866-
parameters:
867-
http_url: https://www.autoshun.org/download/?api_key=__APIKEY__&format=html
868-
rate_limit: 3600
869-
name: __FEED__
870-
provider: __PROVIDER__
871-
parser:
872-
module: intelmq.bots.parsers.autoshun.parser
873-
parameters:
874-
revision: 2018-01-20
875-
documentation: https://www.autoshun.org/
876-
public: false
877859
Danger Rulez:
878860
Bruteforce Blocker:
879861
description: Its main purpose is to block SSH bruteforce attacks via firewall.

intelmq/lib/upgrades.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'v300_defaults_file_removal',
3737
'v300_pipeline_file_removal',
3838
'v301_deprecations',
39+
'v310_feed_changes',
3940
]
4041

4142

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

727728

729+
def v310_feed_changes(configuration, harmonization, dry_run, **kwargs):
730+
"""
731+
Migrates feeds' configuration for changed/fixed parameter
732+
"""
733+
found_autoshun = []
734+
messages = []
735+
for bot_id, bot in configuration.items():
736+
if bot_id == 'global':
737+
continue
738+
if bot["module"] == "intelmq.bots.collectors.http.collector":
739+
if bot["parameters"].get("http_url", "").startswith("https://www.autoshun.org/download"):
740+
found_autoshun.append(bot_id)
741+
if bot["module"] == "intelmq.bots.parsers.autoshun.parser":
742+
found_autoshun.append(bot_id)
743+
if found_autoshun:
744+
messages.append('A discontinued feed "Autoshun" has been found '
745+
f'as bot {", ".join(sorted(found_autoshun))}.')
746+
messages = ' '.join(messages)
747+
return messages + ' Remove affected bots yourself.' if messages else None, configuration, harmonization
748+
749+
728750
UPGRADES = OrderedDict([
729751
((1, 0, 0, 'dev7'), (v100_dev7_modify_syntax, )),
730752
((1, 1, 0), (v110_shadowserver_feednames, v110_deprecations)),
@@ -749,7 +771,7 @@ def v301_deprecations(configuration, harmonization, dry_run, **kwargs):
749771
((3, 0, 0), (v300_bots_file_removal, v300_defaults_file_removal, v300_pipeline_file_removal, )),
750772
((3, 0, 1), (v301_deprecations, )),
751773
((3, 0, 2), ()),
752-
((3, 1, 0), ()),
774+
((3, 1, 0), (v310_feed_changes, )),
753775
])
754776

755777
ALWAYS = (harmonization, )

intelmq/tests/bots/parsers/autoshun/__init__.py

Whitespace-only changes.

intelmq/tests/bots/parsers/autoshun/shunlist.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

intelmq/tests/bots/parsers/autoshun/test_parser.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)