← Back to Pull requests

ACM-37203: Add support for configurable TLS profiles #372

Closed
unknown closed this pull request without merging on Sep 15, 2026 10:38 UTC
View on GitHub
unknown unknown commented on Aug 04, 2026 15:33 UTC
Author

Summary

This PR adds command-line flags to configure TLS minimum version and cipher suites, allowing oauth-proxy to honor cluster-wide TLS security profiles from the OpenShift API server.

Fixes #352
Jira https://redhat.atlassian.net/browse/ACM-37203

Changes

  • ✅ Add --tls-min-version flag to configure minimum TLS version

  • ✅ Add --tls-cipher-suites flag to configure allowed cipher suites

  • ✅ Use Kubernetes standard k8s.io/component-base/cli/flag package for TLS parsing (same as kube-rbac-proxy, kube-apiserver, and other core components)

  • ✅ Preserve backward compatibility: when flags are not set, use existing secure defaults from library-go's SecureTLSConfig()
  • Motivation

    Currently, oauth-proxy uses hardcoded TLS settings from library-go/pkg/crypto.SecureTLSConfig(). While these defaults are secure (TLS 1.2+, strong ciphers), they cannot be dynamically configured to match cluster-wide TLS security profiles.

    This prevents components using oauth-proxy from achieving TLS profile compliance when the cluster is configured with Modern or Custom TLS profiles.

    Impact

    This change enables operators like multicluster-observability-operator to dynamically inject cluster TLS profile settings, achieving compliance with OpenShift TLS security profiles (Intermediate, Modern, Custom).

    Example usage:

    oauth-proxy \
      --tls-cert=/etc/tls/tls.crt \
      --tls-key=/etc/tls/tls.key \
      --tls-min-version=VersionTLS13 \
      --tls-cipher-suites=TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256
    

    Implementation Details

    This implementation follows the same pattern as MCO's rbac-query-proxy (stolostron/multicluster-observability-operator#2540):

    // In http.go - same approach as rbac-query-proxy
    minVersion, err := k8sapiflag.TLSVersion(s.Opts.TLSMinVersion)
    cipherSuites, err := k8sapiflag.TLSCipherSuites(s.Opts.TLSCipherSuites)
    

    Operators can use the existing SetTLSSecurityConfiguration() utility to inject cluster TLS settings:

    // Operators inject TLS settings the same way they do for kube-rbac-proxy:
    args := []string{"--https-address=:9095"}
    args, _ = util.SetTLSSecurityConfiguration(ctx, args, "--tls-cipher-suites=", "--tls-min-version=")
    // oauth-proxy now receives and applies the cluster TLS profile
    

    Testing

  • ✅ Code compiles successfully

  • ✅ New flags appear in --help output

  • ✅ Backward compatible: existing deployments without flags continue to use secure defaults

  • ✅ Uses battle-tested Kubernetes component-base flag parsing (same code as kube-apiserver)
  • Related Work

  • https://github.com/stolostron/multicluster-observability-operator/pull/2540 (adds TLS profile support for MCO components, notes oauth-proxy as pending) - this PR uses the same implementation pattern

  • https://docs.openshift.com/container-platform/latest/security/tls-profiles.html (OpenShift TLS security profiles documentation)
  • Checklist

  • Code compiles

  • Follows existing code patterns (matches rbac-query-proxy implementation)

  • Backward compatibility preserved

  • Help text added for new flags

  • Uses standard Kubernetes TLS parsing library
  • Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    Added configurable minimum TLS version and cipher suites for HTTPS.
    Added command-line and configuration options for TLS settings.
    HTTPS now uses secure TLS defaults and supports HTTP/1.1.

    Bug Fixes
    Invalid TLS versions and cipher suites are rejected during configuration validation.
    Configuration warnings are shown when TLS settings are used without HTTPS enabled.

    Tests
    * Added coverage for default and custom TLS configuration values.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 498 lines (+373 / -125) across 6 files Reviewer: ibihim Review duration: 60185m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.71) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.71 · 498 lines diff across 6 files
    0.71
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.372
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.071
    Real PR Conversation Timeline
    1 comments
    "Review active on #372"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 70.7% (HIGH) · Higher = larger blast radius
    70.7%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 27.9% · Safe to merge
    27.9%