BaseSecurityDecorator
Defined in: core/src/decorators/base.ts:17
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BaseSecurityDecorator(
config,logger?):BaseSecurityDecorator
Defined in: core/src/decorators/base.ts:24
Parameters
Section titled “Parameters”config
Section titled “config”agentApiKey
Section titled “agentApiKey”string | null = ...
agentBufferSize
Section titled “agentBufferSize”number = ...
agentEnableEvents
Section titled “agentEnableEvents”boolean = ...
agentEnableMetrics
Section titled “agentEnableMetrics”boolean = ...
agentEndpoint
Section titled “agentEndpoint”string = ...
agentFlushInterval
Section titled “agentFlushInterval”number = ...
agentProjectId
Section titled “agentProjectId”string | null = ...
agentRetryAttempts
Section titled “agentRetryAttempts”number = ...
agentTimeout
Section titled “agentTimeout”number = ...
autoBanDuration
Section titled “autoBanDuration”number = ...
autoBanThreshold
Section titled “autoBanThreshold”number = ...
blacklist
Section titled “blacklist”string[] = ...
blockCloudProviders
Section titled “blockCloudProviders”Set<"AWS" | "GCP" | "Azure"> = ...
blockedCountries
Section titled “blockedCountries”string[] = ...
blockedUserAgents
Section titled “blockedUserAgents”string[] = ...
cloudIpRefreshInterval
Section titled “cloudIpRefreshInterval”number = ...
corsAllowCredentials
Section titled “corsAllowCredentials”boolean = ...
corsAllowHeaders
Section titled “corsAllowHeaders”string[] = ...
corsAllowMethods
Section titled “corsAllowMethods”string[] = ...
corsAllowOrigins
Section titled “corsAllowOrigins”string[] = ...
corsExposeHeaders
Section titled “corsExposeHeaders”string[] = ...
corsMaxAge
Section titled “corsMaxAge”number = ...
customErrorResponses
Section titled “customErrorResponses”Record<number, string> = ...
customLogFile
Section titled “customLogFile”string | null = ...
customRequestCheck?
Section titled “customRequestCheck?”(req) => Promise<GuardResponse | null> = ...
customResponseModifier?
Section titled “customResponseModifier?”(res) => Promise<GuardResponse> = ...
detectionAnomalyThreshold
Section titled “detectionAnomalyThreshold”number = ...
detectionCompilerTimeout
Section titled “detectionCompilerTimeout”number = ...
detectionMaxContentLength
Section titled “detectionMaxContentLength”number = ...
detectionMaxTrackedPatterns
Section titled “detectionMaxTrackedPatterns”number = ...
detectionMonitorHistorySize
Section titled “detectionMonitorHistorySize”number = ...
detectionPreserveAttackPatterns
Section titled “detectionPreserveAttackPatterns”boolean = ...
detectionSemanticThreshold
Section titled “detectionSemanticThreshold”number = ...
detectionSlowPatternThreshold
Section titled “detectionSlowPatternThreshold”number = ...
dynamicRuleInterval
Section titled “dynamicRuleInterval”number = ...
emergencyMode
Section titled “emergencyMode”boolean = ...
emergencyWhitelist
Section titled “emergencyWhitelist”string[] = ...
enableAgent
Section titled “enableAgent”boolean = ...
enableCors
Section titled “enableCors”boolean = ...
enableDynamicRules
Section titled “enableDynamicRules”boolean = ...
enableIpBanning
Section titled “enableIpBanning”boolean = ...
enablePenetrationDetection
Section titled “enablePenetrationDetection”boolean = ...
enableRateLimiting
Section titled “enableRateLimiting”boolean = ...
enableRedis
Section titled “enableRedis”boolean = ...
endpointRateLimits
Section titled “endpointRateLimits”Record<string, [number, number]> = ...
enforceHttps
Section titled “enforceHttps”boolean = ...
excludePaths
Section titled “excludePaths”string[] = ...
geoIpHandler?
Section titled “geoIpHandler?”GeoIPHandler = ...
geoResolver?
Section titled “geoResolver?”(ip) => string | null = ...
logFormat
Section titled “logFormat”"text" | "json" = ...
logger?
Section titled “logger?”Logger = ...
logRequestLevel
Section titled “logRequestLevel”"INFO" | "DEBUG" | "WARNING" | "ERROR" | "CRITICAL" | null = ...
logSuspiciousLevel
Section titled “logSuspiciousLevel”"INFO" | "DEBUG" | "WARNING" | "ERROR" | "CRITICAL" | null = ...
passiveMode
Section titled “passiveMode”boolean = ...
rateLimit
Section titled “rateLimit”number = ...
rateLimitWindow
Section titled “rateLimitWindow”number = ...
redisPrefix
Section titled “redisPrefix”string = ...
redisUrl
Section titled “redisUrl”string = ...
securityHeaders
Section titled “securityHeaders”{ contentTypeOptions: string; csp: Record<string, string[]> | null; custom: Record<string, string> | null; enabled: boolean; frameOptions: "DENY" | "SAMEORIGIN"; hsts?: { includeSubdomains: boolean; maxAge: number; preload: boolean; }; permissionsPolicy: string; referrerPolicy: string; xssProtection: string; } | null = ...
trustedProxies
Section titled “trustedProxies”string[] = ...
trustedProxyDepth
Section titled “trustedProxyDepth”number = ...
trustXForwardedProto
Section titled “trustXForwardedProto”boolean = ...
whitelist
Section titled “whitelist”string[] | null = ...
whitelistCountries
Section titled “whitelistCountries”string[] = ...
logger?
Section titled “logger?”Returns
Section titled “Returns”BaseSecurityDecorator
Properties
Section titled “Properties”agentHandler
Section titled “agentHandler”agentHandler:
AgentHandlerProtocol|null=null
Defined in: core/src/decorators/base.ts:20
behaviorTracker
Section titled “behaviorTracker”behaviorTracker:
BehaviorTracker
Defined in: core/src/decorators/base.ts:19
config
Section titled “config”
readonlyconfig:object
Defined in: core/src/decorators/base.ts:21
agentApiKey
Section titled “agentApiKey”agentApiKey:
string|null
agentBufferSize
Section titled “agentBufferSize”agentBufferSize:
number
agentEnableEvents
Section titled “agentEnableEvents”agentEnableEvents:
boolean
agentEnableMetrics
Section titled “agentEnableMetrics”agentEnableMetrics:
boolean
agentEndpoint
Section titled “agentEndpoint”agentEndpoint:
string
agentFlushInterval
Section titled “agentFlushInterval”agentFlushInterval:
number
agentProjectId
Section titled “agentProjectId”agentProjectId:
string|null
agentRetryAttempts
Section titled “agentRetryAttempts”agentRetryAttempts:
number
agentTimeout
Section titled “agentTimeout”agentTimeout:
number
autoBanDuration
Section titled “autoBanDuration”autoBanDuration:
number
autoBanThreshold
Section titled “autoBanThreshold”autoBanThreshold:
number
blacklist
Section titled “blacklist”blacklist:
string[]
blockCloudProviders
Section titled “blockCloudProviders”blockCloudProviders:
Set<"AWS"|"GCP"|"Azure">
blockedCountries
Section titled “blockedCountries”blockedCountries:
string[]
blockedUserAgents
Section titled “blockedUserAgents”blockedUserAgents:
string[]
cloudIpRefreshInterval
Section titled “cloudIpRefreshInterval”cloudIpRefreshInterval:
number
corsAllowCredentials
Section titled “corsAllowCredentials”corsAllowCredentials:
boolean
corsAllowHeaders
Section titled “corsAllowHeaders”corsAllowHeaders:
string[]
corsAllowMethods
Section titled “corsAllowMethods”corsAllowMethods:
string[]
corsAllowOrigins
Section titled “corsAllowOrigins”corsAllowOrigins:
string[]
corsExposeHeaders
Section titled “corsExposeHeaders”corsExposeHeaders:
string[]
corsMaxAge
Section titled “corsMaxAge”corsMaxAge:
number
customErrorResponses
Section titled “customErrorResponses”customErrorResponses:
Record<number,string>
customLogFile
Section titled “customLogFile”customLogFile:
string|null
customRequestCheck?
Section titled “customRequestCheck?”
optionalcustomRequestCheck?: (req) =>Promise<GuardResponse|null>
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<GuardResponse | null>
customResponseModifier?
Section titled “customResponseModifier?”
optionalcustomResponseModifier?: (res) =>Promise<GuardResponse>
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<GuardResponse>
detectionAnomalyThreshold
Section titled “detectionAnomalyThreshold”detectionAnomalyThreshold:
number
detectionCompilerTimeout
Section titled “detectionCompilerTimeout”detectionCompilerTimeout:
number
detectionMaxContentLength
Section titled “detectionMaxContentLength”detectionMaxContentLength:
number
detectionMaxTrackedPatterns
Section titled “detectionMaxTrackedPatterns”detectionMaxTrackedPatterns:
number
detectionMonitorHistorySize
Section titled “detectionMonitorHistorySize”detectionMonitorHistorySize:
number
detectionPreserveAttackPatterns
Section titled “detectionPreserveAttackPatterns”detectionPreserveAttackPatterns:
boolean
detectionSemanticThreshold
Section titled “detectionSemanticThreshold”detectionSemanticThreshold:
number
detectionSlowPatternThreshold
Section titled “detectionSlowPatternThreshold”detectionSlowPatternThreshold:
number
dynamicRuleInterval
Section titled “dynamicRuleInterval”dynamicRuleInterval:
number
emergencyMode
Section titled “emergencyMode”emergencyMode:
boolean
emergencyWhitelist
Section titled “emergencyWhitelist”emergencyWhitelist:
string[]
enableAgent
Section titled “enableAgent”enableAgent:
boolean
enableCors
Section titled “enableCors”enableCors:
boolean
enableDynamicRules
Section titled “enableDynamicRules”enableDynamicRules:
boolean
enableIpBanning
Section titled “enableIpBanning”enableIpBanning:
boolean
enablePenetrationDetection
Section titled “enablePenetrationDetection”enablePenetrationDetection:
boolean
enableRateLimiting
Section titled “enableRateLimiting”enableRateLimiting:
boolean
enableRedis
Section titled “enableRedis”enableRedis:
boolean
endpointRateLimits
Section titled “endpointRateLimits”endpointRateLimits:
Record<string, [number,number]>
enforceHttps
Section titled “enforceHttps”enforceHttps:
boolean
excludePaths
Section titled “excludePaths”excludePaths:
string[]
geoIpHandler?
Section titled “geoIpHandler?”
optionalgeoIpHandler?:GeoIPHandler
geoResolver?
Section titled “geoResolver?”
optionalgeoResolver?: (ip) =>string|null
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | null
logFormat
Section titled “logFormat”logFormat:
"text"|"json"
logger?
Section titled “logger?”
optionallogger?:Logger
logRequestLevel
Section titled “logRequestLevel”logRequestLevel:
"INFO"|"DEBUG"|"WARNING"|"ERROR"|"CRITICAL"|null
logSuspiciousLevel
Section titled “logSuspiciousLevel”logSuspiciousLevel:
"INFO"|"DEBUG"|"WARNING"|"ERROR"|"CRITICAL"|null
passiveMode
Section titled “passiveMode”passiveMode:
boolean
rateLimit
Section titled “rateLimit”rateLimit:
number
rateLimitWindow
Section titled “rateLimitWindow”rateLimitWindow:
number
redisPrefix
Section titled “redisPrefix”redisPrefix:
string
redisUrl
Section titled “redisUrl”redisUrl:
string
securityHeaders
Section titled “securityHeaders”securityHeaders: {
contentTypeOptions:string;csp:Record<string,string[]> |null;custom:Record<string,string> |null;enabled:boolean;frameOptions:"DENY"|"SAMEORIGIN";hsts?: {includeSubdomains:boolean;maxAge:number;preload:boolean; };permissionsPolicy:string;referrerPolicy:string;xssProtection:string; } |null
trustedProxies
Section titled “trustedProxies”trustedProxies:
string[]
trustedProxyDepth
Section titled “trustedProxyDepth”trustedProxyDepth:
number
trustXForwardedProto
Section titled “trustXForwardedProto”trustXForwardedProto:
boolean
whitelist
Section titled “whitelist”whitelist:
string[] |null
whitelistCountries
Section titled “whitelistCountries”whitelistCountries:
string[]
logger
Section titled “logger”
readonlylogger:Logger
Defined in: core/src/decorators/base.ts:22
routeConfigs
Section titled “routeConfigs”routeConfigs:
Map<string,RouteConfig>
Defined in: core/src/decorators/base.ts:18
Methods
Section titled “Methods”applyRouteConfig()
Section titled “applyRouteConfig()”applyRouteConfig<
T>(fn):T
Defined in: core/src/decorators/base.ts:44
Type Parameters
Section titled “Type Parameters”T extends Function
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”T
ensureRouteConfig()
Section titled “ensureRouteConfig()”ensureRouteConfig(
fn):RouteConfig
Defined in: core/src/decorators/base.ts:34
Parameters
Section titled “Parameters”Function
Returns
Section titled “Returns”getRouteConfig()
Section titled “getRouteConfig()”getRouteConfig(
routeId):RouteConfig|undefined
Defined in: core/src/decorators/base.ts:30
Parameters
Section titled “Parameters”routeId
Section titled “routeId”string
Returns
Section titled “Returns”RouteConfig | undefined
getRouteId()
Section titled “getRouteId()”getRouteId(
fn):string
Defined in: core/src/decorators/base.ts:49
Parameters
Section titled “Parameters”Function
Returns
Section titled “Returns”string
initializeAgent()
Section titled “initializeAgent()”initializeAgent(
agentHandler):Promise<void>
Defined in: core/src/decorators/base.ts:60
Parameters
Section titled “Parameters”agentHandler
Section titled “agentHandler”Returns
Section titled “Returns”Promise<void>
initializeBehaviorTracking()
Section titled “initializeBehaviorTracking()”initializeBehaviorTracking(
redisHandler?):Promise<void>
Defined in: core/src/decorators/base.ts:56
Parameters
Section titled “Parameters”redisHandler?
Section titled “redisHandler?”Returns
Section titled “Returns”Promise<void>
sendAccessDeniedEvent()
Section titled “sendAccessDeniedEvent()”sendAccessDeniedEvent(
request,reason,decoratorType,meta?):Promise<void>
Defined in: core/src/decorators/base.ts:86
Parameters
Section titled “Parameters”request
Section titled “request”reason
Section titled “reason”string
decoratorType
Section titled “decoratorType”string
Record<string, unknown>
Returns
Section titled “Returns”Promise<void>
sendAuthenticationFailedEvent()
Section titled “sendAuthenticationFailedEvent()”sendAuthenticationFailedEvent(
request,reason,authType,meta?):Promise<void>
Defined in: core/src/decorators/base.ts:95
Parameters
Section titled “Parameters”request
Section titled “request”reason
Section titled “reason”string
authType
Section titled “authType”string
Record<string, unknown>
Returns
Section titled “Returns”Promise<void>
sendDecoratorEvent()
Section titled “sendDecoratorEvent()”sendDecoratorEvent(
eventType,_request,actionTaken,reason,decoratorType,meta?):Promise<void>
Defined in: core/src/decorators/base.ts:65
Parameters
Section titled “Parameters”eventType
Section titled “eventType”string
_request
Section titled “_request”actionTaken
Section titled “actionTaken”string
reason
Section titled “reason”string
decoratorType
Section titled “decoratorType”string
Record<string, unknown>
Returns
Section titled “Returns”Promise<void>
sendDecoratorViolationEvent()
Section titled “sendDecoratorViolationEvent()”sendDecoratorViolationEvent(
request,violationType,reason,meta?):Promise<void>
Defined in: core/src/decorators/base.ts:113
Parameters
Section titled “Parameters”request
Section titled “request”violationType
Section titled “violationType”string
reason
Section titled “reason”string
Record<string, unknown>
Returns
Section titled “Returns”Promise<void>
sendRateLimitEvent()
Section titled “sendRateLimitEvent()”sendRateLimitEvent(
request,limit,window,meta?):Promise<void>
Defined in: core/src/decorators/base.ts:104
Parameters
Section titled “Parameters”request
Section titled “request”number
window
Section titled “window”number
Record<string, unknown>
Returns
Section titled “Returns”Promise<void>