Skip to content

Commit 31f3512

Browse files
FIX: Remove AutoShun from IntelMQ as the feed is discontinued
Fixes #2162 Signed-off-by: Sebastian Waldbauer <waldbauer@cert.at>
1 parent 3b15e09 commit 31f3512

File tree

7 files changed

+26
-146
lines changed

7 files changed

+26
-146
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ CHANGELOG
7272
- `intelmq.bots.parsers.shadowserver._config`:
7373
- Added support for `Accessible AMQP`, `Device Identification Report` (IPv4 and IPv6) (PR#2134 by Mateo Durante).
7474
- Added file name mapping for `SSL-POODLE-Vulnerable-Servers IPv6` (file name `scan6_ssl_poodle`) (PR#2134 by Mateo Durante).
75+
- `intelmq.bots.parsers.autoshun.parser`: Removed, as the feed is discontinued (PR#2214 by Sebastian Waldbauer).
7576

7677
#### Experts
7778
- `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/lib/upgrades.py

Lines changed: 25 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,29 @@ 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 "http_url" not in bot["parameters"]:
740+
continue
741+
if 'autoshun.org' in bot["parameters"]["http_url"]:
742+
found_autoshun.append(bot_id)
743+
if bot["module"] == "intelmq.bots.parsers.autoshun.parser":
744+
found_autoshun.append(bot_id)
745+
if found_autoshun:
746+
messages.append('A discontinued feed "Autoshun" has been found '
747+
f'as bot {", ".join(sorted(found_autoshun))}.')
748+
messages = ' '.join(messages)
749+
return messages + ' Remove affected bots yourself.' if messages else None, configuration, harmonization
750+
751+
728752
UPGRADES = OrderedDict([
729753
((1, 0, 0, 'dev7'), (v100_dev7_modify_syntax, )),
730754
((1, 1, 0), (v110_shadowserver_feednames, v110_deprecations)),
@@ -749,7 +773,7 @@ def v301_deprecations(configuration, harmonization, dry_run, **kwargs):
749773
((3, 0, 0), (v300_bots_file_removal, v300_defaults_file_removal, v300_pipeline_file_removal, )),
750774
((3, 0, 1), (v301_deprecations, )),
751775
((3, 0, 2), ()),
752-
((3, 1, 0), ()),
776+
((3, 1, 0), (v310_feed_changes, )),
753777
])
754778

755779
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)