Skip to content

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

Open
coleenquadros wants to merge 2 commits into
openshift:masterfrom
coleenquadros:add-tls-profile-support
Open

ACM-37203: Add support for configurable TLS profiles#372
coleenquadros wants to merge 2 commits into
openshift:masterfrom
coleenquadros:add-tls-profile-support

Conversation

@coleenquadros

@coleenquadros coleenquadros commented Aug 4, 2026

Copy link
Copy Markdown

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

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

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.

@openshift-merge-bot

Copy link
Copy Markdown

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Changes

TLS configuration

Layer / File(s) Summary
TLS options and validation
options.go, go.mod
Options adds TLS minimum-version and cipher-suite fields. Validation checks HTTPS usage, TLS versions, and cipher-suite names.
TLS CLI parsing
main.go
New flags capture TLS settings. Cipher-suite values are trimmed, empty entries are removed, and the list is stored in Options.
HTTPS TLS application and tests
http.go, http_test.go
ServeHTTPS applies validated TLS settings. Tests cover defaults and option value retention.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI flags
  participant Options
  participant Options.Validate
  participant ServeHTTPS
  participant TLS configuration
  CLI flags->>Options: Set TLSMinVersion and TLSCipherSuites
  Options->>Options.Validate: Validate TLS settings
  Options.Validate-->>ServeHTTPS: Provide validated options
  ServeHTTPS->>TLS configuration: Apply minimum TLS version and cipher suites
Loading

Suggested reviewers: ibihim


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 2 warnings)

Check name Status Explanation Resolution
No-Weak-Crypto ❌ Error The new TLS option accepts and applies Kubernetes' insecure cipher list; that list includes RC4, 3DES, and SHA1 suites, and no PR code filters them. Reject any suite in k8sapiflag.InsecureTLSCiphers() during validation before assigning config.CipherSuites.
Linked Issues check ⚠️ Warning The PR adds configurable TLS version and cipher suites but does not add the TLS curve configuration requested by issue #352. Add a TLS curves option with validation and application, or explicitly defer curve configuration in issue #352.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (12 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The code and dependency changes support configurable TLS settings and related parsing, validation, serving, and tests.
Stable And Deterministic Test Names ✅ Passed No non-vendored Ginkgo usage exists; added Go tests use stable function names and literal t.Run labels with no dynamic values.
Test Structure And Quality ✅ Passed The PR adds standard Go tests using testing.T and t.Run, not Ginkgo It blocks; no Ginkgo lifecycle, cluster resources, or Eventually/Consistently calls require this check.
Microshift Test Compatibility ✅ Passed The added http_test.go contains standard Go Test functions, not Ginkgo e2e tests, and references no MicroShift-incompatible OpenShift APIs or features.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds standard Go unit tests in http_test.go using testing.T, not Ginkgo e2e tests; no new multi-node or HA assumptions require SNO protection.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes only TLS/configuration Go files, tests, and dependencies; no deployment manifests, operators, controllers, or scheduling constraints appear in the diff.
Ote Binary Stdout Contract ✅ Passed The repository builds a standalone oauth-proxy reverse-proxy server and has no OTE or openshift-tests suite entrypoint, so the OTE JSON stdout contract does not apply.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR adds only standard Go unit tests in http_test.go; no new Ginkgo e2e tests or external network dependencies were added.
Container-Privileges ✅ Passed The PR changes only Go code and go.mod. It adds no privilege settings to manifests; the existing e2e pod uses non-root execution, no privilege escalation, and drops all capabilities.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds only a fixed warning about disabled HTTPS. TLS validation errors contain version or cipher names, not passwords, tokens, PII, hostnames, or customer data.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding configurable TLS profiles.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from ibihim and liouk August 4, 2026 15:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@main.go`:
- Line 47: Update the tlsCipherSuites flag handling around TLSCipherSuites and
its Var registration to split each comma-separated value into individual cipher
suite names before applying TLS options. Preserve support for repeated flag
values and ensure validation receives separate entries rather than one combined
string.

In `@tls_config.go`:
- Around line 18-22: Update the TLSCipherSuites parsing and validation around
tlsCipherSuites so TLS 1.3 suite names are not accepted as enforceable
configuration when assigned to tls.Config.CipherSuites; either reject them with
a clear error or explicitly scope the flag to TLS 1.2 and earlier. Ensure tests
cover the chosen behavior and preserve valid TLS 1.2-and-earlier cipher suite
handling.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d231bd2-616d-412c-a82e-0e42fac56545

📥 Commits

Reviewing files that changed from the base of the PR and between e904694 and b6b1944.

📒 Files selected for processing (5)
  • http.go
  • main.go
  • options.go
  • tls_config.go
  • tls_config_test.go

Comment thread main.go Outdated
Comment thread tls_config.go Outdated

@liouk liouk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TLS override logic implementation currently does not include any unit tests; we should add unit tests that would verify for example:

  • Default config (no flags) keeps library-go defaults
  • Setting --tls-min-version=VersionTLS13 actually changes config.MinVersion
  • Invalid version/cipher names produce errors
  • The existing StringArray tests in string_array_test.go don't cover the new comma-splitting behavior

Comment thread string_array.go Outdated
Comment thread http.go Outdated
Comment thread options.go Outdated
Comment thread main.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@http_test.go`:
- Around line 21-23: Replace the assignment-only checks in
TestTLSMinVersionParsing and related tests with coverage of a TLS configuration
resolver returning (*tls.Config, error). Extract the TLS parsing logic from
ServeHTTPS into that resolver, then assert secure defaults, valid TLS versions
and cipher suites, and errors for invalid inputs using the existing expected and
expectError cases.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e30290b2-fc4b-498f-ba9a-248830818618

