Skip to content
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

fix(dgraph): giving users the option to control tls versions #6820

Merged
merged 5 commits into from
Nov 17, 2020

Conversation

aman-bansal
Copy link
Contributor

@aman-bansal aman-bansal commented Nov 2, 2020

Fixes DGRAPH-2469 for patch release 20.07.
Currently Dgraph supports both tls v1.1 and tls v1.2 which introduces security concerns. This PR limits the min version to v1.2 and also enables only selected cipher suites which are more secure.


This change is Reviewable

Docs Preview: Dgraph Preview

Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

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

:lgtm: Do add these to Zero too.

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain and @vvbalaji-dgraph)

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

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

1 issues found. 4 rules errored during the review.

@@ -99,7 +114,7 @@ func LoadClientTLSConfigForInternalPort(v *viper.Viper) (*tls.Config, error) {
}

// LoadServerTLSConfigForInternalPort loads the TLS config for the internal ports of the cluster
func LoadServerTLSConfigForInternalPort(tlsEnabled bool, tlsDir string) (*tls.Config, error) {
func LoadServerTLSConfigForInternalPort(tlsEnabled bool, tlsDir, tlsMinVersion string) (*tls.Config, error) {
Copy link

Choose a reason for hiding this comment

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

Boolean arguments can indicate low cohesion. Consider refactoring LoadServerTLSConfigForInternalPort by using a separate function for each case and helper functions for repeated code. This will make each function clearer and more modular, leading to easier maintainability.

View Rule

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

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

1 issues found. 4 rules errored during the review.

x/tls_helper.go Outdated
MinVersion string
}

// RegisterClientTLSFlags registers the required flags to set up a TLS client.
Copy link

Choose a reason for hiding this comment

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

Every exported function in a program should have a doc comment. The first sentence should be a summary that starts with the name (RegisterServerTLSFlags) being declared.
From effective go.

View Rule

@aman-bansal aman-bansal merged commit ab14ed8 into release/v20.07 Nov 17, 2020
@aman-bansal aman-bansal deleted the aman/tls_version_flags branch December 15, 2020 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants