Skip to content

[17.0-stable] evetest: port scans; fix the exposure they found on EVE and EVE-k - #6753

Merged
rene merged 4 commits into
lf-edge:17.0-stablefrom
eriknordmark:eve-k-exposure-fixes-17.0-stable
Oct 12, 2026
Merged

rene merged 4 commits into
lf-edge:17.0-stablefrom
eriknordmark:eve-k-exposure-fixes-17.0-stable

Conversation

@eriknordmark

Copy link
Copy Markdown
Contributor

Description

Backport of #6665's non-evetest commits, plus #6232, to 17.0-stable.

This closes the network exposure that the port scans in #6665 found on EVE and EVE-k:

  • The debug container's sshd offers only public-key login.
  • On EVE-k clusters, the cluster-status server on port 12346 requires TLS 1.3 and a bearer token, both derived from the cluster join token. It no longer answers any host that can reach the cluster interface in plain HTTP.
  • k3s's servicelb and Traefik stay disabled. Before this change, the local-storage drop-in's bare disable: re-enabled them and exposed Traefik on ports 80 and 443.

Picked with -x, oldest first:

Commit Source Adaptation
debug: let sshd offer only publickey login #6665 97f726ab1 The installer's FROM lfedge/eve-debug hash is re-derived for this branch.
fix(kube): use disable+ … #6232 b0b10f315 None. It replaces #6665's 7fddaf229, which targets the Go kube-init that 17.0 does not have. On 17.0, cluster-init.sh installs cfg-manifests/03-enc-disable-local-path.yaml, and #6232 is the fix for that file.
zedkube: authenticate the cluster status server #6665 042622f22 The zedkube side matches master except for comments. On 17.0 the joining node polls from cluster-init.sh, not kube-init, so the client is a small new Go helper, pkg/kube/cluster-status-probe, built into the kube image. It carries a copy of kube-init's derivation, and cluster-init.sh pipes the join token to it in place of curl. Both copies' known-answer tests pin the same token and certificate hash.
docs: describe what EVE-k exposes on the network #6665 6da1ba360 The local-storage drop-in is attributed to cluster-init.sh, and the paragraph citing the evetest port-scan test is dropped.

#6665's evetest commit is not backported.

PR dependencies

None. #6232 is included here rather than backported separately.

How to test and validate this PR

  • go build (with and without -tags k), go vet -tags k and go test -tags k on pkg/pillar/cmd/zedkube pass.
  • go vet and go test on pkg/kube/cluster-status-probe pass, including a probe against a server derived from another join token, which must fail.
  • shellcheck pkg/kube/cluster-init.sh is clean, and make check-docker-hashes-consistency exits 0.
  • Not yet run on hardware. On a 3-node EVE-k cluster:
    • A third node joins.
    • A plain-HTTP curl http://<node-cluster-ip>:12346/status from another node gets no status.
    • kubectl get svc -A shows no Traefik service.
  • With debug.enable.ssh set, ssh -o PreferredAuthentications=password is refused.

Changelog notes

  • The optional SSH server offers only public-key authentication.
  • On EVE-k clusters, the cluster status service on port 12346 requires TLS and authentication. The App-Tracker is available only on the node itself, at 127.0.0.1:12346.
  • EVE-k clusters no longer run k3s's servicelb and Traefik by default.

PR Backports

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device: unit tests only, as above.
  • I've tested my PR on arm64 device: not tested.
  • I've written the test verification instructions
  • I've set the proper labels to this PR: labels are left to the maintainers.

For backport PRs:

  • I've added a reference link to the original PR

  • PR's title follows the template

  • I've checked the boxes above, or I've provided a good reason why I
    didn't check them.

🤖 Generated with Claude Code

eriknordmark and others added 4 commits October 9, 2026 17:06
sshd in the debug container ran with Alpine's defaults, which offer
password and keyboard-interactive authentication to anyone who
connects. No account has a password, so none of those logins could
succeed, but that can only be established by inspecting the image, not
from the network. Turning both methods off leaves what is allowed
unchanged and makes it observable: the evetest port scans now require
that SSH offers publickey only.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 97f726a)
…aefik disable

 k3s only appends to a "disable" list across config.yaml.d files when
 the key uses the "+" suffix; a bare "disable: local-storage" in
 03-enc-disable-local-path.yaml was replacing the base config.yaml's
 "disable: [servicelb, traefik]" instead of adding to it, silently
 re-enabling k3s's built-in servicelb on every fresh cluster-init.
 see:
 https://docs.k3s.io/installation/configuration#value-merge-behavior

Signed-off-by: naiming-zededa <naiming@zededa.com>
(cherry picked from commit b0b10f3)
On EVE-k, the cluster status server on port 12346 of the cluster IP
spoke plain HTTP and answered anyone on the cluster network, including
the App-Tracker's per-application dumps. It now accepts only TLS 1.3
and only requests carrying a bearer token. Every node derives the token
and the server's certificate from the cluster join token, so kube-init
on a joining node and zedkube on its peers authenticate the server and
themselves without any key distribution.

The cluster IP now serves only what other nodes need, /status and
/app/. The operator-facing App-Tracker, including /cluster-app/, moves
to plain HTTP on 127.0.0.1:12346, which edgeview reaches as before via
tcp/127.0.0.1:12346.

On 17.0-stable the joining node's wait loop is cluster-init.sh, not
kube-init, so the client side is a small cluster-status-probe helper
carrying a copy of kube-init's derivation, which cluster-init.sh calls
in place of curl.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 042622f)
List the ports EVE's firewall admits on the cluster interface and how
each is protected, note that the flannel VXLAN overlay is neither
encrypted nor authenticated, and explain why a bare disable: key in a
k3s drop-in re-exposes Traefik.

On 17.0-stable cluster-init.sh, not kube-init, installs the local-storage
drop-in, and the evetest port-scan suite is not backported, so the
paragraph citing it is dropped.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ULraDivKMXrdxJxycz6g6h
(cherry picked from commit 6da1ba3)
@eriknordmark

Copy link
Copy Markdown
Contributor Author

The Yetus golangcilint -1 is a false positive. golangci-lint prints a per-module summary line (0 issues.) and Yetus counts it as an issue, so the new pkg/kube/cluster-status-probe module adds one phantom "new" issue (pkg/kube/cluster-status-probe/0 issues. is the only difference between the branch and patch results). The fix is to pass --show-stats=false in tools/yetus/golangci-lint-plugin.patch and rebuild the Yetus image.

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.90840% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.79%. Comparing base (0c2f5bb) to head (a89b389).
⚠️ Report is 6 commits behind head on 17.0-stable.

Files with missing lines Patch % Lines
pkg/pillar/cmd/zedkube/clusterstatus.go 0.00% 45 Missing ⚠️
pkg/pillar/cmd/zedkube/clusterstatusauth.go 79.06% 10 Missing and 8 partials ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           17.0-stable    #6753      +/-   ##
===============================================
+ Coverage        22.35%   22.79%   +0.43%     
===============================================
  Files              508      519      +11     
  Lines            94338    96135    +1797     
===============================================
+ Hits             21091    21913     +822     
- Misses           71441    72228     +787     
- Partials          1806     1994     +188     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rene
rene merged commit 3168238 into lf-edge:17.0-stable Oct 12, 2026
54 of 58 checks passed
@eriknordmark
eriknordmark deleted the eve-k-exposure-fixes-17.0-stable branch October 16, 2026 10:10
@shjala shjala mentioned this pull request Nov 5, 2026
6 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants