-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the default PostgreSQL sslMode to verify-full
#86
Conversation
@@ -33,7 +33,8 @@ type ProviderConfigSpec struct { | |||
// Defines the SSL mode used to set up a connection to the provided | |||
// PostgreSQL instance | |||
// +kubebuilder:validation:Enum=disable;require;verify-ca;verify-full | |||
// +optional | |||
// +kubebuilder:default=verify-full | |||
// +kubebuilder:validation:Required | |||
SSLMode string `json:"sslMode"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should set it as optional (with omit-empty) since we have a default, e.g.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @turkenh, converted it to an optional field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-nevermind-
I'd argue to follow the upstream default as it is more predictable, is there a change request upstream to change the default perhaps? |
Hi @Duologic, Please also see the note in that document reproduced here for convenience:
As mentioned in the description of the PR, while I agree aligning with the downstream default would be less controversial but I preferred the secure by default approach and chose the strictest policy. Also with many modern TLS client libraries, what's described for |
.gitignore
Outdated
@@ -2,6 +2,7 @@ | |||
/vendor | |||
/.vendor-new | |||
.vscode | |||
/.idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding this in your personal $HOME/.gitignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Makefile
Outdated
# adjust this behavior in the build submodule because it is also causing Linux | ||
# users to duplicate their build cache, but for now we just make it easier to | ||
# identify its location in CI so that we cache between builds. | ||
go.cachedir: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've incorporated this Make target in #88, do you mind rebasing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Your arguments for changing the default seem valid to me. |
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
804d674
to
67dbf91
Compare
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Hi @Duologic, |
Sorry for the delay, I didn't want to merge it while on my phone in case I missed something. |
Hi, I have |
Description of your changes
Fixes #85
This PR proposes to set the default PostgreSQL sslMode to
verify-full
. We can also consider havingspec.sslMode
ofProviderConfig.postgresql
as really optional and leave the defaults to the driver. For instance, libpq defaults toprefer
, which is not recommended for security reasons. However, for improved security, this PR proposesverify-full
as the default.I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested