@aikidosec/firewall
Version:
Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.
22 lines (21 loc) • 774 B
TypeScript
import type { Context } from "../../agent/Context";
export declare class AttackWaveDetector {
private suspiciousRequestsMap;
private sentEventsMap;
private readonly attackWaveThreshold;
private readonly attackWaveTimeFrame;
private readonly minTimeBetweenEvents;
private readonly maxLRUEntries;
constructor(options?: {
attackWaveThreshold?: number;
attackWaveTimeFrame?: number;
minTimeBetweenEvents?: number;
maxLRUEntries?: number;
});
/**
* Checks if the request is part of an attack wave
* Will report to core once in a defined time frame when the threshold is exceeded
* @returns true if an attack wave is detected and should be reported
*/
check(context: Context): boolean;
}