Skip to content

fix(login): raise RSA SSH host key default to 4096 bits#194

Closed
giuliocalzo wants to merge 1 commit into
SlinkyProject:mainfrom
giuliocalzo:fix/login-rsa-host-key-4096
Closed

fix(login): raise RSA SSH host key default to 4096 bits#194
giuliocalzo wants to merge 1 commit into
SlinkyProject:mainfrom
giuliocalzo:fix/login-rsa-host-key-4096

Conversation

@giuliocalzo
Copy link
Copy Markdown
Contributor

@giuliocalzo giuliocalzo commented May 12, 2026

Summary

  • crypto.NewKeyPair defaulted RSA keys to 1024 bits, and BuildLoginSshHostKeys was relying on that default to generate the login pod's RSA SSH host key. 1024-bit RSA is below modern security baselines (NIST SP 800-57 recommends 3072 bits for keys remaining secure past 2030).
  • Introduces crypto.DefaultRsaBitLength = 4096 and uses it as the new default in NewKeyPair.
  • Pins the length explicitly at the login-secret call site (crypto.WithRsaLength(crypto.DefaultRsaBitLength)) so the secure length is documented at both layers and won't silently regress if the default ever changes.

Test plan

  • go test ./internal/utils/crypto/... ./internal/builder/loginbuilder/... passes locally (existing TestNewKeyPair cases cover RSA default, WithRsaLength(4096), and the rejected WithRsaLength(256) insecure-length case).
  • CI green.
  • Manual verification: deploy a LoginSet, exec into the resulting Secret, and confirm ssh-keygen -lf ssh_host_rsa_key reports 4096 bits.

The keypair generator defaulted RSA keys to 1024 bits, which is below
modern security baselines and was being used for login pod SSH host
keys via BuildLoginSshHostKeys. Introduce a DefaultRsaBitLength
constant set to 4096 bits and pin it explicitly at the login-secret
call site so the secure length is documented at both layers and
cannot silently regress.
@SkylerMalinowski
Copy link
Copy Markdown
Contributor

Merged: 8ecab27

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