fix(security): remove Disabled TLS gateway mode to prevent plaintex#357
Draft
hossain-rayhan wants to merge 1 commit intodocumentdb:mainfrom
Draft
fix(security): remove Disabled TLS gateway mode to prevent plaintex#357hossain-rayhan wants to merge 1 commit intodocumentdb:mainfrom
hossain-rayhan wants to merge 1 commit intodocumentdb:mainfrom
Conversation
…traffic Remove `spec.tls.gateway.mode: Disabled` option which served plaintext Mongo wire protocol, contradicting docs that stated TLS was always active. - Remove Disabled from GatewayTLS.Mode enum validation - Default empty/unset mode to SelfSigned for automatic TLS - Update certificate controller to treat empty mode as SelfSigned - Add unit tests for empty mode defaulting and Disabled rejection - Update documentation to remove Disabled mode references - Regenerate CRDs with updated enum BREAKING CHANGE: Users with `mode: Disabled` must remove this setting or set `mode: SelfSigned`. The gateway will use cert-manager generated self-signed certificates automatically. Fixes documentdb#356 Signed-off-by: Rayhan Hossain <rhossain@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
spec.tls.gateway.mode: Disabledoption to eliminate the security risk of plaintext Mongo wire protocol traffic.Problem
The
DisabledTLS mode caused the DocumentDB gateway to serve connections in plaintext, while documentation incorrectly stated that "the gateway still encrypts all connections using an internally generated self-signed certificate." This created a silent security vulnerability where:status.connectionStringcontainedtls=trueregardless of actual TLS stateSee issue #356 for full details.
Solution
Option A from the issue — remove unencrypted traffic as a possibility:
Disabledfrom theGatewayTLS.Modeenum →Enum=SelfSigned;CertManager;ProvidedSelfSignedso existing CRs keep working with encryptionChanges
api/preview/documentdb_types.goDisabledfrom enum, addSelfSigneddefaultinternal/controller/certificate_controller.gointernal/controller/certificate_controller_test.godocs/.../tls.mddocs/.../connecting-to-documentdb.mdDisabledrow from tabledocs/.../api-reference.mdCHANGELOG.mdmake manifests generateBreaking Change
Users with
mode: Disabledmust update their manifests:modefield entirely (defaults toSelfSigned)mode: SelfSignedThe gateway will automatically use a cert-manager generated self-signed certificate.
Testing
go test ./internal/controller/... -run "TestEmptyModeDefaultsToSelfSigned|TestDisabledModeNotSupported"[SelfSigned, CertManager, Provided]Disabledreferences remain in documentationVerification
Fixes #356