Skip to content

[14.5-stable] debug: let sshd offer only publickey login - #6879

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

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

Conversation

@milan-zededa

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

Copy link
Copy Markdown
Contributor

Description

Backport of #6665 to 14.5-stable.

Only the debug: let sshd offer only publickey login commit is backported (cherry-picked with -x from 97f726ab16). The evetest port scan commit is part of the evetest backport (#6873) and the remaining commits of the PR do not apply to 14.5-stable.

The cherry-pick needed a different change of the same effect. 14.5-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 14.5-stable by #6873):

EVETEST_EVE_VERSION=<14.5-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.

@milan-zededa
milan-zededa requested a review from rouming as a code owner October 20, 2026 07:31
@github-actions
github-actions Bot requested a review from eriknordmark October 20, 2026 07:32
@milan-zededa milan-zededa changed the title [14.5-stable] evetest: port scans; fix the exposure they found on EVE and EVE-k [14.5-stable] debug: let sshd offer only publickey login Oct 20, 2026
@milan-zededa
milan-zededa force-pushed the 14.5-backport-6665-sshd-publickey branch from 49e3ee2 to c3346a1 Compare October 22, 2026 14:16

@eriknordmark eriknordmark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eriknordmark

Copy link
Copy Markdown
Contributor

Go Tests fails here because the bpftrace-compiler tests run past their 1h timeout on the self-hosted runners. #6936 raised the timeout to 5h on 14.5-stable. Re-running doesn't help, because the job tests the PR head. Please rebase onto the current 14.5-stable.

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.
@milan-zededa
milan-zededa force-pushed the 14.5-backport-6665-sshd-publickey branch from c3346a1 to 61130bb Compare October 28, 2026 07:43
@github-actions
github-actions Bot requested a review from eriknordmark October 28, 2026 07:44
@milan-zededa

Copy link
Copy Markdown
Contributor Author

Go Tests fails here because the bpftrace-compiler tests run past their 1h timeout on the self-hosted runners. #6936 raised the timeout to 5h on 14.5-stable. Re-running doesn't help, because the job tests the PR head. Please rebase onto the current 14.5-stable.

Done

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.60%. Comparing base (272ffae) to head (61130bb).
⚠️ Report is 288 commits behind head on 14.5-stable.

Additional details and impacted files
@@               Coverage Diff               @@
##           14.5-stable    #6879      +/-   ##
===============================================
+ Coverage        24.97%   25.60%   +0.62%     
===============================================
  Files                8       14       +6     
  Lines             1185     2882    +1697     
===============================================
+ Hits               296      738     +442     
- Misses             820     1992    +1172     
- Partials            69      152      +83     

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

@github-actions

Copy link
Copy Markdown
Contributor

evetest skip decision for this PR:

This PR only appends PasswordAuthentication no and KbdInteractiveAuthentication no to the debug container's pkg/debug/ssh/sshd_config, changing which SSH auth methods the device offers over the network. Skipping the following suites as unrelated:

  • TestApplicationConnectivitySuite
  • TestAppsSuite
  • TestBootstrapSuite
  • TestControllerFaultsSuite
  • TestDatastoreSuite
  • TestDeviceConnectivitySuite
  • TestDiagSuite
  • TestHardwareSuite
  • TestLPSSuite
  • TestPcibackErrorSuite
  • TestSecuritySuite
  • TestStorageSuite
  • TestTelemetrySuite
  • TestUpgradeSuite

These suites exercise app/network lifecycle, controller communication, datastores, hardware, pciback error reporting, AppArmor/vTPM/cert security, storage, telemetry, and upgrade behavior. They only use SSH incidentally as a transport to reach the device shell and never exercise which SSH auth methods are offered.

Kept: TestPortScanSuite / TestExternalPortScan (TestExternalPortScanKVM), the dedicated test that scans the device's open ports from the network and asserts SSH is the only exposed service — this directly covers the change.

An engineer can comment /evetest all to force the full suite to run instead, or /evetest <name> <name> ... to run only specific tests/suites.

@eriknordmark
eriknordmark merged commit 5c491f6 into lf-edge:14.5-stable Oct 30, 2026
86 of 101 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. Refresh the installer debug image hash. Publickey-only
authentication is already present via PR lf-edge#6879.
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