tls

package
v0.0.0-...-8ee8d0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAPIServerTLSProfile

func FetchAPIServerTLSProfile(ctx context.Context, c client.Client) (configv1.TLSProfileSpec, error)

FetchAPIServerTLSProfile fetches the TLS profile spec from the cluster APIServer CR. This is a convenience wrapper around controller-runtime-common's function.

func GetTLSConfigFromProfile

func GetTLSConfigFromProfile(profileSpec configv1.TLSProfileSpec) (func(*tls.Config), []string)

GetTLSConfigFromProfile returns a function that configures a tls.Config based on the provided TLS profile spec. The returned function is suitable for use with controller-runtime's metricsserver.Options TLSOpts field.

func GetTLSProfileValues

func GetTLSProfileValues(ctx context.Context, c client.Client, tlsGroupsEnabled bool, previousObservedConfig map[string]interface{}) (minVersion, cipherSuites, curvePreferences string, observedConfig map[string]interface{}, err error)

GetTLSProfileValues fetches the cluster API Server TLS profile via library-go's ObserveTLSSecurityProfileWithGroupPaths and returns TLS_MIN_VERSION, TLS_CIPHER_SUITES, TLS_CURVE_PREFERENCES, and observedConfig for future comparisons to avoid unnecessary updates. Returns empty strings on error so callers fall back to kube-rbac-proxy defaults.

Curve preferences are only produced when tlsGroupsEnabled is true (the TLSGroupPreferences feature gate is enabled); otherwise an empty string is returned so callers leave curves unrestricted. The observer emits the (FIPS-filtered) group names, which are converted to numeric curve IDs for kube-rbac-proxy; unrecognized groups are warned-and-skipped rather than failing.

func NewSecurityProfileWatcher

func NewSecurityProfileWatcher(
	initialProfile configv1.TLSProfileSpec,
	initialAdherence configv1.TLSAdherencePolicy,
	cancel context.CancelFunc,
) *crcommon.SecurityProfileWatcher

NewSecurityProfileWatcher creates a SecurityProfileWatcher that triggers graceful shutdown when TLS profile or adherence policy changes. The initial TLS profile spec and adherence policy are passed in so the watcher knows the baseline configuration from operator startup.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL