Skip to content

Conversation

@scj643
Copy link
Contributor

@scj643 scj643 commented Nov 17, 2025

Change summary

Add PubkeyAuthOptions to allow requiring touch and user verification.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related PRs

Related Task(s)

https://vyos.dev/T7483

How to test / Smoketest result

Run ssh with these options enabled and verify that it requires touch and pin verification.

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

👍
No issues in PR Title / Commit Title

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

This is certainly a useful addition. I'm not a big fan of the name verify-required and might prefer that syntax to be require <verification|touch>.

The current syntax mirrors OpenSSH options from https://man.openbsd.org/sshd_config#PubkeyAuthOptions that might be familiar to OpenSSH users. This is a purely aesthetic considerations and I don't consider it a blocker for merging this PR.

Copy link
Member

@c-po c-po left a comment

Choose a reason for hiding this comment

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

Hi @scj643,

thanks for the contribution - as @dmbaturin already outline the CLI could be improved. Let me throw in another idea:

set service ssh fido pin-required
set service ssh fido touch-required

@scj643
Copy link
Contributor Author

scj643 commented Nov 20, 2025

Hi @scj643,

thanks for the contribution - as @dmbaturin already outline the CLI could be improved. Let me throw in another idea:


set service ssh fido pin-required

set service ssh fido touch-required

That sounds great. I'll change that later today.

@scj643
Copy link
Contributor Author

scj643 commented Nov 20, 2025

Changes made and updated the documentation.

@scj643 scj643 requested a review from c-po November 20, 2025 17:08
@c-po
Copy link
Member

c-po commented Nov 20, 2025

The documentation could use an example on how to set this up and get it working. Please also extend the SSH Smoketests to verify the CLI nodes actually males it into the sshd_config

@scj643
Copy link
Contributor Author

scj643 commented Nov 24, 2025

The documentation could use an example on how to set this up and get it working.

So an example of setting up the SSH server to only accept fido keys?

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

The new syntax looks fine to me, I'm happy to approve it.

@github-actions
Copy link

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests VPP 👍 passed
  • CLI Smoketests (interfaces only) ❌ failed
  • Config tests ❌ failed
  • Config tests VPP 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

Copy link
Member

@sever-sever sever-sever left a comment

Choose a reason for hiding this comment

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

Smoketests fails

