|
42 | 42 | 'v322_url_replacement', |
43 | 43 | 'v322_removed_feeds_and_bots', |
44 | 44 | 'v340_deprecations', |
45 | | - 'v350_blueliv_removal', |
| 45 | + 'v350_feed_removals', |
46 | 46 | 'v350_new_fields', |
47 | 47 | ] |
48 | 48 |
|
@@ -723,7 +723,7 @@ def v301_deprecations(configuration, harmonization, dry_run, **kwargs): |
723 | 723 | continue |
724 | 724 | if bot["module"] == "intelmq.bots.parsers.malwaredomains.parser": |
725 | 725 | found_malwaredomainsparser.append(bot_id) |
726 | | - if bot["module"] == "intelmq.bots.collectors.http.collector": |
| 726 | + if bot["module"] == "intelmq.bots.collectors.http.collector_http": |
727 | 727 | if "http_url" not in bot["parameters"]: |
728 | 728 | continue |
729 | 729 | if bot["parameters"]["http_url"] == 'http://mirror1.malwaredomains.com/files/domains.txt': |
@@ -788,7 +788,7 @@ def v310_feed_changes(configuration, harmonization, dry_run, **kwargs): |
788 | 788 | continue |
789 | 789 | if bot["module"] == "intelmq.bots.parsers.malc0de.parser": |
790 | 790 | found_malc0de.append(bot_id) |
791 | | - if bot["module"] == "intelmq.bots.collectors.http.collector": |
| 791 | + if bot["module"] == "intelmq.bots.collectors.http.collector_http": |
792 | 792 | http_url = bot["parameters"].get("http_url", "") |
793 | 793 | if http_url.startswith("https://malc0de.com/bl"): |
794 | 794 | found_malc0de.append(bot_id) |
@@ -876,7 +876,7 @@ def v320_update_turris_greylist_url(configuration, harmonization, dry_run, **kwa |
876 | 876 | messages = [] |
877 | 877 |
|
878 | 878 | for bot_id, bot in configuration.items(): |
879 | | - if bot.get("module") == "intelmq.bots.collectors.http.collector": |
| 879 | + if bot.get("module") == "intelmq.bots.collectors.http.collector_http": |
880 | 880 | if bot.get("parameters", {}).get("http_url", "").startswith("https://project.turris.cz/greylist-data/greylist-latest.csv"): |
881 | 881 | bot["parameters"]["http_url"] = "https://view.sentinel.turris.cz/greylist-data/greylist-latest.csv" |
882 | 882 | messages.append("Turris Greylist feed URL updated.") |
@@ -937,7 +937,7 @@ def v322_removed_feeds_and_bots(configuration, harmonization, dry_run, **kwargs) |
937 | 937 | if bot["module"] in discontinued_bots_modules: |
938 | 938 | discontinued_bots.append(bot_id) |
939 | 939 |
|
940 | | - elif bot["module"] == "intelmq.bots.collectors.http.collector": |
| 940 | + elif bot["module"] == "intelmq.bots.collectors.http.collector_http": |
941 | 941 | url: str = bot["parameters"].get("http_url", "") |
942 | 942 |
|
943 | 943 | if url in discontinued_feeds_urls: |
@@ -976,27 +976,37 @@ def v340_deprecations(configuration, harmonization, dry_run, **kwargs): |
976 | 976 | return message or changed, configuration, harmonization |
977 | 977 |
|
978 | 978 |
|
979 | | -def v350_blueliv_removal(configuration, harmonization, dry_run, **kwargs): |
| 979 | +def v350_feed_removals(configuration, harmonization, dry_run, **kwargs): |
980 | 980 | """ |
981 | 981 | Remove blueliv collector and parser |
982 | 982 | """ |
983 | | - message = None |
| 983 | + messages = [] |
984 | 984 | discontinued_bots = [] |
985 | 985 | discontinued_bots_modules = ( |
986 | 986 | "intelmq.bots.collectors.blueliv.collector_crimeserver", |
987 | 987 | "intelmq.bots.parsers.blueliv.parser_crimeserver", |
988 | 988 | ) |
| 989 | + discontinued_feeds = [] |
989 | 990 |
|
990 | 991 | for bot_id, bot in configuration.items(): |
991 | 992 | if bot_id == 'global': |
992 | 993 | continue |
993 | 994 | if bot["module"] in discontinued_bots_modules: |
994 | 995 | discontinued_bots.append(bot_id) |
| 996 | + elif bot["module"] == "intelmq.bots.collectors.http.collector_http": |
| 997 | + if bot["parameters"].get("http_url", "") == 'https://tracker.viriback.com/dump.php': |
| 998 | + discontinued_feeds.append(bot_id) |
| 999 | + |
| 1000 | + if discontinued_feeds: |
| 1001 | + messages.append(f"Found discontinued feeds collected by bots: {', '.join(discontinued_feeds)}") |
995 | 1002 |
|
996 | 1003 | if discontinued_bots: |
997 | | - message = f"Found discontinued bots: {', '.join(discontinued_bots)}. Remove the affected bots from the configuration." |
| 1004 | + messages.append(f"Found discontinued bots: {', '.join(discontinued_bots)}.") |
| 1005 | + |
| 1006 | + if messages: |
| 1007 | + messages.append("Remove the affected bots from the configuration.") |
998 | 1008 |
|
999 | | - return message, configuration, harmonization |
| 1009 | + return '\n'.join(messages) if messages else None, configuration, harmonization |
1000 | 1010 |
|
1001 | 1011 |
|
1002 | 1012 | def v350_new_fields(configuration, harmonization, dry_run, **kwargs): |
@@ -1058,7 +1068,7 @@ def v350_new_fields(configuration, harmonization, dry_run, **kwargs): |
1058 | 1068 | ((3, 3, 0), ()), |
1059 | 1069 | ((3, 3, 1), ()), |
1060 | 1070 | ((3, 4, 0), (v340_deprecations, )), |
1061 | | - ((3, 5, 0), (v350_blueliv_removal, v350_new_fields)), |
| 1071 | + ((3, 5, 0), (v350_feed_removals, v350_new_fields)), |
1062 | 1072 | ]) |
1063 | 1073 |
|
1064 | 1074 | ALWAYS = (harmonization,) |
0 commit comments