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

TLS: make cipher suite list and min version configurable #2898

Merged
merged 2 commits into from Oct 17, 2022

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Sep 6, 2022

What this PR does

Allows the admin to configure the list of ciphers supported by Mimir services, and/or the minimum TLS version.

This is revisiting the change rejected in #2309 (comment) on the basis that the documentation was user-hostile.

In this version, the cipher suite list is configured as a single string, patterned after the similar Kubernetes option.

Cipher names are as used by Go, at https://pkg.go.dev/crypto/tls#pkg-constants.

Updates weaveworks/common and prometheus/exporter-toolkit libraries.
NOTE the weaveworks/common PR is not merged yet; I wanted to get consensus on this change before doing that.

I didn't add a test specifically for these changes in Mimir; weaveworks/common unit tests check the basic name-decoding functionality.

Documentation change here is pretty minimal; in particular we should link to the list of cipher names.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated

@osg-grafana osg-grafana added the type/docs Improvements or additions to documentation label Sep 7, 2022
cmd/mimir/help.txt.tmpl Outdated Show resolved Hide resolved
cmd/mimir/help.txt.tmpl Outdated Show resolved Hide resolved
@osg-grafana
Copy link
Contributor

osg-grafana commented Sep 7, 2022

Documentation change here is pretty minimal; in particular we should link to the list of cipher names.

Please do so. :)

@bboreham
Copy link
Contributor Author

bboreham commented Sep 7, 2022

Documentation change here is pretty minimal; in particular we should link to the list of cipher names.

Please do so. :)

Where? The docs in this PR are auto-generated from short descriptions in the code; there isn't really room to put a lengthy explanation in.

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, except I'm wondering if these parameters should be advanced. Also wondering if the new parameters should be better documented, as @pstibrany also commented on.

@pstibrany
Copy link
Member

What do you think about including version strings and cipher suite names in the help string directly, similar to grafana/dskit#217?

@pracucci
Copy link
Collaborator

What do you think about including version strings and cipher suite names in the help string directly, similar to grafana/dskit#217?

Should we also mention the new options in docs/sources/operators-guide/secure/securing-communications-with-tls.md?

@bboreham
Copy link
Contributor Author

What do you think about including version strings and cipher suite names in the help string directly, similar to grafana/dskit#217?

That list of strings seems way too long for help text, to me.

@pstibrany
Copy link
Member

What do you think about including version strings and cipher suite names in the help string directly, similar to grafana/dskit#217?

That list of strings seems way too long for help text, to me.

In Mimir we can extract it to a single doc block so that it doesn't repeat. Would that help? (I agree it's a bit long, and this is quite low-level option, so not many people will need it.)

@bboreham
Copy link
Contributor Author

In Mimir we can extract it to a single doc block

It was more printing it out from mimir --help where I didn't want a page for one option.

Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Happy with it! A couple of questions before merging:

  1. Could you mention the new CLI flags in docs/sources/operators-guide/secure/securing-communications-with-tls.md under the section "Server flags" (there's a list of CLI flags supported)?
  2. Now that we have support for doc:"description_method=XXX" as struct tag, would you consider adding the full description of supported ciphers as we did in Adding min version and cipher suite variables to tls client configuration dskit#217?

@pracucci
Copy link
Collaborator

pracucci commented Oct 7, 2022

The CHANGELOG has just been cut to prepare for the next Mimir release. Please rebase main and eventually move the CHANGELOG entry added / updated in this PR to the top of the CHANGELOG document. Thanks!

@bboreham
Copy link
Contributor Author

would you consider adding the full description of supported ciphers

Did you mean I should add this upstream in weaveworks/common/server, or add a Mimir struct that will hold the parameters and tag and pass the values to the upstream package?

@pracucci
Copy link
Collaborator

would you consider adding the full description of supported ciphers

Did you mean I should add this upstream in weaveworks/common/server, or add a Mimir struct that will hold the parameters and tag and pass the values to the upstream package?

I was wondering if you were willing to add it in upstream, but it's not a blocker to me.

Note the cipher suite list is configured as a single string, more like
Kubernetes than Prometheus.

Updates weaveworks/common and prometheus/exporter-toolkit libraries.

Fix up reference docs too.
@bboreham
Copy link
Contributor Author

I added to docs as you suggested, and changed CHANGELOG.
The upstream change I left till later.

@pracucci pracucci merged commit ef7849c into main Oct 17, 2022
@pracucci pracucci deleted the tls-cipher-suites branch October 17, 2022 06:51
@@ -5,6 +5,7 @@
### Grafana Mimir

* [CHANGE] Flag `-azure.msi-resource` is now ignored, and will be removed in Mimir 2.7. This setting is now made automatically by Azure. #2682
* [ENHANCEMENT] Added `<prefix>.tls-min-version` and `<prefix>.tls-cipher-suites` flags to configure cipher suites and min TLS version supported by servers. #2898
Copy link
Member

Choose a reason for hiding this comment

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

What prefixes are available? Diff in help file shows only "server", nothing else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. This may be a confusion with the client-side flags.

Copy link
Member

Choose a reason for hiding this comment

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

PR to clarify this: #3370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/notified-changelog-cut type/docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants