Repository navigation
[16.0-stable] evetest: port scans; fix the exposure they found on EVE - #6845
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 16.0-stable #6845 +/- ##
===============================================
+ Coverage 31.67% 33.07% +1.39%
===============================================
Files 10 25 +15
Lines 1026 3988 +2962
===============================================
+ Hits 325 1319 +994
- Misses 701 2669 +1968 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@milan-zededa should we make this PR just about the SSH auth and merged it, now that sshole is a thing? |
316e614 to
9efa5fb
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> (cherry picked from commit 97f726a) Backport note: the eve-debug hash in pkg/installer/Dockerfile is not the one from the original commit, which referred to a master build. It is the hash of pkg/debug as built on 16.0-stable with this change. Signed-off-by: Milan Lenco <milan@zededa.com>
9efa5fb to
c866bec
Compare
|
@eriknordmark @shjala I have redone this PR as a cherry-pick ( |
|
Confirmed that the test is passing with this backport: |
Description
Backport of #6665 to
16.0-stable.Only the
debug: let sshd offer only publickey logincommit of the PR isbackported. The EVE-k commits (
zedkube,kube, docs) are not applicable to16.0, and the evetest commit is part of the evetest backport (#6842).
The cherry-pick (
-x) conflicted inpkg/installer/Dockerfileon theeve-debugimage hash. The hash from the original commit refers to a master build, so it is
replaced by the hash of
pkg/debugas built on16.0-stablewith this change.The
pkg/debug/Dockerfilechange (asshd_config.ddrop-in) applies as on master,now that #6707 has replaced the source-built OpenSSH with Alpine's
openssh-server.Without this fix
TestExternalPortScanKVMfails: sshd offers password methodsto the network.
How to test and validate this PR
Covered by the evetest suite
TestPortScanSuite(variantTestExternalPortScanKVM, added to16.0-stableby #6842):To check on a real device, enable SSH access to the device from the controller
and, from another host, run:
The connection must be refused with
Permission denied (publickey).Before this fix it listedpublickey,password,keyboard-interactive, and ssh would prompt for a password.The same can be seen with
nmap -p 22 --script ssh-auth-methods <device-ip>,which must report only
publickey.Changelog notes
The debug sshd now offers only public key login, so it no longer advertises password-based authentication methods to the network.
Checklist
For backport PRs (remove it if it's not a backport):
And the last but not least:
check them.