Skip to content

[master] Manage SSH keys and certificates#64708

Merged
dwoz merged 29 commits intosaltstack:masterfrom
lkubb:openssh-cert
Jan 29, 2026
Merged

[master] Manage SSH keys and certificates#64708
dwoz merged 29 commits intosaltstack:masterfrom
lkubb:openssh-cert

Conversation

@lkubb
Copy link
Contributor

@lkubb lkubb commented Jul 25, 2023

What does this PR do?

Adds ssh_pki execution and state modules that apply the principle (and rough code outline) of the x509 modules to SSH keys and certificates. This allows to statefully manage ssh keys and certificates and create an OpenSSH CA managed by Salt.

Note: Based on #65654.

What issues does this PR fix or reference?

Fixes: #65197

Merge requirements satisfied?

Commits signed with GPG?

Yes

Notes

I'm not sure if adding a new module fits the current zeitgeist of moving modules out into extensions, but tend to think being able to manage SSH keys (and certificates) should be part of Salt core.

In a lucky coincidence, the development of these modules resulted in the discovery of GHSA-cf7p-gm2m-833m, which means Salt now ships with the required cryptography version for them by default. :)

@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Manage SSH keys and certificates [master] Manage SSH keys and certificates Jul 25, 2023
@lkubb lkubb temporarily deployed to ci July 25, 2023 23:29 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 25, 2023 23:30 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 25, 2023 23:30 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 25, 2023 23:31 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 02:31 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 02:31 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 02:31 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 02:48 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 02:54 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 04:45 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 06:33 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 06:33 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 06:33 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 06:33 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 06:33 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 06:33 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 08:37 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 08:37 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 08:37 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 08:37 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 08:37 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci July 26, 2023 08:37 — with GitHub Actions Inactive
@lkubb lkubb force-pushed the openssh-cert branch 2 times, most recently from 182841a to 2949543 Compare September 14, 2023 16:01
@lkubb lkubb temporarily deployed to ci September 14, 2023 16:28 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci September 14, 2023 16:28 — with GitHub Actions Inactive
@lkubb lkubb temporarily deployed to ci September 14, 2023 16:28 — with GitHub Actions Inactive
lkubb added 14 commits January 28, 2026 15:13
to be able to use them in a wrapper module
in CI, pytest complained about an `import file mismatch` because these
files have the same basename as the x509_v2 tests.

Output was:

```
ERROR collecting tests/pytests/integration/ssh/ssh_pki/test_certificate_managed_wrapper.py
import file mismatch:
imported module 'test_certificate_managed_wrapper' has this __file__ attribute:
  /__w/salt/salt/tests/pytests/integration/ssh/x509_v2/test_certificate_managed_wrapper.py
which is not the same as the test file we want to collect:
  /__w/salt/salt/tests/pytests/integration/ssh/ssh_pki/test_certificate_managed_wrapper.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
```
... and remove unnecessary fixture requests.
@dwoz dwoz merged commit fabda54 into saltstack:master Jan 29, 2026
814 of 819 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Manage SSH keys and certificates

4 participants