Skip to content

Commit 0b0f999

Browse files
steverfrancissmira
authored andcommitted
docs: add resource information, some grammar fixes
Improve the ingress firewall docs. Signed-off-by: Steve Francis <steve.francis@talos-systems.com> Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 763dae2 commit 0b0f999

File tree

2 files changed

+44
-26
lines changed

2 files changed

+44
-26
lines changed

website/content/v1.7/talos-guides/network/ingress-firewall.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Ingress Firewall"
33
description: "Learn to use Talos Linux Ingress Firewall to limit access to the host services."
44
---
55

6-
Talos Linux Ingress Firewall is a simple and effective way to limit access to the services running on the host, which includes both Talos standard
6+
Talos Linux Ingress Firewall is a simple and effective way to limit network access to the services running on the host, which includes both Talos standard
77
services (e.g. `apid` and `kubelet`), and any additional workloads that may be running on the host.
88
Talos Linux Ingress Firewall doesn't affect the traffic between the Kubernetes pods/services, please use CNI Network Policies for that.
99

@@ -29,17 +29,17 @@ ingress:
2929
except: 172.20.0.1/32
3030
```
3131
32-
The first document configures the default action for the ingress traffic, which can be either `accept` or `block`, with the default being `accept`.
33-
If the default action is set to `accept`, then all the ingress traffic will be allowed, unless there is a matching rule that blocks it.
34-
If the default action is set to `block`, then all the ingress traffic will be blocked, unless there is a matching rule that allows it.
32+
The first document configures the default action for ingress traffic, which can be either `accept` or `block`, with the default being `accept`.
33+
If the default action is set to `accept`, then all ingress traffic will be allowed, unless there is a matching rule that blocks it.
34+
If the default action is set to `block`, then all ingress traffic will be blocked, unless there is a matching rule that allows it.
3535

36-
With either `accept` or `block`, the traffic is always allowed on the following network interfaces:
36+
With either `accept` or `block`, traffic is always allowed on the following network interfaces:
3737

3838
* `lo`
3939
* `siderolink`
4040
* `kubespan`
4141

42-
In the `block` mode:
42+
In `block` mode:
4343

4444
* ICMP and ICMPv6 traffic is also allowed with a rate limit of 5 packets per second
4545
* traffic between Kubernetes pod/service subnets is allowed (for native routing CNIs)
@@ -62,30 +62,33 @@ The `protocol` might be either `tcp` or `udp`.
6262
The `ingress` specifies the list of subnets that are allowed to access the host services, with the optional `except` field to exclude a set of addresses from the subnet.
6363

6464
> Note: incorrect configuration of the ingress firewall might result in the host becoming inaccessible over Talos API.
65-
> The configuration might be [applied]({{< relref "../configuration/editing-machine-configuration" >}}) in `--mode=try` to make sure it gets reverted in case of a mistake.
65+
> It is recommended that the configuration be [applied]({{< relref "../configuration/editing-machine-configuration" >}}) in `--mode=try` to ensure it is reverted in case of a mistake.
6666

6767
## Recommended Rules
6868

6969
The following rules improve the security of the cluster and cover only standard Talos services.
7070
If there are additional services running with host networking in the cluster, they should be covered by additional rules.
7171

72-
In the `block` mode, the ingress firewall will also block encapsulated traffic (e.g. VXLAN) between the nodes, which needs to be explicitly allowed for the Kubernetes
72+
In `block` mode, the ingress firewall will also block encapsulated traffic (e.g. VXLAN) between the nodes, which needs to be explicitly allowed for the Kubernetes
7373
networking to function properly.
74-
Please refer to the CNI documentation for the specifics, some default configurations are listed below:
74+
Please refer to the documentation of the CNI in use for the specific ports required.
75+
Some default configurations are listed below:
7576

7677
* Flannel, Calico: `vxlan` UDP port 4789
7778
* Cilium: `vxlan` UDP port 8472
7879

79-
In the examples we assume following template variables to describe the cluster:
80+
In the examples we assume the following template variables to describe the cluster:
8081

8182
* `$CLUSTER_SUBNET`, e.g. `172.20.0.0/24` - the subnet which covers all machines in the cluster
8283
* `$CP1`, `$CP2`, `$CP3` - the IP addresses of the controlplane nodes
8384
* `$VXLAN_PORT` - the UDP port used by the CNI for encapsulated traffic
8485

8586
### Controlplane
8687

88+
In this example Ingress policy:
89+
8790
* `apid` and Kubernetes API are wide open
88-
* `kubelet` and `trustd` API is only accessible within the cluster
91+
* `kubelet` and `trustd` API are only accessible within the cluster
8992
* `etcd` API is limited to controlplane nodes
9093

9194
```yaml
@@ -160,7 +163,7 @@ ingress:
160163

161164
### Worker
162165

163-
* `kubelet` and `apid` API is only accessible within the cluster
166+
* `kubelet` and `apid` API are only accessible within the cluster
164167

165168
```yaml
166169
apiVersion: v1alpha1
@@ -200,7 +203,7 @@ ingress:
200203

201204
## Learn More
202205

203-
Talos Linux Ingress Firewall is using the `nftables` to perform the filtering.
206+
Talos Linux Ingress Firewall uses `nftables` to perform the filtering.
204207

205208
With the default action set to `accept`, the following rules are applied (example):
206209

@@ -232,3 +235,9 @@ table inet talos {
232235
}
233236
}
234237
```
238+
239+
The running `nftable` configuration can be inspected with `talosctl get nftableschain -o yaml`.
240+
241+
The Ingress Firewall documents can be extracted from the machine config with the following command:
242+
243+
`talosctl read /system/state/config.yaml | yq 'select(.kind == "NetworkDefaultActionConfig"),select(.kind == "NetworkRuleConfig" )'`

