← Back to Pull requests

ACM-49951: add --tls-groups flag for TLS group preferences #413

Open
unknown opened this pull request with 449 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 10, 2026 13:48 UTC
Author

Summary

Adds support for configuring TLS named groups (elliptic curves / key-exchange groups) to oauth-proxy, so it can honor the cluster-wide TLSSecurityProfile.groups field in addition to the minimum TLS version and cipher suites added in #372.

Jira: https://redhat.atlassian.net/browse/ACM-49951
Strategy: https://redhat.atlassian.net/browse/OCPSTRAT-3145 (adds the groups field to TLSSecurityProfile)

Background

TLS 1.3 decoupled key exchange from cipher suites: cipher suites now only specify AEAD + hash, while key-exchange groups are negotiated separately via the supported_groups extension. TLSSecurityProfile has a groups field to control these cluster-wide (FIPS NIST-curve restriction, PQC hybrids like X25519MLKEM768). oauth-proxy already honors minTLSVersion/ciphers (#372) but had no way to apply group preferences.

Changes

  • Add --tls-groups (flag and tls_groups config key), resolved through the

  • go-options framework like every other option: flag values (comma-separated) and
    config-file values (arrays or CSV strings) are both honored, and the CLI flag
    overrides the config file. --tls-cipher-suites gets the same treatment — its
    config key previously had no effect.
  • Resolve group names to crypto/tls CurveIDs with the shared library-go helper

  • crypto.TLSGroupsToCurveIDs (the same mapping other OpenShift components use, and it
    covers every OpenShift TLSGroup value). Unrecognized groups are logged and skipped so a
    newer profile degrades gracefully; validation fails closed only when none of the requested
    groups are usable.
  • Apply the resolved groups as tls.Config.CurvePreferences in buildTLSConfig().

  • Backward compatible: when the flag is unset, behavior is unchanged (Go's default group selection).
  • Supported groups (all OpenShift TLSGroup values): X25519, secp256r1, secp384r1,
    secp521r1, X25519MLKEM768, SecP256r1MLKEM768, SecP384r1MLKEM1024.

    Example usage:

    oauth-proxy \
      --tls-cert=/etc/tls/tls.crt \
      --tls-key=/etc/tls/tls.key \
      --tls-min-version=VersionTLS13 \
      --tls-groups=X25519,secp256r1,secp384r1
    

    Operators can inject this the same way they inject the existing TLS flags for kube-rbac-proxy / rbac-query-proxy.

    Implementation

  • options.go: TLSGroups/TLSCipherSuites carry flag: and cfg: tags and are

  • validated into tlsCurveIDs via oscrypto.TLSGroupsToCurveIDs (no local name→curve
    map); values are normalized (trim/drop empty) in Validate.
  • http.go: buildTLSConfig() sets config.CurvePreferences when groups are configured.

  • main.go: flags are registered normally and populated by options.Resolve; no manual

  • parsing.

    Testing

  • go build ./..., go vet ./..., gofmt clean.

  • go test ./ ./api/... ./cookie/... ./providers/... ./util/... passes, including new

  • buildTLSConfig curve-preferences coverage, Options.Validate() valid/unrecognized
    group cases, and the post-quantum hybrids (X25519MLKEM768, SecP256r1MLKEM768,
    SecP384r1MLKEM1024) resolving through the library mapping.

    Notes

  • Rebased on current master (Go 1.26, k8s 1.37.1, openshift release-5.1 libs), which

  • provides crypto.TLSGroupsToCurveIDs; this PR introduces no dependency changes.
  • An explicitly empty --tls-groups (e.g. ,) is treated like an unset flag (Go's

  • default groups), because go-options cannot distinguish an empty string from an unset
    flag.
  • crypto/tls still names the field CurvePreferences / type CurveID (legacy naming);

  • these are the same TLS 1.3 "supported groups" concept.

    Diff: 449 lines (+336 / -113) across 5 files Reviewer: coleenquadros Review duration: 30731m
    All Vouch review confidence checks passed
    Residual risk 0.37 = Change Risk (0.69) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.69 · 449 lines diff across 5 files
    0.69
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.366
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.069
    Real PR Conversation Timeline
    1 comments
    "Review active on #413"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 68.6% (HIGH) · Higher = larger blast radius
    68.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 36.5% · Moderate risk
    36.5%