You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# Changelog
2
2
3
+
### 2.10.0
4
+
-[NEW] Support HMAC signature authentication for feed endpoints and CLI (`--no-sign-api-key`).
5
+
-[UPDATE] Officially support all available feed parameters and CLI options across real-time threat feed endpoints (including `--frombeginning`, risk filters, and IP-specific filters).
6
+
-[FIX] Prevent authentication credentials from being passed as plain-text query parameters when header or HMAC authentication is enabled.
7
+
-[FIX] Remove incorrect requirement for `sessionID`, `after`, or `before` parameters when using the feed download endpoint.
8
+
3
9
### 2.9.0
4
10
-[NEW] Add support for querying real-time IP feeds (`iphotlist` and `iprisk`).
5
11
-[FIX] Type hint used for `top` parameter in Feeds API from str to int.
RTTF feeds also support HMAC signing as an opt-in via `always_sign_api_key=True` — see the RTTF section below.
267
+
268
+
256
269
Real-Time Threat Feeds
257
270
===================
258
271
@@ -264,18 +277,24 @@ Custom parameters aside from the common `GET` Request parameters:
264
277
api = API(USERNAME, KEY)
265
278
api.nod(endpoint="feed", **kwargs)
266
279
```
267
-
-`header_authentication`: by default, we're using API Header Authentication. Set this False if you want to use API Key and Secret Authentication. Apparently, you can't use APIHeader Authentication for`download` endpoints so this will be defaulted to `False`even without explicitly setting it.
280
+
-`header_authentication`: by default, allRTTF endpoints (both `feed`and`download`) use APIHeader Authentication, sending the APIkey via the `X-Api-Key` header. Set this to `False`to pass the API key as a query parameter instead.
268
281
```python
269
282
api = API(USERNAME, KEY, header_authentication=False)
270
283
api.nod(**kwargs)
271
284
```
285
+
-`always_sign_api_key`: set to `True` to use HMAC-SHA256 signed authentication instead of header auth. When set, `header_authentication` automatically defaults to `False` — both methods do not fire simultaneously. The signing algorithm is identical to the standard API: `HMAC-SHA256(key, username + timestamp + path)`, with`timestamp`and`signature` sent as query parameters.
286
+
```python
287
+
api = API(USERNAME, KEY, always_sign_api_key=True)
288
+
api.nod(after="-60")
289
+
# sends: api_username, timestamp, signature — no X-Api-Key header
290
+
```
272
291
-`output_format`: (choose either `csv`or`jsonl`- default is`jsonl`). Cannot be used in`domainrdap` feeds. Additionally, `csv`isnot available for`download` endpoints.
273
292
```python
274
293
api = API(USERNAME, KEY)
275
294
api.nod(output_format="csv", **kwargs)
276
295
```
277
296
278
-
The Feed APIstandard access pattern is to periodically request the most recent feed data,as often as every 60 seconds. Specify the range of data you receive in one of two ways:
297
+
The `feed` endpoint streams live NDJSON data. The standard access pattern is to pollas often as every 60 seconds. Specify the range of data you receive in one of two ways:
279
298
280
299
1. With `sessionID`: Make a call and provide a new `sessionID` parameter of your choosing. The API will return the last hour of data by default.
281
300
- Each subsequent call to the API using your `sessionID` will returnall data since the last.
@@ -284,9 +303,75 @@ The Feed API standard access pattern is to periodically request the most recent
284
303
- Either an `after=-60` query parameter, where (in this example) -60 indicates the previous 60 seconds.
285
304
- Or `after`and`before` query parameters for a time range, with each parameter accepting an ISO-8601UTC formatted timestamp (a UTC date and time of the formatYYYY-MM-DDThh:mm:ssZ)
286
305
287
-
## Handling iterative response from RTUF endpoints:
306
+
The `download` endpoint returns a standard JSON response (not a stream) listing available S3 batch files. Time parameters (`sessionID`, `after`, `before`) are **not** required for download calls.
307
+
308
+
```python
309
+
api = API(USERNAME, KEY)
310
+
result = api.nod(endpoint="download", limit=5)
311
+
print(result["download_name"])
312
+
for f in result["files"]:
313
+
print(f["name"], f["url"])
314
+
```
315
+
316
+
### Feed parameters
317
+
318
+
The feed methods accept the following parameters, grouped by purpose. Availability depends on the feed (see the notes below the table).
319
+
320
+
#### Session Management Parameters
321
+
322
+
-`sessionID`: A custom string used to distinguish between different sessions. Required when using `fromBeginning`.
323
+
-`after`: Start of the query window. Either an integer offset relative to now in seconds (e.g. `-60`), or an absolute ISO8601UTC datetime (`YYYY-MM-DDTHH:MM:SSZ`).
324
+
-`before`: End of the query window (inclusive). Either an integer from`-1` to `-432000` (seconds before now), or an absolute ISO8601UTC datetime. The query window covers at most the most recent 5 days; a value older than 5 days returns no records.
325
+
-`fromBeginning`: Boolean (`true`/`false`/`1`/`0`, default `false`). Requires a valid `sessionID`. When `true` on the first request of a new session, returns the first hour of data in the time window instead of the last. Using it with an existing `sessionID` returns an HTTP406; using it without a `sessionID`orwith a non-boolean value returns an HTTP422.
-`domain`: Filter for an exact domain or a substring contained within a domain by prefixing or suffixing your substring with`*`.
335
+
-`overall_min`, `malware_min`, `phishing_min`, `spam_min`, `proximity_min`: Integer risk score thresholds (range`1` to `99`, optional). Available on the `realtime_domain_risk`and`domainhotlist` feeds only. When multiple are supplied they act as a logical AND — a domain must meet ALL specified thresholds to be returned.
-IP feed filters (available on the `iprisk`and`iphotlist` feeds only). All are optional integers/strings and combine as a logical AND:
343
+
- Domain activity & volume: `pdns_resolutions_min`, `bad_pdns_resolutions_min` (positive integers, distinct/bad domains resolving to the IPin the last 24 hours) and`total_domains_max` (positive integer; caps total hosted domains to filter out superhosters like CDNs).
344
+
- Threat intelligence & combined risk percentages: `third_party_threats_min` (positive integer), plus `all_threats_combined_percent_min`, `combined_phishing_percent_min`, `combined_malware_percent_min`, `combined_spam_percent_min` (percentages `0` to `100` of hosted domains confirmed or predicted malicious).
345
+
- Confirmed threat percentages: `all_threats_percent_min`, `percent_phishing_min`, `percent_malware_min`, `percent_spam_min` (percentages `0` to `100` of hosted domains actively confirmed).
346
+
- Infrastructure & geolocation: `asn` (integer, digits only — no `AS` prefix or wildcards), `organization` (exact name, no wildcards) and`country_code` (case-sensitive two-letter code, e.g. `CN`, `US`, `NL`).
## Handling iterative response from RTTF endpoints:
288
373
289
-
Since we may dealing with large feeds datasets, the python wrapper uses `generator`for efficient memory handling. Therefore, we need to iterate through the `generator`if we're accessing the partial results of the feeds data.
374
+
Since we may be dealing with large feeds datasets, the python wrapper uses `generator`for efficient memory handling. Therefore, we need to iterate through the `generator`if we're accessing the partial results of the feeds data.
290
375
291
376
### Single request because the requested data is within the maximum result:
0 commit comments