website/content/v1.8/talos-guides/network/ingress-firewall.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Ingress Firewall"
33
description: "Learn to use Talos Linux Ingress Firewall to limit access to the host services."
44
---
55

6-
Talos Linux Ingress Firewall is a simple and effective way to limit access to the services running on the host, which includes both Talos standard
6+
Talos Linux Ingress Firewall is a simple and effective way to limit network access to the services running on the host, which includes both Talos standard
77
services (e.g. `apid` and `kubelet`), and any additional workloads that may be running on the host.
88
Talos Linux Ingress Firewall doesn't affect the traffic between the Kubernetes pods/services, please use CNI Network Policies for that.
99

@@ -29,17 +29,17 @@ ingress:
2929
except: 172.20.0.1/32
3030
```
3131
32-
The first document configures the default action for the ingress traffic, which can be either `accept` or `block`, with the default being `accept`.
33-
If the default action is set to `accept`, then all the ingress traffic will be allowed, unless there is a matching rule that blocks it.
34-
If the default action is set to `block`, then all the ingress traffic will be blocked, unless there is a matching rule that allows it.
32+
The first document configures the default action for ingress traffic, which can be either `accept` or `block`, with the default being `accept`.
33+
If the default action is set to `accept`, then all ingress traffic will be allowed, unless there is a matching rule that blocks it.
34+
If the default action is set to `block`, then all ingress traffic will be blocked, unless there is a matching rule that allows it.
3535

36-
With either `accept` or `block`, the traffic is always allowed on the following network interfaces:
36+
With either `accept` or `block`, traffic is always allowed on the following network interfaces:
3737

3838
* `lo`
3939
* `siderolink`
4040
* `kubespan`
4141

42-
In the `block` mode:
42+
In `block` mode:
4343

4444
* ICMP and ICMPv6 traffic is also allowed with a rate limit of 5 packets per second
4545
* traffic between Kubernetes pod/service subnets is allowed (for native routing CNIs)
@@ -62,30 +62,33 @@ The `protocol` might be either `tcp` or `udp`.
6262
The `ingress` specifies the list of subnets that are allowed to access the host services, with the optional `except` field to exclude a set of addresses from the subnet.
6363

6464
> Note: incorrect configuration of the ingress firewall might result in the host becoming inaccessible over Talos API.
65-
> The configuration might be [applied]({{< relref "../configuration/editing-machine-configuration" >}}) in `--mode=try` to make sure it gets reverted in case of a mistake.
65+
> It is recommended that the configuration be [applied]({{< relref "../configuration/editing-machine-configuration" >}}) in `--mode=try` to ensure it is reverted in case of a mistake.
6666

6767
## Recommended Rules
6868

6969
The following rules improve the security of the cluster and cover only standard Talos services.
7070
If there are additional services running with host networking in the cluster, they should be covered by additional rules.
7171

72-
In the `block` mode, the ingress firewall will also block encapsulated traffic (e.g. VXLAN) between the nodes, which needs to be explicitly allowed for the Kubernetes
72+
In `block` mode, the ingress firewall will also block encapsulated traffic (e.g. VXLAN) between the nodes, which needs to be explicitly allowed for the Kubernetes
7373
networking to function properly.
74-
Please refer to the CNI documentation for the specifics, some default configurations are listed below:
74+
Please refer to the documentation of the CNI in use for the specific ports required.
75+
Some default configurations are listed below:
7576

7677
* Flannel, Calico: `vxlan` UDP port 4789
7778
* Cilium: `vxlan` UDP port 8472
7879

79-
In the examples we assume following template variables to describe the cluster:
80+
In the examples we assume the following template variables to describe the cluster:
8081

8182
* `$CLUSTER_SUBNET`, e.g. `172.20.0.0/24` - the subnet which covers all machines in the cluster
8283
* `$CP1`, `$CP2`, `$CP3` - the IP addresses of the controlplane nodes
8384
* `$VXLAN_PORT` - the UDP port used by the CNI for encapsulated traffic
8485

8586
### Controlplane
8687

88+
In this example Ingress policy:
89+
8790
* `apid` and Kubernetes API are wide open
88-
* `kubelet` and `trustd` API is only accessible within the cluster
91+
* `kubelet` and `trustd` API are only accessible within the cluster
8992
* `etcd` API is limited to controlplane nodes
9093

9194
```yaml
@@ -160,7 +163,7 @@ ingress:
160163

161164
### Worker
162165

163-
* `kubelet` and `apid` API is only accessible within the cluster
166+
* `kubelet` and `apid` API are only accessible within the cluster
164167

165168
```yaml
166169
apiVersion: v1alpha1
@@ -200,7 +203,7 @@ ingress:
200203

201204
## Learn More
202205

203-
Talos Linux Ingress Firewall is using the `nftables` to perform the filtering.
206+
Talos Linux Ingress Firewall uses `nftables` to perform the filtering.
204207

205208
With the default action set to `accept`, the following rules are applied (example):
206209

@@ -232,3 +235,9 @@ table inet talos {
232235
}
233236
}
234237
```
238+
239+
The running `nftable` configuration can be inspected with `talosctl get nftableschain -o yaml`.
240+
241+
The Ingress Firewall documents can be extracted from the machine config with the following command:
242+
243+
`talosctl read /system/state/config.yaml | yq 'select(.kind == "NetworkDefaultActionConfig"),select(.kind == "NetworkRuleConfig" )'`

0 commit comments

Comments
 (0)