File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
intelmq/bots/collectors/shadowserver Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 22
22
- ` intelmq.bots.collectors.shadowserver.collector_reports_api.py ` :
23
23
- Added support for the types parameter to be either a string or a list.
24
24
- Refactored to utilize the type field returned by the API to match the requested types instead of a sub-string match on the filename.
25
+ - Fixed timezone issue for collecting reports.
25
26
- ` intelmq.bots.collectors.shodan.collector_stream ` (PR #2492 by Mikk Margus Möll):
26
27
- Add ` alert ` parameter to Shodan stream collector to allow fetching streams by configured alert ID
27
28
Original file line number Diff line number Diff line change 4
4
SPDX-FileCopyrightText: 2020 Intelmq Team <intelmq-team@cert.at>
5
5
SPDX-License-Identifier: AGPL-3.0-or-later
6
6
"""
7
- from datetime import datetime , timedelta
7
+ from datetime import datetime , timedelta , timezone
8
8
import json
9
9
import hashlib
10
10
import hmac
@@ -89,12 +89,11 @@ def _reports_list(self, date=None):
89
89
again.
90
90
"""
91
91
if date is None :
92
- date = datetime .today ().date ()
93
- daybefore = date - timedelta (2 )
94
- dayafter = date + timedelta (1 )
92
+ date = datetime .now (timezone .utc ).date ()
93
+ begin = date - timedelta (2 )
95
94
96
95
data = self .preamble
97
- data += f',"date": "{ daybefore .isoformat ()} :{ dayafter .isoformat ()} " '
96
+ data += f',"date": "{ begin .isoformat ()} :{ date .isoformat ()} " '
98
97
if len (self ._report_list ) > 0 :
99
98
data += f',"reports": { json .dumps (self ._report_list )} '
100
99
data += '}'
You can’t perform that action at this time.
0 commit comments