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(tls): Update TLS strict cipher suite to actually work #20921

Merged
merged 12 commits into from
Mar 16, 2021

Conversation

danxmoran
Copy link
Contributor

@danxmoran danxmoran commented Mar 10, 2021

Closes #20762

The cipher suite we had hard-coded was invalid, and would cause the influxd process to hang on startup. The user who reported the problem referenced a Mozilla page that showed the proper suite to use, so I swapped to using it. I also fixed the code so a failure to serve HTTP/HTTPS will cause influxd to exit instead of hang.

I've added a regression suite to check that enabling TLS works at all. Hopefully that'll catch problems like this in the future...

@@ -616,10 +619,6 @@ func (m *Launcher) run(ctx context.Context, opts *InfluxdOpts) (err error) {
log.Info("Stopping")
}(m.log)

m.httpServer = &nethttp.Server{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took the opportunity to factor some code out of the huge run method here.

@danxmoran danxmoran force-pushed the dm-tls-strict-ciphers-20762 branch 2 times, most recently from a3b6948 to a2f8ae4 Compare March 15, 2021 19:14
@lesam lesam self-requested a review March 16, 2021 13:24
}
tlsMinVersion = tls.VersionTLS13
default:
return fmt.Errorf("unsupported TLS version: %s", opts.HttpTLSMinVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

if tlsMinVersion != tls.VersionTLS13 && opts.HttpTLSStrictCiphers {
cipherConfig = strictCiphers
var tlsMinVersion uint16
var useStrictCiphers = opts.HttpTLSStrictCiphers
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this / should this default true for 1.2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It currently defaults to false for all versions (maybe because setting it to true made everything break). I'm wary of changing the default at this point since I don't know what impact to expect on existing users, but if somebody from product / somebody with more TLS knowledge gave the 👍 then I'd be ok with it. Would want to remove the Warn log in the 1.3 case to avoid noise.


return nil
}

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 for function break

Copy link
Contributor

@lesam lesam left a comment

Choose a reason for hiding this comment

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

Couple questions - see comments

@danxmoran
Copy link
Contributor Author

Self review: it looks like the description of the strict-cipher flag hard-codes the accepted cipher list. Will need to update that.

gwossum added a commit to influxdata/docs-v2 that referenced this pull request Jan 25, 2024
Update cipher suite list when `tls-strict-ciphers` is enabled to match changes made in influxdata/influxdb#20921
sanderson pushed a commit to influxdata/docs-v2 that referenced this pull request Jan 26, 2024
Update cipher suite list when `tls-strict-ciphers` is enabled to match changes made in influxdata/influxdb#20921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tls-strict-ciphers causes https service failure
3 participants