GuardMiddlewareOptions
Defined in: hono/src/middleware.ts:15
Properties
Section titled “Properties”agentHandler?
Section titled “agentHandler?”
optionalagentHandler?:AgentHandlerProtocol
Defined in: hono/src/middleware.ts:17
config
Section titled “config”config:
object
Defined in: hono/src/middleware.ts:16
agentApiKey?
Section titled “agentApiKey?”
optionalagentApiKey?:string|null
agentBufferSize?
Section titled “agentBufferSize?”
optionalagentBufferSize?:number
agentEnableEvents?
Section titled “agentEnableEvents?”
optionalagentEnableEvents?:boolean
agentEnableMetrics?
Section titled “agentEnableMetrics?”
optionalagentEnableMetrics?:boolean
agentEndpoint?
Section titled “agentEndpoint?”
optionalagentEndpoint?:string
agentFlushInterval?
Section titled “agentFlushInterval?”
optionalagentFlushInterval?:number
agentProjectId?
Section titled “agentProjectId?”
optionalagentProjectId?:string|null
agentRetryAttempts?
Section titled “agentRetryAttempts?”
optionalagentRetryAttempts?:number
agentTimeout?
Section titled “agentTimeout?”
optionalagentTimeout?:number
autoBanDuration?
Section titled “autoBanDuration?”
optionalautoBanDuration?:number
autoBanThreshold?
Section titled “autoBanThreshold?”
optionalautoBanThreshold?:number
blacklist?
Section titled “blacklist?”
optionalblacklist?:string[]
blockCloudProviders?
Section titled “blockCloudProviders?”
optionalblockCloudProviders?: ("AWS"|"GCP"|"Azure")[]
blockedCountries?
Section titled “blockedCountries?”
optionalblockedCountries?:string[]
blockedUserAgents?
Section titled “blockedUserAgents?”
optionalblockedUserAgents?:string[]
cloudIpRefreshInterval?
Section titled “cloudIpRefreshInterval?”
optionalcloudIpRefreshInterval?:number
corsAllowCredentials?
Section titled “corsAllowCredentials?”
optionalcorsAllowCredentials?:boolean
corsAllowHeaders?
Section titled “corsAllowHeaders?”
optionalcorsAllowHeaders?:string[]
corsAllowMethods?
Section titled “corsAllowMethods?”
optionalcorsAllowMethods?:string[]
corsAllowOrigins?
Section titled “corsAllowOrigins?”
optionalcorsAllowOrigins?:string[]
corsExposeHeaders?
Section titled “corsExposeHeaders?”
optionalcorsExposeHeaders?:string[]
corsMaxAge?
Section titled “corsMaxAge?”
optionalcorsMaxAge?:number
customErrorResponses?
Section titled “customErrorResponses?”
optionalcustomErrorResponses?:Record<PropertyKey,string>
customLogFile?
Section titled “customLogFile?”
optionalcustomLogFile?: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?”
optionaldetectionAnomalyThreshold?:number
detectionCompilerTimeout?
Section titled “detectionCompilerTimeout?”
optionaldetectionCompilerTimeout?:number
detectionMaxContentLength?
Section titled “detectionMaxContentLength?”
optionaldetectionMaxContentLength?:number
detectionMaxTrackedPatterns?
Section titled “detectionMaxTrackedPatterns?”
optionaldetectionMaxTrackedPatterns?:number
detectionMonitorHistorySize?
Section titled “detectionMonitorHistorySize?”
optionaldetectionMonitorHistorySize?:number
detectionPreserveAttackPatterns?
Section titled “detectionPreserveAttackPatterns?”
optionaldetectionPreserveAttackPatterns?:boolean
detectionSemanticThreshold?
Section titled “detectionSemanticThreshold?”
optionaldetectionSemanticThreshold?:number
detectionSlowPatternThreshold?
Section titled “detectionSlowPatternThreshold?”
optionaldetectionSlowPatternThreshold?:number
dynamicRuleInterval?
Section titled “dynamicRuleInterval?”
optionaldynamicRuleInterval?:number
emergencyMode?
Section titled “emergencyMode?”
optionalemergencyMode?:boolean
emergencyWhitelist?
Section titled “emergencyWhitelist?”
optionalemergencyWhitelist?:string[]
enableAgent?
Section titled “enableAgent?”
optionalenableAgent?:boolean
enableCors?
Section titled “enableCors?”
optionalenableCors?:boolean
enableDynamicRules?
Section titled “enableDynamicRules?”
optionalenableDynamicRules?:boolean
enableIpBanning?
Section titled “enableIpBanning?”
optionalenableIpBanning?:boolean
enablePenetrationDetection?
Section titled “enablePenetrationDetection?”
optionalenablePenetrationDetection?:boolean
enableRateLimiting?
Section titled “enableRateLimiting?”
optionalenableRateLimiting?:boolean
enableRedis?
Section titled “enableRedis?”
optionalenableRedis?:boolean
endpointRateLimits?
Section titled “endpointRateLimits?”
optionalendpointRateLimits?:Record<string, [number,number]>
enforceHttps?
Section titled “enforceHttps?”
optionalenforceHttps?:boolean
excludePaths?
Section titled “excludePaths?”
optionalexcludePaths?: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?”
optionallogFormat?:"text"|"json"
logger?
Section titled “logger?”
optionallogger?:Logger
logRequestLevel?
Section titled “logRequestLevel?”
optionallogRequestLevel?:"INFO"|"DEBUG"|"WARNING"|"ERROR"|"CRITICAL"|null
logSuspiciousLevel?
Section titled “logSuspiciousLevel?”
optionallogSuspiciousLevel?:"INFO"|"DEBUG"|"WARNING"|"ERROR"|"CRITICAL"|null
passiveMode?
Section titled “passiveMode?”
optionalpassiveMode?:boolean
rateLimit?
Section titled “rateLimit?”
optionalrateLimit?:number
rateLimitWindow?
Section titled “rateLimitWindow?”
optionalrateLimitWindow?:number
redisPrefix?
Section titled “redisPrefix?”
optionalredisPrefix?:string
redisUrl?
Section titled “redisUrl?”
optionalredisUrl?:string
securityHeaders?
Section titled “securityHeaders?”
optionalsecurityHeaders?: {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?”
optionaltrustedProxies?:string[]
trustedProxyDepth?
Section titled “trustedProxyDepth?”
optionaltrustedProxyDepth?:number
trustXForwardedProto?
Section titled “trustXForwardedProto?”
optionaltrustXForwardedProto?:boolean
whitelist?
Section titled “whitelist?”
optionalwhitelist?:string[] |null
whitelistCountries?
Section titled “whitelistCountries?”
optionalwhitelistCountries?:string[]
geoIpHandler?
Section titled “geoIpHandler?”
optionalgeoIpHandler?:GeoIPHandler
Defined in: hono/src/middleware.ts:18
guardDecorator?
Section titled “guardDecorator?”
optionalguardDecorator?:unknown
Defined in: hono/src/middleware.ts:19