The waf configuration block within the config object allows you to secure your distribution.
Precedence Hierarchy
Rules follow a strict precedence order. If a conflict occurs, the higher precedence level wins:
- Specific Rules (Highest Precedence)
- Groups
- Collections (Lowest Precedence)
For example, if you enable a whole collection but explicitly disable a specific Rule ID within that collection, the specific Rule ID setting will take effect.
WAF Configuration Options
mode: Set to "ENABLED" to activate WAF.type: e.g., "PREMIUM".paranoia_level: e.g., "L1".allowed_http_versions: List of versions like ["HTTP/1.0", "HTTP/1.1"].allowed_http_methods: List of methods like ["GET"].allowed_request_content_types: List of content types.
Rule Management
- Collections: Use
enabled_rule_collection_ids, disabled_rule_collection_ids, and log_only_rule_collection_ids. - Groups: Use
enabled_rule_group_ids, disabled_rule_group_ids, and log_only_rule_group_ids. - Specific Rules: Use
enabled_rule_ids, disabled_rule_ids, and log_only_rule_ids for the highest precedence control.
To find available IDs, consult the Stackit API documentation.
waf = {
mode = "ENABLED"
type = "PREMIUM"
paranoia_level = "L1"
allowed_http_versions = ["HTTP/1.0", "HTTP/1.1"]
allowed_http_methods = ["GET"]
allowed_request_content_types = ["text/plain"]
# Collections
enabled_rule_collection_ids = ["@builtin/crs/request"]
disabled_rule_collection_ids = []
log_only_rule_collection_ids = ["@builtin/crs/response"]
# Groups
enabled_rule_group_ids = []
disabled_rule_group_ids = []
log_only_rule_group_ids = []
# Specific Rules (Highest Precedence)
enabled_rule_ids = ["@builtin/crs/request/913100"]
disabled_rule_ids = ["@builtin/crs/request/942151"]
log_only_rule_ids = ["@builtin/crs/response/954120"]
}