Skip to content

Commit 900e99e

Browse files
authored
Merge pull request #2658 from sebix/revert-viriback
Revert "feeds: remove viriback feed, is offline"
2 parents ace9f4c + f21f8ef commit 900e99e

File tree

5 files changed

+38
-36
lines changed

5 files changed

+38
-36
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
9595
### Documentation
9696
- Fix and refresh links to mailing lists (PR#2609 by Kamil Mańkowski)
9797
- `Aggregate Bot`: Add illustration graphics (PR#2612 by Sebastian Wagner).
98-
- Feeds: Remove discontinued feed Viriback (PR#2567 by Sebastian Wagner).
9998

10099
### Packaging
101100
- Replace `/opt/intelmq` example paths in bots with variable `VAR_STATE_PATH` for correct paths in LSB-path setups like with packages (PR#2587 by Sebastian Wagner).

NEWS.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ Python `>=3.9` is now required, which is available on all platforms supported by
1818

1919
### Tools
2020

21-
### Bots
22-
#### Blueliv
23-
The bots `intelmq.bots.collectors.blueliv` and `intelmq.bots.collectors.blueliv` are removed as they used an unmaintained library and do not work any more.
24-
25-
#### Viriback
26-
The Feed *Viriback C2 Tracker* is removed as the feed and website are no longer reachable and seem to be discontinued.
27-
2821
### Data Format
2922
To save new fields from IntelMQ Data Format in existing PostgreSQL instances, the following schema
3023
update is necessary:

intelmq/etc/feeds.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@
44

55
---
66
providers:
7+
ViriBack:
8+
C2 Tracker:
9+
description: Latest detected C2 servers.
10+
bots:
11+
collector:
12+
module: intelmq.bots.collectors.http.collector_http
13+
parameters:
14+
http_url: https://tracker.viriback.com/dump.php
15+
rate_limit: 86400
16+
name: __FEED__
17+
provider: __PROVIDER__
18+
parser:
19+
module: intelmq.bots.parsers.generic.csv_parser
20+
parameters:
21+
skip_header: true
22+
defaults_fields:
23+
classification.type: malware-distribution
24+
columns:
25+
- malware.name
26+
- source.url
27+
- source.ip
28+
- time.source
29+
revision: 2022-11-15
30+
documentation: https://viriback.com/
31+
public: true
732
Surbl:
833
Malicious Domains:
934
description: Detected malicious domains. Note that you have to opened up Sponsored Datafeed Service (SDS) access to the SURBL data via rsync for your IP address.

intelmq/lib/upgrades.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
'v322_url_replacement',
4343
'v322_removed_feeds_and_bots',
4444
'v340_deprecations',
45-
'v350_feed_removals',
45+
'v350_blueliv_removal',
4646
'v350_new_fields',
4747
]
4848

@@ -976,37 +976,27 @@ def v340_deprecations(configuration, harmonization, dry_run, **kwargs):
976976
return message or changed, configuration, harmonization
977977

978978

979-
def v350_feed_removals(configuration, harmonization, dry_run, **kwargs):
979+
def v350_blueliv_removal(configuration, harmonization, dry_run, **kwargs):
980980
"""
981981
Remove blueliv collector and parser
982982
"""
983-
messages = []
983+
message = None
984984
discontinued_bots = []
985985
discontinued_bots_modules = (
986986
"intelmq.bots.collectors.blueliv.collector_crimeserver",
987987
"intelmq.bots.parsers.blueliv.parser_crimeserver",
988988
)
989-
discontinued_feeds = []
990989

991990
for bot_id, bot in configuration.items():
992991
if bot_id == 'global':
993992
continue
994993
if bot["module"] in discontinued_bots_modules:
995994
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)}")
1002995

1003996
if discontinued_bots:
1004-
messages.append(f"Found discontinued bots: {', '.join(discontinued_bots)}.")
1005-
1006-
if messages:
1007-
messages.append("Remove the affected bots from the configuration.")
997+
message = f"Found discontinued bots: {', '.join(discontinued_bots)}. Remove the affected bots from the configuration."
1008998

1009-
return '\n'.join(messages) if messages else None, configuration, harmonization
999+
return message, configuration, harmonization
10101000

10111001

10121002
def v350_new_fields(configuration, harmonization, dry_run, **kwargs):
@@ -1068,7 +1058,7 @@ def v350_new_fields(configuration, harmonization, dry_run, **kwargs):
10681058
((3, 3, 0), ()),
10691059
((3, 3, 1), ()),
10701060
((3, 4, 0), (v340_deprecations, )),
1071-
((3, 5, 0), (v350_feed_removals, v350_new_fields)),
1061+
((3, 5, 0), (v350_blueliv_removal, v350_new_fields)),
10721062
])
10731063

10741064
ALWAYS = (harmonization,)

intelmq/tests/lib/test_upgrades.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -616,23 +616,18 @@
616616
"module": "intelmq.bots.collectors.twitter.collector",
617617
},
618618
}
619-
V350_FEED_REMOVAL = {
619+
V350_BLUELIV_REMOVAL = {
620620
"global": {},
621621
"blueliv-collector": {
622622
"module": "intelmq.bots.collectors.blueliv.collector_crimeserver"
623623
},
624624
"blueliv-parser": {
625625
"module": "intelmq.bots.parsers.blueliv.parser_crimeserver"
626-
},
627-
"viriback-collector": {
628-
"module": "intelmq.bots.collectors.http.collector_http",
629-
"parameters": {
630-
"http_url": "https://tracker.viriback.com/dump.php"
631-
}
632626
}
633627
}
634628

635629

630+
636631
def generate_function(function):
637632
def test_function(self):
638633
""" Test if no errors happen for upgrade function %s. """ % function.__name__
@@ -870,13 +865,12 @@ def test_v340_twitter_collector(self):
870865
self.assertIn('twitter-collector', result[0])
871866
self.assertEqual(V340_TWITTER_COLLECTOR_IN, result[1])
872867

873-
def test_v350_feed(self):
874-
""" Test v350_feed_removals deprecation warning """
875-
result = upgrades.v350_feed_removals(V350_FEED_REMOVAL, {}, False)
868+
def test_v350_blueliv_removal(self):
869+
""" Test v350_blueliv_removal deprecation warning """
870+
result = upgrades.v350_blueliv_removal(V350_BLUELIV_REMOVAL, {}, False)
876871
self.assertIn('blueliv-collector', result[0])
877872
self.assertIn('blueliv-parser', result[0])
878-
self.assertIn('viriback-collector', result[0])
879-
self.assertEqual(V350_FEED_REMOVAL, result[1])
873+
self.assertEqual(V350_BLUELIV_REMOVAL, result[1])
880874

881875
def test_v350_new_fields(self):
882876
""" Test adding new harmonisation fields """
@@ -892,6 +886,7 @@ def test_v350_new_fields(self):
892886
self.assertIn("severity", result[2]["event"])
893887

894888

889+
895890
for name in upgrades.__all__:
896891
setattr(TestUpgradeLib, 'test_function_%s' % name,
897892
generate_function(getattr(upgrades, name)))

0 commit comments

Comments
 (0)