Skip to content

Kuba/ssh/services disabled by default hardening guide update/otp 19969/otp 20078/otp 20079#10970

Merged
u3s merged 3 commits intoerlang:masterfrom
u3s:kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079
Apr 13, 2026
Merged

Kuba/ssh/services disabled by default hardening guide update/otp 19969/otp 20078/otp 20079#10970
u3s merged 3 commits intoerlang:masterfrom
u3s:kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079

Conversation

@u3s
Copy link
Copy Markdown
Contributor

@u3s u3s commented Apr 3, 2026

No description provided.

@u3s u3s self-assigned this Apr 3, 2026
@u3s u3s added the team:PS Assigned to OTP team PS label Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

CT Test Results

    3 files     92 suites   1h 35m 10s ⏱️
2 193 tests 1 775 ✅ 417 💤 1 ❌
3 645 runs  3 144 ✅ 500 💤 1 ❌

For more details on these failures, see this check.

Results for commit f6b844c.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@u3s u3s force-pushed the kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079 branch from 6b978a0 to 36904ab Compare April 7, 2026 15:30
@u3s u3s added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels Apr 7, 2026
@u3s u3s force-pushed the kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079 branch from 36904ab to 4761e66 Compare April 7, 2026 17:13
@u3s u3s requested review from IngelaAndin and Mikaka27 April 7, 2026 17:28
@u3s u3s force-pushed the kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079 branch from 4761e66 to ae811ec Compare April 7, 2026 17:51
@u3s u3s added the testing currently being tested, tag is used by OTP internal CI label Apr 7, 2026
@u3s u3s force-pushed the kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079 branch from ae811ec to 012f412 Compare April 9, 2026 16:25
Comment thread lib/ssh/doc/guides/hardening.md Outdated
@u3s u3s force-pushed the kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079 branch from 012f412 to e9de033 Compare April 10, 2026 07:27
Comment thread lib/ssh/doc/guides/using_ssh.md Outdated
Comment thread lib/ssh/doc/guides/using_ssh.md Outdated
Comment thread lib/ssh/src/ssh.hrl Outdated
Comment thread lib/ssh/src/ssh.hrl Outdated
Comment thread lib/ssh/src/ssh.hrl Outdated
Comment thread lib/ssh/src/ssh.hrl Outdated
Comment thread lib/ssh/doc/guides/using_ssh.md
Comment thread lib/ssh/doc/guides/hardening.md Outdated
Comment thread lib/ssh/doc/guides/hardening.md Outdated
@u3s u3s requested review from IngelaAndin and Mikaka27 April 10, 2026 13:52
u3s added 3 commits April 10, 2026 21:35
Change the shell and exec daemon options to default to disabled
instead of enabling the Erlang shell and Erlang term evaluation
respectively. This implements the "secure by default" principle,
preventing authenticated users from executing arbitrary Erlang code
unless explicitly configured.

The new erlang_eval exec option enables Erlang term evaluation via
exec requests, replacing the previous implicit behavior.

Applications requiring these services must now explicitly enable them:

  %% Enable Erlang shell
  ssh:daemon(Port, [{shell, {shell, start, []}} | Options])

  %% Enable Erlang term evaluation via exec
  ssh:daemon(Port, [{exec, erlang_eval} | Options])

Also fix a client-side crash in ssh:shell/1 where the missing exec
key in options caused channel_cb_init_args/1 to append undefined to
the callback init args. Both erlang_eval and undefined are now
filtered out, as neither is a callback init argument.
The subsystems daemon option now defaults to an empty list instead
of enabling the SFTP subsystem via ssh_sftpd:subsystem_spec([]).
This extends the "secure by default" principle to also cover SFTP,
complementing the shell and exec default changes.

Previously, all authenticated SSH users had access to the entire
file system visible to the Erlang VM process through the default
SFTP subsystem, with no path restrictions.

Changes:
- Change subsystems default from [ssh_sftpd:subsystem_spec([])] to []
- Update subsystem_spec doc string in ssh.hrl
- Remove dead code in ssh_connection:check_subsystem/2
- Update test suites to explicitly enable SFTP where needed
- Update documentation (hardening.md, introduction.md, using_ssh.md,
  ssh_app.md, terminology.md)

Applications requiring SFTP must now explicitly enable it:

  ssh:daemon(Port, [{subsystems, [ssh_sftpd:subsystem_spec([])]}
                    | Options])
Add sections on SFTP enablement, network-level security and advanced
authentication:
- SFTP subsystem enablement with root option and rights model reference
- Non-root VM recommendation in introduction
- IP binding restrictions (daemon/3 vs daemon/2 default behavior)
- MFA limitations and VPN alternative recommendation
- Public key validation via key_cb with pk_check_user
- Account lockout using pwdfun with cross-connection ETS tracking
@u3s u3s force-pushed the kuba/ssh/services_disabled_by_default_hardening_guide_update/OTP-19969/OTP-20078/OTP-20079 branch from 6e5f3f1 to f6b844c Compare April 10, 2026 19:36
@u3s u3s merged commit ae077a9 into erlang:master Apr 13, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants