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

Add client TLS auth to gRPC reporter #1591

Merged
merged 2 commits into from
Jul 19, 2019

Conversation

tcolgate
Copy link
Contributor

@tcolgate tcolgate commented Jun 7, 2019

No description provided.

@tcolgate
Copy link
Contributor Author

tcolgate commented Jun 7, 2019

The option names in the agent probably aren't optimal. Need docs too I guess.

@yurishkuro
Copy link
Member

Is it possible to add tests? I think we already have tests for TLS & certificates in other parts of the code

@tcolgate
Copy link
Contributor Author

yep, the existing tests should make this reasonably easy I think, I'll get started. I'll need to update the docs too.

@codecov
Copy link

codecov bot commented Jun 17, 2019

Codecov Report

Merging #1591 into master will decrease coverage by 0.22%.
The diff coverage is 61.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1591      +/-   ##
==========================================
- Coverage   98.71%   98.49%   -0.23%     
==========================================
  Files         193      193              
  Lines        9243     9284      +41     
==========================================
+ Hits         9124     9144      +20     
- Misses         91      111      +20     
- Partials       28       29       +1
Impacted Files Coverage Δ
cmd/collector/app/grpcserver/grpc_server.go 52.5% <0%> (-47.5%) ⬇️
cmd/agent/app/reporter/grpc/flags.go 100% <100%> (ø) ⬆️
cmd/collector/app/builder/builder_flags.go 100% <100%> (ø) ⬆️
cmd/agent/app/reporter/grpc/builder.go 96.55% <90.9%> (-3.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3ee676...33fba12. Read the comment docs.

@tcolgate
Copy link
Contributor Author

@yurishkuro added tests that check the various combinations of agent/client TLS misconfiguration

@tcolgate tcolgate force-pushed the tlsclientauth branch 3 times, most recently from 09ff05f to 6afc5d4 Compare June 17, 2019 10:16
@tcolgate
Copy link
Contributor Author

I'm not sure why the CI tests failed there, I don't think it's related to my PR.

@tcolgate
Copy link
Contributor Author

@yurishkuro any more thoughts on this PR?

@freeformz
Copy link

Why not take an optional tls.Config when tls configuration is required?

@tcolgate
Copy link
Contributor Author

Why not take an optional tls.Config when tls configuration is required?

@freeformz I'm not sure what you are suggesting, do you mean have a tls.Config in a user configurable config object? (I don't think that could work, most of that type is not configurable by literals, and none of the fields have the appropirate annotations).

@@ -39,6 +41,8 @@ func AddFlags(flags *flag.FlagSet) {
flags.Bool(collectorTLS, false, "Enable TLS.")
flags.String(collectorTLSCA, "", "Path to a TLS CA file. (default use the systems truststore)")
flags.String(collectorTLSServerName, "", "Override the TLS server name.")
flags.String(agentCert, "", "Path to a TLS client certificate file.")
flags.String(agentKey, "", "Path to a TLS client key file.")
Copy link
Member

Choose a reason for hiding this comment

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

Could you please expand the flag descriptions (starting from --tls) to explain in more details what they enable? For example, what collectorTLS means after this PR, etc. Pretend someone is reading https://www.jaegertracing.io/docs/1.13/cli/#jaeger-collector-cassandra, is there enough information to understand what's going to happen with various combinations of the flags?

cmd/collector/app/builder/builder_flags.go Show resolved Hide resolved
opts.CollectorGRPCKey,
)

tlsCfg := &tls.Config{
Copy link
Member

Choose a reason for hiding this comment

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

this code should not be in main, but somewhere in the server factory, maybe similar to grpcserver.StartGRPCCollector() function. Right now it appears that similar code is repeated in the unit tests. Can you move it to grpcserver and reuse in unit tests so that it's also tested? We can't really test main()

@tcolgate
Copy link
Contributor Author

tcolgate commented Jul 16, 2019

@yurishkuro rebased, squashed, updated args, and moved the TLS setup.
(Also, I removed the full-stop on the flags to make them consistant with other flag descriptions)

@tcolgate tcolgate force-pushed the tlsclientauth branch 2 times, most recently from f73750e to cfc2a8e Compare July 16, 2019 08:43
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Thanks for updating flag descriptions, they read much better now!

Just a few minor corrections, lgtm otherwise.

cmd/collector/app/builder/builder_flags.go Outdated Show resolved Hide resolved
cmd/collector/app/builder/builder_flags.go Outdated Show resolved Hide resolved
cmd/collector/app/builder/builder_flags.go Outdated Show resolved Hide resolved
Signed-off-by: Tristan Colgate <tristan@qubit.com>
@tcolgate
Copy link
Contributor Author

tcolgate commented Jul 17, 2019

@yurishkuro pushed fixes

@yurishkuro yurishkuro merged commit 428cc1a into jaegertracing:master Jul 19, 2019
@pavolloffay pavolloffay changed the title Add optional client TLS auth Add optional client TLS auth to gRPC reporter Sep 2, 2019
@pavolloffay pavolloffay changed the title Add optional client TLS auth to gRPC reporter Add client TLS auth to gRPC reporter Sep 2, 2019
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.

3 participants