-
Notifications
You must be signed in to change notification settings - Fork 462
Enabling mTLS between kraken services #390
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
Changes from all commits
65b9428
03c3aa5
31184e9
532a99a
782bf6c
4e9097d
bf86006
dc4fda0
a8654df
1f56a42
48de62c
ea21c12
d2dec56
8971b8e
1ead1d8
38a48a7
b8c49cc
f32eff9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |||
| // you may not use this file except in compliance with the License. | ||||
| // You may obtain a copy of the License at | ||||
| // | ||||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||||
| // | ||||
| // Unless required by applicable law or agreed to in writing, software | ||||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||||
|
|
@@ -48,7 +48,7 @@ func New(addr string) *HTTPClient { | |||
| // GetTag resolves tag into a digest. Returns ErrTagNotFound if the tag does | ||||
| // not exist. | ||||
| func (c *HTTPClient) GetTag(tag string) (core.Digest, error) { | ||||
| resp, err := httputil.Get(fmt.Sprintf("http://%s/tags/%s", c.addr, url.PathEscape(tag))) | ||||
| resp, err := httputil.Get(fmt.Sprintf("https://%s/tags/%s", c.addr, url.PathEscape(tag))) | ||||
| if err != nil { | ||||
| if httputil.IsNotFound(err) { | ||||
| return core.Digest{}, ErrTagNotFound | ||||
|
|
@@ -72,7 +72,7 @@ func (c *HTTPClient) GetTag(tag string) (core.Digest, error) { | |||
| func (c *HTTPClient) Download(namespace string, d core.Digest) (io.ReadCloser, error) { | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't blob downloads from Agents be unauthenticated ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why they should? I thought that we should encrypt all the traffic, isn't it?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All traffic should be authenticated and encrypted. The only exception is that requests from localhost should not be required to authenticate themselves, i.e. only TLS will be enforced instead of mTLS. However, I wonder if hardcoding the HTTP/HTTPS protocol like this makes sense. I'm not sure about this but I believe Kraken supports falling back to HTTP if https doesn't work and people outside of Uber might use this feature. This means that if we hardcode the HTTPS protocol, the new version might not work for them. kraken/utils/httputil/httputil.go Line 317 in cfcda81
|
||||
| resp, err := httputil.Get( | ||||
| fmt.Sprintf( | ||||
| "http://%s/namespace/%s/blobs/%s", | ||||
| "https://%s/namespace/%s/blobs/%s", | ||||
| c.addr, url.PathEscape(namespace), d)) | ||||
| if err != nil { | ||||
| return nil, err | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
|
|
@@ -31,12 +31,6 @@ var _nameToDefaultTemplate = map[string]string{ | |
| const DefaultClientVerification = ` | ||
| ssl_verify_client optional; | ||
| set $required_verified_client 1; | ||
| if ($scheme = http) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned it would be better if we can drive it via config.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the benefits of using config for this? The only benefit I see is if someone wants to use Kraken with HTTP instead of HTTPS. But I believe we should discuss internally whether we want to support HTTP communication for the future. We've already partially discussed this here: #379 |
||
| set $required_verified_client 0; | ||
| } | ||
| if ($request_method ~ ^(GET|HEAD)$) { | ||
| set $required_verified_client 0; | ||
| } | ||
| if ($remote_addr = "127.0.0.1") { | ||
| set $required_verified_client 0; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have many hardcoded http requests in the code (search for
http://in the codebase). Why do we need to change this one to https and not the others?