FirewallRuleArgs

data class FirewallRuleArgs(val action: Output<String>? = null, val description: Output<String>? = null, val filterId: Output<String>? = null, val paused: Output<Boolean>? = null, val priority: Output<Int>? = null, val products: Output<List<String>>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<FirewallRuleArgs>

Define Firewall rules using filter expressions for more control over how traffic is matched to the rule. A filter expression permits selecting traffic by multiple criteria allowing greater freedom in rule creation. Filter expressions needs to be created first before using Firewall Rule.

If you want to configure Custom Firewall rules, you need to use cloudflare.Ruleset, because Custom Rules are built upon the Cloudflare Ruleset Engine.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Filter;
import com.pulumi.cloudflare.FilterArgs;
import com.pulumi.cloudflare.FirewallRule;
import com.pulumi.cloudflare.FirewallRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var wordpressFilter = new Filter("wordpressFilter", FilterArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.description("Wordpress break-in attempts that are outside of the office")
.expression("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1")
.build());
var wordpressFirewallRule = new FirewallRule("wordpressFirewallRule", FirewallRuleArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.description("Block wordpress break-in attempts")
.filterId(wordpressFilter.id())
.action("block")
.build());
}
}

Import

$ pulumi import cloudflare:index/firewallRule:FirewallRule example <zone_id>/<firewall_rule_id>

Constructors

Link copied to clipboard
constructor(action: Output<String>? = null, description: Output<String>? = null, filterId: Output<String>? = null, paused: Output<Boolean>? = null, priority: Output<Int>? = null, products: Output<List<String>>? = null, zoneId: Output<String>? = null)

Properties

Link copied to clipboard
val action: Output<String>? = null

The action to apply to a matched request. Available values: block, challenge, allow, js_challenge, managed_challenge, log, bypass.

Link copied to clipboard
val description: Output<String>? = null

A description of the rule to help identify it.

Link copied to clipboard
val filterId: Output<String>? = null

The identifier of the Filter to use for determining if the Firewall Rule should be triggered.

Link copied to clipboard
val paused: Output<Boolean>? = null

Whether this filter based firewall rule is currently paused.

Link copied to clipboard
val priority: Output<Int>? = null

The priority of the rule to allow control of processing order. A lower number indicates high priority. If not provided, any rules with a priority will be sequenced before those without.

Link copied to clipboard
val products: Output<List<String>>? = null

List of products to bypass for a request when the bypass action is used. Available values: zoneLockdown, uaBlock, bic, hot, securityLevel, rateLimit, waf.

Link copied to clipboard
val zoneId: Output<String>? = null

The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.

Functions

Link copied to clipboard
open override fun toJava(): FirewallRuleArgs