Repository navigation
evetest: port scans; fix the exposure they found on EVE and EVE-k - #6665
Merged
Merged
Conversation
christoph-zededa
approved these changes
Sep 28, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6665 +/- ##
==========================================
+ Coverage 26.99% 27.33% +0.34%
==========================================
Files 523 534 +11
Lines 95745 97560 +1815
==========================================
+ Hits 25844 26669 +825
- Misses 67846 68649 +803
- Partials 2055 2242 +187 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
milan-zededa
approved these changes
Sep 28, 2026
eriknordmark
force-pushed
the
port-scan
branch
from
September 28, 2026 20:36
bead8c8 to
51f8ccc
Compare
eriknordmark
force-pushed
the
port-scan
branch
2 times, most recently
from
September 29, 2026 00:04
0e34d37 to
168ae89
Compare
github-actions
Bot
requested review from
andrewd-zededa,
naiming-zededa and
zedi-pramodh
September 29, 2026 00:04
3 of 7 tasks
eriknordmark
force-pushed
the
port-scan
branch
from
September 29, 2026 05:49
62bc1fb to
c903eb1
Compare
eriknordmark
marked this pull request as ready for review
September 29, 2026 06:53
Add tests that run nmap from the evetest container against every TCP and UDP port a device exposes: TestPortScanSuite covers EVE-kvm and a single-node EVE-k, and TestThreeNodesPortScan in TestNodeClusterSuite covers each node of a three-node EVE-k cluster on both its management address and its cluster IP, reusing TestThreeNodesCluster's devices. Any open UDP port fails. SSH must offer publickey authentication only, which nmap's ssh-auth-methods checks without sending credentials. Every other open TCP port must accept only TLS 1.2+ with ciphers that ssl-enum-ciphers grades A, refuse plaintext HTTP, and reject a request without credentials with 401 or by demanding a client certificate. The harness image gains nmap and nmap-scripts, hence the VERSION bump. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eriknordmark
force-pushed
the
port-scan
branch
from
September 29, 2026 06:55
ea5485b to
ed7b8ba
Compare
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>
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. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every EVE-k cluster ran k3s's servicelb and Traefik, exposing Traefik on 80/443 of every node address. kube-init writes the local-storage drop-in with a bare "disable:" key, which replaces the base config's servicelb and traefik entries instead of adding to them. The "disable+" fix went into the copy under cfg-manifests, which kube-init never reads, so the dead copy is removed. A unit test renders the drop-ins kube-init writes beside the base config, applies k3s's merge rule, and fails if servicelb or traefik is no longer disabled, or if a shipped drop-in shadows a rendered one. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. 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
eriknordmark
force-pushed
the
port-scan
branch
from
September 29, 2026 07:04
ed7b8ba to
ed34462
Compare
6 of 9 tasks
6 of 9 tasks
Merged
3 tasks done
This was referenced Oct 20, 2026
6 of 8 tasks
shjala
added a commit
to shjala/eve
that referenced
this pull request
Nov 5, 2026
Build the verified upstream release to include the musl password authentication bypass fix before Alpine 3.22 packages it. Preserve publickey-only access and register the source-built version in the SBOM. Add an isolated regression that reproduces the bypass on 10.6p1 and verifies rejection, publickey login and SFTP on 10.6p2. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de> (cherry picked from commit 8553375) Backport notes: Retain 16.0 base image pins and refresh its installer debug image hash. Carry the unchanged master register-sbom-pkg.sh helper locally because this branch lacks it. The preceding commit backports master 97f726a (original PR lf-edge#6665 commit b1d10d9) to disable password authentication.
2 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds evetest coverage that scans every TCP and UDP port an EVE device exposes, using nmap from the evetest container. It covers EVE-kvm, single-node EVE-k, and every node of a three-node EVE-k cluster. On the cluster it scans both the management address and the cluster IP.
publickeyauthentication only. nmap'sssh-auth-methodschecks this without sending credentials.ssl-enum-ciphersgrades A;The harness image gains
nmapandnmap-scripts, hence theevetest/VERSIONbump.The other three commits fix what the scans found:
/statusand/app/. The operator-facing App-Tracker, including/cluster-app/, moves to plain HTTP on127.0.0.1:12346, which edgeview reaches viatcp/127.0.0.1:12346.disable:key, which replaced the base config'sservicelbandtraefikentries, so every EVE-k cluster exposed Traefik on 80/443 of every node address. Thedisable+fix had gone into a copy undercfg-manifeststhat kube-init never reads; that copy is removed. A unit test applies k3s's merge rule to the drop-ins kube-init renders and fails if either component is re-enabled.Mixed-version clusters: a node that joins for the first time needs its bootstrap node to run the same side of the 12346 change. Nodes that restart, including after an upgrade, do not query
/status.The last commit adds a Network Exposure section to
docs/EVE-K.md: the ports EVE-k admits on the cluster interface and how each is protected.How to test and validate this PR
Results:
TestPortScanSuite(EVE-kvm and single-node EVE-k): passes; 22/tcp is the only open port. The variants take 5.6 and 9.2 min. (Run on the image with the first two commits; the 12346 server and the local-storage drop-in exist only in cluster mode.)TestThreeNodesPortScan(0.0.0-port-scan-c903eb10, all four commits): passes in 28 min, 14.5 of them for the cluster to form. 21 open ports:publickeyonly;The App-Tracker on every node's loopback interface reports all three nodes.
Cluster upgrade: evetest: upgrade a three-node EVE-k cluster #6673's
TestThreeNodesUpgrade, extended with an App-Tracker check, passes upgrading a three-node cluster from0.0.0-master-3f136150(this branch's base) to0.0.0-port-scan-c903eb10, one node at a time. After the upgrade every node's App-Tracker reports all three nodes. The check will be added to that test once both PRs merge.Against 17.0.0-lts the three-node test fails on SSH password methods, on plain-HTTP 12346, and on Traefik's 80/443 and NodePorts.
Unit tests cover the token and certificate derivation (pinned to the same values in zedkube and kube-init), 401 without or with a wrong token, rejection of a peer with another join token, and the k3s
disablemerge.Open test issues
Changelog notes
127.0.0.1:12346, for example throughedgeview.sh tcp/127.0.0.1:12346.PR Backports
Checklist
check them.
🤖 Generated with Claude Code