📥 Commits

Reviewing files that changed from the base of the PR and between 44d8054 and a7281ee.

📒 Files selected for processing (3)
  • http_test.go
  • string_array.go
  • string_array_test.go

Comment thread http_test.go Outdated
@coleenquadros
coleenquadros force-pushed the add-tls-profile-support branch 3 times, most recently from 0a9d488 to 80ce05c Compare August 5, 2026 16:06
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
options.go (1)

333-357: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test Options.Validate directly.

The current TLS tests only copy values into Options. They do not execute the validation added at Lines 333-357. Add table-driven cases that call Validate and assert rejection of TLS 1.0, TLS 1.1, unknown versions, and unknown cipher suites. Otherwise, the tests can pass if this validation is removed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@options.go` around lines 333 - 357, Add table-driven tests that invoke
Options.Validate for TLS configuration cases, asserting errors for TLS 1.0, TLS
1.1, unknown TLS versions, and unknown cipher suites. Ensure each case supplies
the relevant TLSMinVersion or TLSCipherSuites values and verifies Validate
rejects the configuration, rather than only testing option assignment.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@http.go`:
- Around line 87-98: Update ServeHTTPS to capture and handle errors returned by
k8sapiflag.TLSVersion and k8sapiflag.TLSCipherSuites instead of discarding them.
Log the parsing failure and return before creating the HTTPS listener, ensuring
invalid or partial TLS options cannot start serving.

---

Nitpick comments:
In `@options.go`:
- Around line 333-357: Add table-driven tests that invoke Options.Validate for
TLS configuration cases, asserting errors for TLS 1.0, TLS 1.1, unknown TLS
versions, and unknown cipher suites. Ensure each case supplies the relevant
TLSMinVersion or TLSCipherSuites values and verifies Validate rejects the
configuration, rather than only testing option assignment.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ab32ed1-3616-4972-9322-aaf9df05a5d0

📥 Commits

Reviewing files that changed from the base of the PR and between e904694 and be78fe1.

📒 Files selected for processing (5)
  • go.mod
  • http.go
  • http_test.go
  • main.go
  • options.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • main.go
  • go.mod
  • http_test.go

Comment thread http.go
@coleenquadros coleenquadros changed the title Add support for configurable TLS profiles ACM-37203 - Add support for configurable TLS profiles Aug 6, 2026
Comment thread http.go Outdated
@coleenquadros
coleenquadros force-pushed the add-tls-profile-support branch 2 times, most recently from 179e787 to fabd77c Compare August 10, 2026 10:52

@liouk liouk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements! Overall looks good now, just a couple more suggestions.

Comment thread http.go Outdated
Comment thread http.go Outdated
Comment thread http_test.go
Add --tls-min-version and --tls-cipher-suites flags to enable
oauth-proxy to honor cluster-wide TLS security profiles.

- Use library-go (oscrypto) for TLS validation and parsing
- Parse comma-separated cipher suites (MCO compatibility)
- Reject TLS 1.0/1.1 and insecure ciphers (RC4, 3DES, CBC-SHA1)
- Validate in Options.Validate() for early error detection
- Comprehensive unit tests for validation and security

Fixes: openshift#352

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
@coleenquadros
coleenquadros force-pushed the add-tls-profile-support branch from fabd77c to 70b62f9 Compare August 11, 2026 11:44
@liouk

liouk commented Aug 11, 2026

Copy link
Copy Markdown
Member

Thank you for the changes @coleenquadros -- looks good!

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 11, 2026
@openshift-merge-bot

Copy link
Copy Markdown

Scheduling required tests:
/test e2e-aws
/test e2e-component

@liouk

liouk commented Aug 11, 2026

Copy link
Copy Markdown
Member

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@liouk: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@liouk

liouk commented Aug 11, 2026

Copy link
Copy Markdown
Member

