UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks

43 lines (42 loc) 1.76 kB
import { LimitedContext } from "../helpers/matchEndpoints"; import { Endpoint } from "./Config"; import { IPList } from "./api/fetchBlockedLists"; export declare class ServiceConfig { private lastUpdatedAt; private receivedAnyStats; private blockedUserIds; private bypassedIPAddresses; private nonGraphQLEndpoints; private graphqlFields; private blockedIPAddresses; private blockedUserAgentRegex; private allowedIPAddresses; constructor(endpoints: Endpoint[], lastUpdatedAt: number, blockedUserIds: string[], bypassedIPAddresses: string[], receivedAnyStats: boolean, blockedIPAddresses: IPList[], allowedIPAddresses: IPList[]); private setEndpoints; getEndpoints(context: LimitedContext): Endpoint[]; getGraphQLField(context: LimitedContext, name: string, operationType: string): Endpoint | undefined; private setBypassedIPAddresses; isBypassedIP(ip: string): boolean; private setBlockedUserIds; isUserBlocked(userId: string): boolean; isIPAddressBlocked(ip: string): { blocked: true; reason: string; } | { blocked: false; }; private setBlockedIPAddresses; updateBlockedIPAddresses(blockedIPAddresses: IPList[]): void; updateBlockedUserAgents(blockedUserAgents: string): void; isUserAgentBlocked(ua: string): { blocked: boolean; }; private setAllowedIPAddresses; updateAllowedIPAddresses(ipAddresses: IPList[]): void; isAllowedIPAddress(ip: string): { allowed: boolean; }; updateConfig(endpoints: Endpoint[], lastUpdatedAt: number, blockedUserIds: string[], bypassedIPAddresses: string[], hasReceivedAnyStats: boolean): void; getLastUpdatedAt(): number; hasReceivedAnyStats(): boolean; }