Skip to content

Crashes with env var GODEBUG=fips140=only #13651

@bryopsida

Description

@bryopsida

Environmental Info:
K3s Version: All post golang 1.24

Describe the bug:
K3S does not startup when setting environment variable: GODEBUG=fips140=only

This is due to sha1 hash usage in cluster/encrypt: https://github.com/k3s-io/k3s/blob/main/pkg/cluster/encrypt.go#L31

FIPS mode can be checked before selecting a hash see: a8161f4 as an example.

One impact to this would be, all cluster members would need to have FIPS mode enabled to derive the same key from the passphrase.

An additional thing to note is SHA1 is no longer considered secure so migrating to a different hash algorithm regardless of FIPS mode may be desirable.

https://en.wikipedia.org/wiki/SHA-1

I'm willing to stand up some PRs to fix this if it's a change that would be accepted.

Steps To Reproduce:

  • Install K3S
  • set environment variable GODEBUG=fips140=only on the process start/restart it

Expected behavior:
K3S Starts up

Actual behavior:
K3S Crashes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Enhancements

    Status

    Accepted

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions