Phase Rules
Each Phase is made up of Phase Rules. Phase Rules allow you to define how traffic is filtered and processed within a phase. To do this each rule consists of two key parts: expressions and actions.
Here is an example:
Loading…
Expressions
Expressions are conditions written in Common Expression Language (CEL) that can be used to evaluate specific traffic attributes, such as the client IP, request URL, or HTTP method. These conditions determine whether a rule applies to a given traffic flow. For instance, an expression like conn.client_ip == '192.168.1.200'
targets requests from a specific IP address.
You can define multiple expressions, which are automatically combined using the &&
operator. This means all expressions in the list must evaluate to true
for the associated rules to run. If no expressions are provided, the system defaults to true
, ensuring the rule matches all traffic, and the specified actions are executed in sequence.
By combining multiple conditions, you can craft highly specific and flexible rules to manage traffic effectively.
Actions
Actions define the behavior that is applied when the expressions evaluate to true. Each action specifies a particular operation to be applied, such as denying traffic, modifying headers, or redirecting requests. Actions are executed sequentially as defined in the policy, but note that some actions can short-circuit the request and return without executing subsequent actions.
For example, the following action denies traffic and returns a 404
HTTP status code:
Loading…
For a full list of actions, check out our Action Hub.