Skip to content

[13.4-stable] debug: let sshd offer only publickey login - #6904

Merged
eriknordmark merged 1 commit into
lf-edge:13.4-stablefrom
milan-zededa:13.4-backport-6665-sshd-publickey
Oct 26, 2026
Merged

eriknordmark merged 1 commit into
lf-edge:13.4-stablefrom
milan-zededa:13.4-backport-6665-sshd-publickey

Conversation

@milan-zededa

@milan-zededa milan-zededa commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backport of #6665 to 13.4-stable.

Partial backport, cherry-picked with -x from 97f726ab16, with a different change of the same effect (the original does not apply). Only the debug: let sshd offer only publickey login commit is backported. The evetest port scan commit is part of the evetest backport (#6899) and the remaining commits of the PR do not apply to 13.4-stable.

13.4-stable builds sshd from source and ships its own pkg/debug/ssh/sshd_config without a sshd_config.d include, so PasswordAuthentication no and KbdInteractiveAuthentication no are appended to that file instead of a drop-in. The Dockerfile hash updates of the original commit are not applied.

Without this fix TestExternalPortScanKVM fails, because the port scan requires that SSH offers publickey only.

PR dependencies

None.

How to test and validate this PR

Covered by the evetest test TestExternalPortScanKVM (added to 13.4-stable by #6899):

EVETEST_EVE_VERSION=<13.4-stable build with this PR> make evetest NAME=TestExternalPortScanKVM

Changelog notes

The SSH server of the debug container now offers only publickey login.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

For backport PRs (remove it if it's not a backport):

  • I've added a reference link to the original PR
  • PR's title follows the template

And the last but not least:

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

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: 14.5-stable builds sshd from source and ships its own
pkg/debug/ssh/sshd_config without a sshd_config.d include, so the two
directives are appended to that file instead of a drop-in. The eve-debug
hash bump in pkg/installer/Dockerfile is left to the usual hash update.
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.66%. Comparing base (8077a3d) to head (8f814ea).
⚠️ Report is 319 commits behind head on 13.4-stable.

Additional details and impacted files
@@               Coverage Diff               @@
##           13.4-stable    #6904      +/-   ##
===============================================
+ Coverage        24.78%   32.66%   +7.88%     
===============================================
  Files                8        9       +1     
  Lines             1138     1090      -48     
===============================================
+ Hits               282      356      +74     
+ Misses             788      654     -134     
- Partials            68       80      +12     

☔ 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.

@eriknordmark
eriknordmark merged commit 5c94d28 into lf-edge:13.4-stable Oct 26, 2026
45 checks passed
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:
Adapt to the existing source build: bump the verified release, retain
GPG verification, remove the utmpx patch already included upstream,
install sshd-auth, align helper paths with the shipped SFTP
configuration, and add the unchanged master SBOM helper and regression
test stage. Refresh the installer debug image hash. Publickey-only
authentication is already present via PR lf-edge#6904.
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.

3 participants