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

Support specifying cipher suites in tls connection #3019

Closed
jannyHou opened this issue May 20, 2021 · 14 comments
Closed

Support specifying cipher suites in tls connection #3019

jannyHou opened this issue May 20, 2021 · 14 comments
Assignees
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@jannyHou
Copy link

jannyHou commented May 20, 2021

Requirement - what kind of business use case are you trying to solve?

Hello team, in PR #2798 the tls connection is enabled in collector, it would be good to support configuring cipher for it.

It would be similar to the fluentd tls settings in https://docs.fluentd.org/configuration/transport-section#tls-setting, you can config the ciphers field.

Problem - what in Jaeger blocks you from solving the requirement?

Currently people could not configure the ciphers field.

Proposal - what do you suggest to solve the problem or improve the existing situation?

Same as the requirement

Any open questions to address

n/a

@yurishkuro yurishkuro added help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels May 20, 2021
@clock21am
Copy link
Contributor

@yurishkuro can I take this?

@yurishkuro
Copy link
Member

It's yours

clock21am pushed a commit to clock21am/jaeger that referenced this issue May 23, 2021
…#3019

Signed-off-by: Rajdeep Kaur <rajdeep51994@gmail.com>
clock21am pushed a commit to clock21am/jaeger that referenced this issue May 23, 2021
…#3019

Signed-off-by: Rajdeep Kaur <rajdeep51994@gmail.com>
clock21am pushed a commit to clock21am/jaeger that referenced this issue May 23, 2021
…#3019

Signed-off-by: Rajdeep Kaur <rajdeep51994@gmail.com>
@yurishkuro
Copy link
Member

I wasn't too familiar with cipher suites, but now that I read about them, I am questioning why we need this.

  1. The documentation says that they are only supported up to TLS 1.2, phased out in TLS 1.3. The default behavior is to use whichever ciphers the server supports.

  2. I don't see an established format of describing the cipher family. The Go struct uses an array of uint16's, Fluentd doesn't describe the format but gives a weird example "ALL:!aNULL:!eNULL:!SSLv2", other sources show strings like "ECDHE-ECDSA-AES256-GCM-SHA384"

@Ashmita152
Copy link
Contributor

why we need this

In my understanding, some organisations fulfil certain compliances (especially fintech regulated by operating country's law) that have strict requirements that all SSL communication should happen only within certain ciphers. In those cases, this option will be quite useful to specify as a config param.

@clock21am
Copy link
Contributor

make sense @Ashmita152

@jpkrohling
Copy link
Contributor

@yurishkuro, the server provides a list of ciphers to clients, and cipher negotiation happens. The key is to strike a balance between modern features and old clients. For instance, there might be older Java clients supporting TLS 1.1 only. Your example of Fluentd is basically filtering out classes of ciphers, while the last example is an example of a concrete cipher that would be part of a class. They should both be compatible.

Allowing the configuration of ciphers would allow admins to adjust the balance I mentioned before: if they are sure all their applications are capable of using modern ciphers, they can remove older, less safe ones. This way, a man-in-the-middle would have a harder time performing a downgrade attack.

@jpkrohling
Copy link
Contributor

jpkrohling commented May 25, 2021

They should both be compatible.

I'll take this back. Looking at how Go implemented the Cipher suites, not sure this notation actually works and would be interested in knowing how fluentd did it.

Edit: not my best day :-) Fluentd isn't in Go...

@clock21am
Copy link
Contributor

@jpkrohling @yurishkuro what do you think we should do then?

@jpkrohling
Copy link
Contributor

I would prefer to have the OpenSSL format, which is what fluentd seems to be using. But if there aren't good libraries that parse OpenSSL format into a set of cipher suites understood by Go, I would prefer to see what other projects are doing in this matter.

@clock21am
Copy link
Contributor

let me check and get back to you then

@sirzooro
Copy link

+1 for this. Also allow configuration of minimum TLS version - standards which require use of selected ciphers considered as safe also require use of some TLS version, e.g. 1.2+.

@yurishkuro
Copy link
Member

After a bit more digging:

func CipherSuitesFromNames(names []string) ([]uint16, error) {
	suites := tls.CipherSuites()
	var out []uint16
	for _, name := range names {
		found := false
		for _, suite := range suites {
			if suite.Name == name {
				out = append(out, suite.ID)
				found = true
				break
			}
		}
		if !found {
			return nil, fmt.Errorf("cipher '%v' is not suppored by crypto/tls, see https://pkg.go.dev/crypto/tls#pkg-constants", name)
		}
	}
	return out, nil
}

@tejaswiniVadlamudi
Copy link

+1 for this. Also allow configuration of minimum TLS version - standards which require use of selected ciphers considered as safe also require use of some TLS version, e.g. 1.2+.

+1 to @sirzooro, good to have config options for TLS versions together with cipher selection

@yurishkuro
Copy link
Member

Seems this is now resolved by #3564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
Development

No branches or pull requests

7 participants