-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 insecure manifest inspect with restrictive certs perms #1378
fix insecure manifest inspect with restrictive certs perms #1378
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1378 +/- ##
=========================================
- Coverage 54.88% 54.79% -0.1%
=========================================
Files 293 293
Lines 19428 19428
=========================================
- Hits 10663 10645 -18
- Misses 8089 8110 +21
+ Partials 676 673 -3 |
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.
LGTM
cli/registry/client/fetcher.go
Outdated
serviceOpts := registry.ServiceOptions{} | ||
if insecure { | ||
logrus.Debugf("allowing insecure registry for: %s", reference.Domain(namedRef)) | ||
serviceOpts.InsecureRegistries = []string{reference.Domain(namedRef)} |
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.
The name was a bit confusing, so checked if reference.Domain()
returned the port-number as well, but looks like it does 😅 👍 https://github.com/docker/distribution/blob/6170ac53daed40ebbebc9fe5f482495d01f09f12/reference/reference_test.go#L51-L55
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.
yes it does. i double-checked that b/c i had the same concern. :) thanks @thaJeztah!
ping @justincormack @silvin-lubecki ptal |
cli/registry/client/fetcher.go
Outdated
repoInfo, err := registry.ParseRepositoryInfo(namedRef) | ||
if err != nil { | ||
return nil, err | ||
} | ||
registryService, err := registry.NewService(registry.ServiceOptions{}) | ||
|
||
serviceOpts := registry.ServiceOptions{} |
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.
nit: var serviceOpts registry.ServiceOptions
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.
fixed that and re-pushed
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.
LGTM
If, for some reason, the certs directory has permissions that are inaccessible by docker, we should still be able to fetch manifests using the `insecure` flag. Since the cli doesn't access the engine's list of insecure registries, the registry client should make a singleton list of the registry being queried with the `insecure` flag. Closes docker#1358 Signed-off-by: Christy Norman <christy@linux.vnet.ibm.com>
7e84791
to
d57adbc
Compare
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.
LGTM 🐯
Thanks! |
…e-fix fix insecure manifest inspect with restrictive certs perms Signed-off-by: Lifubang <lifubang@acmcoder.com>
If, for some reason, the certs directory has permissions that are
inaccessible by docker, we should still be able to fetch manifests using
the
insecure
flag.Since the cli doesn't access the engine's list of insecure registries,
the registry client should make a singleton list of the registry being queried with the
insecure
flag.Closes #1358
Signed-off-by: Christy Norman christy@linux.vnet.ibm.com