List detected attacks
const url = 'https://api.nsin.ir/domains/example.com/attacks?limit=50';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.nsin.ir/domains/example.com/attacks?limit=50' \ --header 'Authorization: Bearer <token>'Attacks NSIN detected on the domain, newest first. An attack is a flood
of at least 5× the domain’s usual requests per minute for this hour
(and at least 3000 per minute) for two minutes. NSIN then looks for what
only the attack’s requests have (fingerprint, cookie name, path, …)
and, when automatic attack rules are on, adds a managed custom rule in
dry run (managed_by: attack_signature): it only counts what it would
block until it is enforced. An attack ends — and its rule is switched
off — after 30 minutes back near normal traffic. active is the open
attack, if any. Requires domain.view.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comQuery Parameters
Section titled “Query Parameters ”Responses
Section titled “ Responses ”The attacks.
object
object
volume: a flood, far more requests than usual. behaviour: the
traffic suddenly behaves differently (for example no CSS/JS/image
requests, no cookies, one HTTP version only), even at normal
volume. A behaviour attack ends after 30 minutes without the change.
What changed (behaviour attacks; empty for floods), strongest first, at most 8.
object
share: 0–1 of requests. ratio: requests per path or per IP.
The usual value at this hour of day.
The value during the attack.
How unusual the change is (larger = stronger).
Highest requests per minute seen.
Usual requests per minute for this hour of day.
object
object
The cookie name for cookie; else empty.
Share of the attack’s requests with this value (0–1).
Share of normal requests with this value (0–1).
The rule’s conditions as text; empty without a rule.
reference_day: the same time on the most normal recent day (behaviour attacks).
Share of the attack the rule matches.
Share of normal requests the rule would have hit; -1 = unknown.
object
"", “user:
object
volume: a flood, far more requests than usual. behaviour: the
traffic suddenly behaves differently (for example no CSS/JS/image
requests, no cookies, one HTTP version only), even at normal
volume. A behaviour attack ends after 30 minutes without the change.
What changed (behaviour attacks; empty for floods), strongest first, at most 8.
object
share: 0–1 of requests. ratio: requests per path or per IP.
The usual value at this hour of day.
The value during the attack.
How unusual the change is (larger = stronger).
Highest requests per minute seen.
Usual requests per minute for this hour of day.
object
object
The cookie name for cookie; else empty.
Share of the attack’s requests with this value (0–1).
Share of normal requests with this value (0–1).
The rule’s conditions as text; empty without a rule.
reference_day: the same time on the most normal recent day (behaviour attacks).
Share of the attack the rule matches.
Share of normal requests the rule would have hit; -1 = unknown.
object
"", “user:
Example
{ "attacks": [ { "status": "detected", "kind": "volume", "drift": [ { "feature": "asset", "group": "assets", "unit": "share" } ], "signature": { "features": [ { "field": "ja4h" } ], "baseline_window": "hour_before" }, "rule": { "action_mode": "enforce" } } ], "active": { "status": "detected", "kind": "volume", "drift": [ { "feature": "asset", "group": "assets", "unit": "share" } ], "signature": { "features": [ { "field": "ja4h" } ], "baseline_window": "hour_before" }, "rule": { "action_mode": "enforce" } }}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}