Skip to content

Remove DSS key support from SSH provider for Paramiko 4#69669

Merged
eladkal merged 7 commits into
apache:mainfrom
shivaam:codex/take-over-paramiko-4-dss-removal
Jul 10, 2026
Merged

Remove DSS key support from SSH provider for Paramiko 4#69669
eladkal merged 7 commits into
apache:mainfrom
shivaam:codex/take-over-paramiko-4-dss-removal

Conversation

@shivaam

@shivaam shivaam commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

This bumps the SSH/SFTP provider Paramiko dependency to Paramiko 4.x and removes Airflow's remaining DSS/DSA key handling paths.

Changes:

  • remove paramiko.DSSKey from SSH private-key loading
  • reject ssh-dss host keys with a clear migration error
  • parse real OpenSSH known_hosts host-key tokens:
    • ssh-rsa
    • ecdsa-sha2-nistp256
    • ecdsa-sha2-nistp384
    • ecdsa-sha2-nistp521
    • ssh-ed25519
  • keep bare base64 host_key values as RSA for backward compatibility
  • update SSH/SFTP provider docs, README dependency tables, changelogs, and lockfile
  • cap Paramiko at <5.0.0 because Paramiko 5 currently breaks existing SSH hook RSA private-key tests

Why

Paramiko 4 removed DSS/DSA support. Airflow was still referencing paramiko.DSSKey, which blocks moving the SSH/SFTP providers to Paramiko 4.

This also avoids a host-key regression: users with a configured ssh-dss host key now get an explicit migration error instead of a raw KeyError, and ECDSA known_hosts values such as ecdsa-sha2-nistp256 ... are parsed with paramiko.ECDSAKey instead of falling through to RSA parsing.

Tests

uv run ruff format providers/ssh/src/airflow/providers/ssh/hooks/ssh.py providers/ssh/tests/unit/ssh/hooks/test_ssh.py
uv run ruff check --fix providers/ssh/src/airflow/providers/ssh/hooks/ssh.py providers/ssh/tests/unit/ssh/hooks/test_ssh.py
uv run --frozen pytest providers/ssh/tests/unit/ssh/hooks/test_ssh.py -q -k 'host_key or dss or unsupported'

Result:

ruff format: 2 files left unchanged
ruff check --fix: All checks passed!
12 passed, 50 deselected, 1 warning

Also ran file-scoped prek validation. All applicable checks passed except Update providers build files, which could not run because Docker was not running locally.

Closes: #54079

Paramiko 4 removed DSS/DSA key handling, so the SSH provider needs to stop loading or documenting those keys while giving users a clear migration path.\n\nThis also teaches host_key parsing to understand real OpenSSH known_hosts key type tokens for RSA, ECDSA, and Ed25519 values.
shivaam added 6 commits July 9, 2026 12:54
Drop trailing comments from typed SSH/SFTP host_key values so pasted .pub lines like ssh-ed25519 <key> user@host keep working. Align async SFTP host-key parsing with async SSH by stripping values and rejecting ssh-dss.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove/Replace DSSKey references from Airflow

2 participants