Skip to content

Commit f805a16

Browse files
JGAntunesajp-io
andauthored
feat(preflights): add arp filtering related preflights (#1454)
* feat(preflights): add arp filtering related preflights * chore: change to the soon to be added sysctl collector and analyzer * chore: remove the e2e tests (which are now covered in troubleshoot) * fix: individual arp preflights * chore: bump troubleshoot * Update messages and slightly change order * chore: add pass analyzers to arp preflights --------- Co-authored-by: Alex Parker <[email protected]>
1 parent d44af2b commit f805a16

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ K0S_GO_VERSION = v1.30.5+k0s.0
1515
PREVIOUS_K0S_VERSION ?= v1.29.9+k0s.0-ec.0
1616
PREVIOUS_K0S_GO_VERSION ?= v1.29.9+k0s.0
1717
K0S_BINARY_SOURCE_OVERRIDE =
18-
TROUBLESHOOT_VERSION = v0.107.4
18+
TROUBLESHOOT_VERSION = v0.109.0
1919

2020
KOTS_VERSION = v$(shell awk '/^version/{print $$2}' pkg/addons/adminconsole/static/metadata.yaml | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
2121
# When updating KOTS_BINARY_URL_OVERRIDE, also update the KOTS_VERSION above or

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
github.com/replicatedhq/embedded-cluster/kinds v0.0.0
3232
github.com/replicatedhq/embedded-cluster/utils v0.0.0
3333
github.com/replicatedhq/kotskinds v0.0.0-20240814191029-3f677ee409a0
34-
github.com/replicatedhq/troubleshoot v0.108.1
34+
github.com/replicatedhq/troubleshoot v0.109.0
3535
github.com/sirupsen/logrus v1.9.3
3636
github.com/spf13/cobra v1.8.1
3737
github.com/spf13/viper v1.19.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ github.com/redis/go-redis/v9 v9.5.2 h1:L0L3fcSNReTRGyZ6AqAEN0K56wYeYAwapBIhkvh0f
907907
github.com/redis/go-redis/v9 v9.5.2/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
908908
github.com/replicatedhq/kotskinds v0.0.0-20240814191029-3f677ee409a0 h1:Gi+Fs6583v7GmgQKJyaZuBzcih0z5YXBREDQ8AWY2JM=
909909
github.com/replicatedhq/kotskinds v0.0.0-20240814191029-3f677ee409a0/go.mod h1:QjhIUu3+OmHZ09u09j3FCoTt8F3BYtQglS+OLmftu9I=
910-
github.com/replicatedhq/troubleshoot v0.108.1 h1:Yri05zhzIZRrbSYWsvCWjpcp8KzNj2GfrfQRLnZH9UU=
911-
github.com/replicatedhq/troubleshoot v0.108.1/go.mod h1:mxf8uoKpyFhaYfR3NV1iPwztBf8XWP0B/JpxamZ1UJY=
910+
github.com/replicatedhq/troubleshoot v0.109.0 h1:lw81hf/lD9/YPj+VOyGdDnw7FSCJkignPQYLVpjnl2k=
911+
github.com/replicatedhq/troubleshoot v0.109.0/go.mod h1:mxf8uoKpyFhaYfR3NV1iPwztBf8XWP0B/JpxamZ1UJY=
912912
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
913913
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
914914
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=

pkg/preflights/host-preflight.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ spec:
148148
exclude: '{{ eq .GlobalCIDR.CIDR "" }}'
149149
CIDRRangeAlloc: '{{ .GlobalCIDR.CIDR }}'
150150
desiredCIDR: {{.GlobalCIDR.Size}}
151+
- sysctl: {}
151152
analyzers:
152153
- cpu:
153154
checkName: CPU
@@ -834,3 +835,39 @@ spec:
834835
- pass:
835836
when: "a-subnet-is-available"
836837
message: Specified CIDR is available.
838+
- sysctl:
839+
checkName: "ARP Filter default value for newly created interfaces"
840+
outcomes:
841+
- fail:
842+
when: 'net.ipv4.conf.default.arp_filter > 0'
843+
message: "ARP filtering must be disabled by default for newly created interfaces on the host. To disable it, edit /etc/sysctl.conf, add the line 'net.ipv4.conf.default.arp_filter=0', and run 'sudo sysctl -p'."
844+
- pass:
845+
when: 'net.ipv4.conf.default.arp_filter == 0'
846+
message: "ARP filtering is disabled by default for newly created interfaces on the host."
847+
- sysctl:
848+
checkName: "ARP Filter value for all interfaces"
849+
outcomes:
850+
- fail:
851+
when: 'net.ipv4.conf.all.arp_filter > 0'
852+
message: "ARP filtering must be disabled for all interfaces on the host. To disable it, edit /etc/sysctl.conf, add the line 'net.ipv4.conf.all.arp_filter=0', and run 'sudo sysctl -p'."
853+
- pass:
854+
when: 'net.ipv4.conf.all.arp_filter == 0'
855+
message: "ARP filtering is disabled for all interfaces on the host."
856+
- sysctl:
857+
checkName: "ARP Ignore default value for newly created interfaces"
858+
outcomes:
859+
- fail:
860+
when: 'net.ipv4.conf.default.arp_ignore > 0'
861+
message: "ARP ignore must be disabled by default for newly created interfaces on the host. To disable it, edit /etc/sysctl.conf, add the line 'net.ipv4.conf.default.arp_ignore=0', and run 'sudo sysctl -p'."
862+
- pass:
863+
when: 'net.ipv4.conf.default.arp_ignore == 0'
864+
message: "ARP ignore is disabled by default for newly created interfaces on the host."
865+
- sysctl:
866+
checkName: "ARP Ignore value for all interfaces"
867+
outcomes:
868+
- fail:
869+
when: 'net.ipv4.conf.all.arp_ignore > 0'
870+
message: "ARP ignore must be disabled for all interfaces on the host. To disable it, edit /etc/sysctl.conf, add the line 'net.ipv4.conf.all.arp_ignore=0', and run 'sudo sysctl -p'."
871+
- pass:
872+
when: 'net.ipv4.conf.all.arp_ignore == 0'
873+
message: "ARP ignore is disabled for all interfaces on the host."

0 commit comments

Comments
 (0)