fix(common/redis): stop unconditionally skipping TLS certificate verification#4261
fix(common/redis): stop unconditionally skipping TLS certificate verification#4261
Conversation
…fication Previously, `enableTLS` was passed directly to `InsecureSkipVerify`, meaning enabling TLS always disabled certificate verification, a security vulnerability. This adds a separate `insecureSkipTLSVerify` metadata field (defaulting to false) so that TLS connections now perform proper certificate verification by default. Signed-off-by: joshvanl <me@joshvanl.dev>
There was a problem hiding this comment.
Pull request overview
This PR fixes a security vulnerability in the Dapr Redis component where enabling TLS (enableTLS: true) was unconditionally passing true to tls.Config.InsecureSkipVerify, disabling certificate verification entirely. The fix adds a separate insecureSkipTLSVerify metadata field (defaulting to false) so that TLS connections now use proper certificate verification by default.
Changes:
- Adds
InsecureSkipTLSVerify boolfield to the sharedSettingsstruct and wires it totls.Config.InsecureSkipVerifyin all six TLS configuration sites across both the v8 and v9 Redis clients - Adds
insecureSkipTLSVerifymetadata field (withdefault: "false") to all five Redis component metadata YAML files (state,pubsub,bindings,configuration,lock)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
common/component/redis/settings.go |
Adds InsecureSkipTLSVerify field to Settings struct with corrected EnableTLS comment |
common/component/redis/v8client.go |
Replaces s.EnableTLS with s.InsecureSkipTLSVerify in all three TLS config sites |
common/component/redis/v9client.go |
Replaces s.EnableTLS with s.InsecureSkipTLSVerify in all three TLS config sites |
state/redis/metadata.yaml |
Adds insecureSkipTLSVerify metadata field |
pubsub/redis/metadata.yaml |
Adds insecureSkipTLSVerify metadata field |
bindings/redis/metadata.yaml |
Adds insecureSkipTLSVerify metadata field |
configuration/redis/metadata.yaml |
Adds insecureSkipTLSVerify metadata field; fixes trailing whitespace in enableTLS description |
lock/redis/metadata.yaml |
Adds insecureSkipTLSVerify metadata field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Based on dapr/components-contrib#4261 Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
cicoyle
left a comment
There was a problem hiding this comment.
lgtm, did you open a docs PR for the metadata change?
|
@cicoyle yep! dapr/docs#5065 |
Previously,
enableTLSwas passed directly toInsecureSkipVerify, meaning enabling TLS always disabled certificate verification, a security vulnerability. This adds a separateinsecureSkipTLSVerifymetadata field (defaulting to false) so that TLS connections now perform proper certificate verification by default.