/retitle ACM-37203: Add support for configurable TLS profiles

@openshift-ci openshift-ci Bot changed the title ACM-37203 - Add support for configurable TLS profiles ACM-37203: Add support for configurable TLS profiles Aug 11, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@coleenquadros: This pull request references ACM-37203 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

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

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

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.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@sanchezl sanchezl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach here is seems over-scoped for what oauth-proxy needs. oauth-proxy is a sidecar and the operator that creates it is the one that owns TLS policy decisions: min version/ciphers/validation. A simpler PR where oauth-proxy just accepts the flags and apply them should be good enough .

Just add the flags, apply them, done: Drop all the validation in Validate() (insecure cipher rejection, version floor checks, cross-field warnings). The deploying operator determines what's valid for its context. oauth-proxy shouldn't second-guess it. This also eliminates a number of edge cases the current validation misses

Default to TLS 1.3 minimum: That eliminates the need for the library-go crypto dependency entirely.

@liouk

liouk commented Aug 13, 2026

Copy link
Copy Markdown
Member

The approach here is seems over-scoped for what oauth-proxy needs. oauth-proxy is a sidecar and the operator that creates it is the one that owns TLS policy decisions: min version/ciphers/validation. A simpler PR where oauth-proxy just accepts the flags and apply them should be good enough .

Just add the flags, apply them, done: Drop all the validation in Validate() (insecure cipher rejection, version floor checks, cross-field warnings). The deploying operator determines what's valid for its context. oauth-proxy shouldn't second-guess it. This also eliminates a number of edge cases the current validation misses

Default to TLS 1.3 minimum: That eliminates the need for the library-go crypto dependency entirely.

@sanchezl I'm the one responsible for steering towards this change; @coleenquadros' initial implementation was as you describe it. While I agree that the operator should own policies, the validation doesn't really conflict with that -- it's more of a safety net, and an operator that sets valid values will never hit it. Plus, if the binary ever gets used standalone instead of a sidecar (e.g. testing/debugging), this might come in handy.

At the same time, there's no real burden added: the validation code is ~30 lines, uses already vendored libs and only runs once at startup; no performance cost, no new dependencies, and no real maintenance burden added -- overall oauth-proxy still remains lean.

If you feel strongly about this direction, I'm ok to yield and go back to the original approach. I am also lacking broader context of how this requirement is implemented across various components.

One final note:

Default to TLS 1.3 minimum: That eliminates the need for the library-go crypto dependency entirely.

The library-go crypto dependency I think predates this PR, and AFAICS is a bigger change to drop.

Holding the PR until we have a final decision on this.

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 13, 2026
@sanchezl

Copy link
Copy Markdown

@liouk The model I am arguing from is operator and operand. The operator owns policy: the TLS floor, the ciphers, what is acceptable. The operand does what it is told. The point of that split is that policy lives in exactly one place.

Validation in the operand breaks that, because to validate you have to encode a second copy of the policy. When the policy changes, and it will, you now have two places to update and they can drift. The worst case is the operand rejecting a value the operator considers valid, so the component that does not own the decision is the one blocking it. The standalone/testing case actually cuts the same way: when debugging you often want to set a value the policy would normally reject.

I feel strongly that we should:

  • Accept --tls-min-version and --tls-cipher-suites and apply them, with no policy validation.
  • As a concession, set the operand default to TLS 1.3, so someone would have to go out of their way to introduce older TLS versions or ciphers. Note a default is not validation: the operator's explicit flag always overrides it, so it can never veto the operator or drift the way a validation check does. A TLS 1.3 default also gets us Go's post-quantum hybrid key exchange for free, so it is a strong floor, not a weak one.

P.S. Dropping the library-go crypto usage was never a goal of its own. It just falls out for free if the operand stops carrying its own defaults and validation, and it seemed worth grabbing while we are already in this code.

@liouk

liouk commented Aug 21, 2026

Copy link
Copy Markdown
Member

@sanchezl I'm ok with that -- I fully agree that the operator should own policy over the operand, and that enforcing policy in multiple places is fragile. However I was mainly referring to rejecting TLS versions and ciphers that are globally accepted as insecure and should never be enforced by the operator either rather than generic policy.

@coleenquadros let's go back to the original implementation, and set the default to TLS 1.3.

Per reviewer feedback, oauth-proxy is a sidecar — the deploying
operator owns TLS policy decisions. Remove all validation from
Validate(), use Go stdlib crypto/tls directly instead of library-go
for TLS config construction, and default to TLS 1.3 minimum.

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2026
@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: coleenquadros, liouk
Once this PR has been reviewed and has the lgtm label, please assign ricardomaraschini for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown

@coleenquadros: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable options for TLSCiphers, TLSCurves and TLSVersion?

5 participants