Skip to content

Access, rate limits, bans and identity Since v0.2 ​

These settings decide who may reach an application and how fast. Paths are relative to one entry of applications.

For the structure of the file, see Configuration file. Defaults of limits are also listed in Limits and defaults. A dash in Default means the code sets no default value (the setting is empty or off).

Access rules ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[].policy.accessobject——Group of settings: access.Access rules
applications[].policy.access.modestring—detect, blockempty: same as the applicationAccess rules
applications[].policy.access.rules[]list of object——Group of settings: rules.Access rules
applications[].policy.access.rules[].namestring——The name that identifies this entry.Access rules
applications[].policy.access.rules[].whenobject——Group of settings: when.Access rules
applications[].policy.access.rules[].when.pathslist of string——Request paths the setting applies to.Access rules
applications[].policy.access.rules[].when.path_regexstring——Sets path regex.Access rules
applications[].policy.access.rules[].when.methodslist of string——HTTP methods the setting applies to.Access rules
applications[].policy.access.rules[].when.ip_listslist of string——Sets ip lists.Access rules
applications[].policy.access.rules[].when.not_ip_listslist of string——Sets not ip lists.Access rules
applications[].policy.access.rules[].when.cidrslist of string——Address ranges in CIDR form.Access rules
applications[].policy.access.rules[].when.countrieslist of string——Sets countries.Access rules
applications[].policy.access.rules[].when.not_countrieslist of string——Sets not countries.Access rules
applications[].policy.access.rules[].exprstring——CEL; must hold together with whenAccess rules
applications[].policy.access.rules[].actionstring——What happens on a match.Access rules
applications[].policy.access.rules[].skiplist of string——trust only: modules not run for matching requestsAccess rules
applications[].policy.access.rules[].ban_forduration——ban onlyAccess rules
applications[].policy.access.rules[].severitystring——Sets severity.Access rules

Rate limits ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[].policy.rate_limitsobject——Group of settings: rate limits.Rate limits
applications[].policy.rate_limits.modestring—detect, blockWhether the feature only logs (detect) or also acts (block).Rate limits
applications[].policy.rate_limits.rules[]list of object——Group of settings: rules.Rate limits
applications[].policy.rate_limits.rules[].namestring——The name that identifies this entry.Rate limits
applications[].policy.rate_limits.rules[].whenobject——Group of settings: when.Rate limits
applications[].policy.rate_limits.rules[].when.pathslist of string——exact path, or a prefix ending in "*"Rate limits
applications[].policy.rate_limits.rules[].when.methodslist of string——uppercase methodsRate limits
applications[].policy.rate_limits.rules[].when.ip_listslist of string——Bot rules only (bot.*): the client's address in one of these lists, its TLS or HTTP fingerprint one of these values (or leading parts ending in *).Rate limits
applications[].policy.rate_limits.rules[].when.ja4list of string——Sets ja4.Rate limits
applications[].policy.rate_limits.rules[].when.ja4hlist of string——Sets ja4h.Rate limits
applications[].policy.rate_limits.rules[].limitinteger——Sets limit.Rate limits
applications[].policy.rate_limits.rules[].perduration——Sets per.Rate limits
applications[].policy.rate_limits.rules[].actionstring——block (default), log, banRate limits
applications[].policy.rate_limits.rules[].ban_forduration——Sets ban for.Rate limits
applications[].policy.rate_limits.rules[].bystring——client (default), consumer, allRate limits
applications[].policy.rate_limits.per_client_concurrencyinteger——Sets per client concurrency.Rate limits

Bans ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[].policy.bansobject——Group of settings: bans.Bans
applications[].policy.bans.after_blocksinteger——Sets after blocks.Bans
applications[].policy.bans.withinduration——Sets within.Bans
applications[].policy.bans.forduration——Sets for.Bans

Client identity ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[].policy.identityobject——identity says who a client is, for every module.Client identity
applications[].policy.identity.sources[]list of object——sources are tried in order; the first one present in a request wins.Client identity
applications[].policy.identity.sources[].kindstring——Sets kind.Client identity
applications[].policy.identity.sources[].claimstring——jwt_claimClient identity
applications[].policy.identity.sources[].namestring——cookie, headerClient identity
applications[].policy.identity.sources[].trusted_fromlist of string——header: peers allowed to set itClient identity
applications[].policy.identity.ipv6_prefixinteger——Sets ipv6 prefix.Client identity
applications[].policy.identity.modestring—detect, blockempty: same as the application (detect wins)Client identity
applications[].policy.identity.requireobject——Group of settings: require.Client identity
applications[].policy.identity.require.pathslist of string——Request paths the setting applies to.Client identity
applications[].policy.identity.require.actionstring——log | refuseClient identity

Example ​

yaml
version: 2
listeners:
  - {name: web, address: "0.0.0.0:8080", protocol: http}
server_pools:
  - name: shop
    servers:
      - {address: "127.0.0.1:9000", weight: 1, state: active}
ip_lists:
  - name: office
    cidrs: [10.0.0.0/8]
applications:
  - name: shop
    hostnames: [shop.example.com]
    listeners: [web]
    server_pool: shop
    policy:
      access:
        rules:
          - name: office-admin
            when: {paths: ["/admin*"], ip_lists: [office]}
            action: allow
          - name: admin-elsewhere
            when: {paths: ["/admin*"]}
            action: block
      rate_limits:
        rules:
          - name: login
            when: {paths: [/login], methods: [POST]}
            limit: 10
            per: 1m
            action: block