# Functions
DefaultRuleset returns the marshaled default recommended security rules for AppSec.
DefaultRulesetMap returns the unmarshaled default recommended security rules for AppSec.
NewAPISecConfig creates and returns a new API Security configuration by reading the env.
NewObfuscatorConfig creates and returns a new WAF obfuscator configuration by reading the env.
RASPEnabled returns true if RASP functionalities are enabled through the env, or if DD_APPSEC_RASP_ENABLED is not set.
RateLimitFromEnv reads and parses the trace rate limit set through the env If not set, it defaults to `DefaultTraceRate`.
RulesFromEnv returns the security rules provided through the environment If the env var is not set, the default recommended rules are returned instead.
WAFTimeoutFromEnv reads and parses the WAF timeout value set through the env If not set, it defaults to `DefaultWAFTimeout`.
# Constants
DefaultAPISecSampleRate is the default rate at which API Security schemas are extracted from requests.
DefaultObfuscatorKeyRegex is the default regexp used to obfuscate keys.
DefaultObfuscatorValueRegex is the default regexp used to obfuscate values.
up to 100 appsec traces/s.
DefaultWAFTimeout is the default time limit past which a WAF run will timeout.
EnvAPISecEnabled is the env var used to enable API Security.
EnvAPISecSampleRate is the env var used to set the sampling rate of API Security schema extraction.
EnvObfuscatorKey is the env var used to provide the WAF key obfuscation regexp.
EnvObfuscatorValue is the env var used to provide the WAF value obfuscation regexp.
EnvRASPEnabled is the env var used to enable/disable RASP functionalities for ASM.
EnvRules is the env var used to provide a path to a local security rule file.
EnvTraceRateLimit is the env var used to set the ASM trace limiting rate.
EnvWAFTimeout is the env var used to specify the timeout value for a WAF run.
# Variables
StaticRecommendedRules holds the recommended AppSec security rules (v1.13.2) Source: https://github.com/DataDog/appsec-event-rules/blob/1.13.2/build/recommended.json
go:embed rules.json.
# Structs
APISecConfig holds the configuration for API Security schemas reporting It is used to enabled/disable the feature as well as to configure the rate at which schemas get reported,.
ObfuscatorConfig wraps the key and value regexp to be passed to the WAF to perform obfuscation.