DEBUG - Running Testcase: /usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py
DEBUG - test_ssh_default (__main__.TestServiceSSH.test_ssh_default) ... ok
DEBUG - test_ssh_dynamic_protection (__main__.TestServiceSSH.test_ssh_dynamic_protection) ... ok
DEBUG - test_ssh_fido (__main__.TestServiceSSH.test_ssh_fido) ... FAIL
DEBUG - test_ssh_login (__main__.TestServiceSSH.test_ssh_login) ... ERROR
DEBUG - test_ssh_login (__main__.TestServiceSSH.test_ssh_login) ... FAIL
DEBUG - test_ssh_multiple_listen_addresses (__main__.TestServiceSSH.test_ssh_multiple_listen_addresses) ... FAIL
DEBUG - test_ssh_ndcpp (__main__.TestServiceSSH.test_ssh_ndcpp) ... FAIL
DEBUG - test_ssh_pubkey_accepted_algorithm (__main__.TestServiceSSH.test_ssh_pubkey_accepted_algorithm) ... FAIL
DEBUG - test_ssh_single_listen_address (__main__.TestServiceSSH.test_ssh_single_listen_address) ... FAIL
DEBUG - test_ssh_single_listen_address (__main__.TestServiceSSH.test_ssh_single_listen_address) ... FAIL
DEBUG - test_ssh_trusted_user_ca (__main__.TestServiceSSH.test_ssh_trusted_user_ca) ... ERROR
DEBUG - test_ssh_trusted_user_ca (__main__.TestServiceSSH.test_ssh_trusted_user_ca) ... FAIL
DEBUG - test_ssh_vrf_multi (__main__.TestServiceSSH.test_ssh_vrf_multi) ... FAIL
DEBUG - test_ssh_vrf_multi (__main__.TestServiceSSH.test_ssh_vrf_multi) ... FAIL
DEBUG - test_ssh_vrf_single (__main__.TestServiceSSH.test_ssh_vrf_single) ... FAIL
DEBUG - test_ssh_vrf_single (__main__.TestServiceSSH.test_ssh_vrf_single) ... FAIL
DEBUG - 
DEBUG - ======================================================================
DEBUG - ERROR: test_ssh_login (__main__.TestServiceSSH.test_ssh_login)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 300, in test_ssh_login
DEBUG -     output, error = self.ssh_send_cmd(test_command, test_user, test_pass)
DEBUG -                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/base_vyostest_shim.py", line 201, in ssh_send_cmd
DEBUG -     ssh_client.connect(hostname=hostname, username=username,
DEBUG -   File "/usr/lib/python3/dist-packages/paramiko/client.py", line 381, in connect
DEBUG -     raise NoValidConnectionsError(errors)
DEBUG - paramiko.ssh_exception.NoValidConnectionsError: [Errno None] Unable to connect to port 22 on 127.0.0.1 or ::1
DEBUG - 
DEBUG - ======================================================================
DEBUG - ERROR: test_ssh_trusted_user_ca (__main__.TestServiceSSH.test_ssh_trusted_user_ca)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 461, in test_ssh_trusted_user_ca
DEBUG -     output, error = self.ssh_send_cmd(test_command, test_user, ***
DEBUG -                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/base_vyostest_shim.py", line 201, in ssh_send_cmd
DEBUG -     ssh_client.connect(hostname=hostname, username=username,
DEBUG -   File "/usr/lib/python3/dist-packages/paramiko/client.py", line 381, in connect
DEBUG -     raise NoValidConnectionsError(errors)
DEBUG - paramiko.ssh_exception.NoValidConnectionsError: [Errno None] Unable to connect to port 22 on 127.0.0.1 or ::1
DEBUG - 
DEBUG - ======================================================================
DEBUG - FAIL: test_ssh_fido (__main__.TestServiceSSH.test_ssh_fido)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 151, in tearDown
DEBUG -     self.assertTrue(process_named_running(PROCESS_NAME))
DEBUG - ======================================================================
DEBUG - FAIL: test_ssh_trusted_user_ca (__main__.TestServiceSSH.test_ssh_trusted_user_ca)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 151, in tearDown
DEBUG -     self.assertTrue(process_named_running(PROCESS_NAME))
DEBUG - AssertionError: None is not true
DEBUG - 
DEBUG - ======================================================================
DEBUG - FAIL: test_ssh_vrf_multi (__main__.TestServiceSSH.test_ssh_vrf_multi)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 281, in test_ssh_vrf_multi
DEBUG -     self.assertIn(PROCESS_NAME, tmp)
DEBUG - AssertionError: 'sshd' not found in ''
DEBUG - 
DEBUG - ======================================================================
DEBUG - FAIL: test_ssh_vrf_multi (__main__.TestServiceSSH.test_ssh_vrf_multi)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 151, in tearDown
DEBUG -     self.assertTrue(process_named_running(PROCESS_NAME))
DEBUG - AssertionError: None is not true
DEBUG - 
DEBUG - ======================================================================
DEBUG - FAIL: test_ssh_vrf_single (__main__.TestServiceSSH.test_ssh_vrf_single)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 258, in test_ssh_vrf_single
DEBUG -     self.assertIn(PROCESS_NAME, tmp)
DEBUG - AssertionError: 'sshd' not found in ''
DEBUG - 
DEBUG - ======================================================================
DEBUG - FAIL: test_ssh_vrf_single (__main__.TestServiceSSH.test_ssh_vrf_single)
DEBUG - ----------------------------------------------------------------------
DEBUG - Traceback (most recent call last):
DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py", line 151, in tearDown
DEBUG -     self.assertTrue(process_named_running(PROCESS_NAME))
DEBUG - AssertionError: None is not true
DEBUG - 
DEBUG - ----------------------------------------------------------------------
DEBUG - Ran 11 tests in 83.550s
DEBUG - 
DEBUG - FAILED (failures=12, errors=2)

@scj643
Copy link
Contributor Author

scj643 commented Nov 25, 2025

I think there is a deeper issue than what I added that is causing the smoke test to fail.

@scj643
Copy link
Contributor Author

scj643 commented Nov 27, 2025

@sever-sever think you could investigate that?

Copy link
Member

@sever-sever sever-sever left a comment

Choose a reason for hiding this comment

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

The local test looks ok

vyos@r14:~$ /usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py -k test_ssh_fido
test_ssh_fido (__main__.TestServiceSSH.test_ssh_fido) ... ok

----------------------------------------------------------------------
Ran 1 test in 3.944s

OK
vyos@r14:~$ 
vyos@r14:~$ 
vyos@r14:~$ /usr/libexec/vyos/tests/smoke/cli/test_service_ssh.py
test_ssh_default (__main__.TestServiceSSH.test_ssh_default) ... ok
test_ssh_dynamic_protection (__main__.TestServiceSSH.test_ssh_dynamic_protection) ... ok
test_ssh_fido (__main__.TestServiceSSH.test_ssh_fido) ... ok
test_ssh_login (__main__.TestServiceSSH.test_ssh_login) ... ok
test_ssh_multiple_listen_addresses (__main__.TestServiceSSH.test_ssh_multiple_listen_addresses) ... ok
test_ssh_ndcpp (__main__.TestServiceSSH.test_ssh_ndcpp) ... ok
test_ssh_pubkey_accepted_algorithm (__main__.TestServiceSSH.test_ssh_pubkey_accepted_algorithm) ... ok
test_ssh_single_listen_address (__main__.TestServiceSSH.test_ssh_single_listen_address) ... ok
test_ssh_trusted_user_ca (__main__.TestServiceSSH.test_ssh_trusted_user_ca) ... ok
test_ssh_vrf_multi (__main__.TestServiceSSH.test_ssh_vrf_multi) ... ok
test_ssh_vrf_single (__main__.TestServiceSSH.test_ssh_vrf_single) ... ok

----------------------------------------------------------------------
Ran 11 tests in 52.138s

OK
vyos@r14:~$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants