i want to integrate IP reputation into Graylog via Spamhaus SIA API (Spamhaus Intelligence API (SIA) — Spamhaus Technology Documentation 2.0 documentation).
Anyone have experience with it?
The problem is that the token has to be requested via post-request and the running time is limited to 24 hours. Then the token has expired and a new post request is required.
An HTTP-JSON data adapter with a static header field is not usable.
My only idea is to set up a separate API JSON server. The server pulls the complete Spamhaus XBL records and creates a JSON dataset. I then use an HTTP-JSON data-adapter to query my local API. But, that’s not cool.
Your suggestion is good.
Unfortunately, Spamhaus SIA doesn’t work that way. There is no traditional way to save a token in a service account.
First step is, generate an auth token (from Spamhaus tech-docs):
To access the API, every request requires a proper Authorization header containing a specific token. Therefore, to get SIA access, you must pass the authentication stage.
To fetch your temporary token, send a request to the Login API, which you can access by sending a POST request to the /api/v1/login endpoint.
The POST payload should include a JSON object containing the username and the password, as set up in the customer portal, as the following example shows:
curl -s -d '
In the case of success, the HTTP status code will be 200 and the body will contain a JSON object similar to the following one:
The successful JSON response object will include an “expires” integer field detailing the Unix timestamp of when the token will expire. Usually, each token is valid for 24 hours.
The challenge is to request only one auth token within 24 hours. (or something requests more)
Otherwise I will be blocked for breaking the rules. e.g. DoS protection policy
Thank you for sharing. That’s great.
I’m looking for a Java developer in my company first
My idea for the plugin data adapter form (UI):
selection list for datasets (e.g. XBL, CSS, BCL, ALL)
Limits (query results range 1 - 2000)
Since (results with a timestamp greater than or equal to ‘since’)
In the plugin background function, an access token is created or renewed within 24 hours.
The current token is used dynamically for the API requests.
Then a lookup in the pipeline rule. In case of a detection, a field XY is set.
When I read that, I think it belongs in the ThreatIntel plugin