F5BigFwPolicy¶
Overview¶
Function¶
Declares a firewall policy for a CNE instance, defining the ordered rules that match traffic by protocol, source, and destination, and the action to apply. Each rule either sets an inline action or references a firewall rule list.
When applying a new resource, firewall rules are first sent to the Application Firewall Management (AFM) pod to be compiled into a binary large object (BLOB), improving processing performance. Once the firewall BLOB is compiled, it is sent to the TMM pod to begin inspecting and filtering network packets.
Names¶
Singular name |
Plural name |
Short name |
|---|---|---|
f5-big-fw-policy |
f5-big-fw-policies |
fwpol |
API group and version¶
k8s.f5net.com/v1
Scope¶
Namespace
Specification¶
metadata¶
Parameter |
Description |
|---|---|
|
The name of the Firewall Policy. This value is referenced by BIG-IP Next for Kubernetes Traffic Management CRs. |
|
The namespace of Kubernetes in with firewall policy is installed. |
spec¶
Field |
Required |
Default |
Description |
|---|---|---|---|
|
No |
|
List of firewall rules. |
|
No |
|
Description of the policy. |
spec.rule[]¶
Each rule sets either action or ruleList, but not both. When you set ruleList, don’t set action, source, destination, ipProtocol, logging, or servicePolicy.
Field |
Required |
Default |
Description |
|---|---|---|---|
|
Yes |
— |
Name of the rule. Maximum length is 255 characters. |
|
No |
— |
Action to apply to matching traffic. Set this when you don’t set |
|
No |
|
Name of a |
|
No |
|
IP protocol to match. Accepted values include |
|
No |
|
Description of the rule. |
|
No |
|
Source match criteria for the rule. |
|
No |
|
Destination match criteria for the rule. |
|
No |
|
Turns on logging for the rule. Accepted values: |
|
No |
— |
Name of the service policy to apply. Maximum length is 255 characters. |
Note
When a rule specifies any VLAN zone in the source or destination, the rule can’t specify source VLANs.
spec.rule[].source¶
Field |
Required |
Default |
Description |
|---|---|---|---|
|
No |
|
Source VLAN names. Each name is up to 255 characters. |
|
No |
|
Source zone names. Each name is up to 255 characters. |
|
No |
|
Source IPv4 or IPv6 addresses, CIDR ranges, or address ranges. |
|
No |
|
Source address list names. Each name is up to 255 characters. |
|
No |
|
Source ports or port ranges. Accepted values: 0 to 65535, or a range such as |
|
No |
|
Source port list names. Each name is up to 255 characters. |
|
No |
|
Source geographic location codes. Each value is up to 255 characters. |
|
No |
|
Source fully qualified domain names. Each name is up to 254 characters. |
|
No |
|
Kubernetes namespaces to match. Each name is up to 63 characters. |
spec.rule[].destination¶
Field |
Required |
Default |
Description |
|---|---|---|---|
|
No |
|
Destination zone names. Each name is up to 255 characters. |
|
No |
|
Destination IPv4 or IPv6 addresses, CIDR ranges, or address ranges. |
|
No |
|
Destination address list names. Each name is up to 255 characters. |
|
No |
|
Destination ports or port ranges. Accepted values: 0 to 65535, or a range such as |
|
No |
|
Destination port list names. Each name is up to 255 characters. |
|
No |
|
Destination geographic location codes. Each value is up to 255 characters. |
|
No |
|
Destination fully qualified domain names. Each name is up to 254 characters. |
|
No |
|
Kubernetes namespaces to match. Each name is up to 63 characters. |
Example manifest¶
This section provides the sample resource use cases. For more details to apply this resource, see Firewall policy in Gateway API
F5BigFwPolicy CR with ACLs attached to GatewayClass¶
Following is an example F5BigFwPolicy CR with ACLs attached to GatewayClass:
apiVersion: "k8s.f5net.com/v1"
kind: F5BigFwPolicy
metadata:
name: fwpolicy-global-1
namespace: f5-bnk
spec:
rule:
- name: sc-rule-1
ipProtocol: any
source:
addresses:
- 11.19.10.9
logging: true
action: drop
apiVersion: "gateway.k8s.f5.com/v1alpha1"
kind: SecPolicy
metadata:
name: secpolicy-gatewayclass
namespace: f5-bnk
spec:
extensionRefs:
- name: fwpolicy-global-1
group: k8s.f5net.com
kind: F5BigFwPolicy
targetRefs:
- name: f5-gateway-class
kind: GatewayClass
group: gateway.networking.k8s.io
Note
SecPolicy, FirewallPolicy resources should be in f5-bnk namespace when attached to GatewayClass.
F5BigFwPolicy with ACLs attached to Gateway¶
Following is an example resource with ACLs attached to Gateway:
apiVersion: "k8s.f5net.com/v1"
kind: F5BigFwPolicy
metadata:
name: fwpolicy-virtual-1
namespace: gatewayns
spec:
rule:
- name: sc-rule-1
ipProtocol: any
source:
addresses:
- 11.19.10.8
logging: true
action: drop
apiVersion: "gateway.k8s.f5.com/v1alpha1"
kind: SecPolicy
metadata:
name: secpolicy-virtual-1
namespace: gatewayns
spec:
extensionRefs:
- name: fwpolicy-virtual-1
group: k8s.f5net.com
kind: F5BigFwPolicy
targetRefs:
- name: f5-gateway
kind: Gateway
group: gateway.networking.k8s.io
SecPolicy with ACLs attached to Gateway Listeners:
Following is an example SecPolicy resource with ACLs attached to Gateway Listeners:
apiVersion: "gateway.k8s.f5.com/v1alpha1"
kind: SecPolicy
metadata:
name: secpolicy-virtual-1
namespace: gatewayns
spec:
extensionRefs:
- name: fwpolicy-virtual-1
group: k8s.f5net.com
kind: F5BigFwPolicy
targetRefs:
- name: f5-gateway
kind: Gateway
group: gateway.networking.k8s.io
sectionName: tcp-listener
Note
SecPolicy, Gateway, and FirewallPolicy resources should be in same namespace when attached to Gateway or Gateway Listener.