Repository navigation
Conversation
There was a problem hiding this comment.
I read the api.md file but I don't know what a "docker-scope" means here.
There was a problem hiding this comment.
"docker-scope" is basically the namespace prefix. A preamble should be added to the introduction outlining this concept.
There was a problem hiding this comment.
The intent of the scope is to inform a discovery client as to what namespaces this metadata may apply to. Caching may be undesirable but the idea here is to leave that up to client. In this case the same metadata should be returned for any image named "registry.example.com/*".
There was a problem hiding this comment.
The trouble with doing this is that unlike HTTPS you can't trust anything coming over DNS. So, you don't know if the data you are getting has been modified via man-in-the-middle. This is one of the reasons we keep going back and forth on that feature on the App Container spec: appc/spec#3
There was a problem hiding this comment.
This portion of the specification needs a clarification in that these are examples of possible discovery protocols, rather than the one-true-discovery-protocol. Yes, you can't trust anything coming over DNS, but there may be a scheme that could use signed TXT entries or could leverage DNSSEC. A pluggable discovery system should not prevent this, even if it could be terribly insecure.
There was a problem hiding this comment.
Thanks for linking to that conversation, agreed the same problems apply here. If we cannot support DNS securely, it will not be supported. It is intentionally missing details now so we can discuss how this may support securely.
|
cc @bfirsh |
14762c1 to
984a512
Compare
There was a problem hiding this comment.
If scopes are intended to be a guarantee on all namespaces matching the prefix I'd want to tighten up the language; "will apply" vs "may apply". If scopes aren't a guarantee then they seem to lose a lot of value.
|
Defining a grammar is the best combination of legibility and strong definition. The grammar defined may be useful for the discovery protocol, however it doesn't change the definition of the canonical name. A discovery protocol must support name definition. @stevvooe you are right we should add port to the definition since that is what is currently supported and SRV records should not be required. |
Includes description of namespace, discovery process, registry metadata, and trust models. Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
984a512 to
89cba17
Compare
|
Added ports to hostname definition. @stevvooe if the grammar definition looks too much like a URI, what would be a better way to name the components. DNS name + path does sound like a URL. Essentially we have a domain and a domain specific repository name as part of the canonical name, perhaps refer to it as domain + repository name? Other suggestion was adding canonicalization rules which would specify when a repository domain is omitted, the default domain must be used. |
|
@dmcgowan I was thinking something along these lines for the grammar (sorry, this is more peggish): Then limit the namespace production to 255 characters or less (not sure how to represent that in the grammar. This is effectively what we have elsewhere. Edit: I added this to the validation documentation for names in #212. |
There was a problem hiding this comment.
"The total length of a name is 255..." should be "The maximum length of a name is 255..."? This may also be worth clarifying with an example:
The canonical repository name `example.com/foo/bar` is 19 bytes long. The host
name `example.com` is 11 bytes long, leaving up to 244 bytes available for the
path component of the name, including a leading `/` path separator character.
|
Just some thoughts I had over the weekend: Taking the example "example.com/foo/bar", "example.com" really identifies the registry, while "/foo/bar" identifies the repository. "example.com" might be a mirror, or it might be a unique repository. Would it make sense to divide up the concepts such that a user can add a registry identifier locally, and make it responsible for some repositories? In that scenario, the problem of having a global namespace is reduced to a problem of making a user responsible for managing the registries they use, and what repositories are owned by those registries. There is no longer an issue if "foobar.com/foo/bar" also publishes a conflicting "/foo/bar" repository because the user must add "foobar.com" and identify it as the owner of "/foo/bar" This would also fold into package signing well. For any registry the user wishes to add, the user must either identify it as insecure, or add the cert for that registry. I'd envision a command something like: |
|
@endophage We need to be a little careful here: the DNS name at the start of a namespace is not the location of the registry. The DNS name at the start of namespace corresponds to the scope of the image names. That DNS name may be used to discover the registry, in turn. This is a key distinction to avoid confusing UX, such the current state of docker cli or the suggested command. However, following from your example, I do see the idea of being able to configure remotes to be a good one. For example, something similar to git might work really well: This would be the CLI portion of the configurable discovery system. Want to know which remotes a docker daemon would pull from: Let's play with this idea. |
There was a problem hiding this comment.
Let's add a table enumerating the resulting components of discovery. It includes the following:
- registry
- index (search)
- trust system
- ?
This should be an explicit part of this specification.
There was a problem hiding this comment.
That seems reasonable. Although the word "registry" seems ambiguous in this use case. Is the result of discovery a registry instance (as in the Go interface) or a registry configuration. The difference being whether we want to consider each endpoint itself a registry, and the resulting registry may be a collection of registries or have the registry contain a configuration with api server endpoints.
There was a problem hiding this comment.
@dmcgowan Understood. Let's find a word more specific than "endpoint" and less abstract than "registry". Perhaps, we may need to shuffle some nomenclature to make this work.
|
It seems like currently we're making the DNS name do double duty, both as a unique global identifier and the location, at least that's what I understand so far. I don't know that it has been explicitly stated anywhere, but it seems like that would be the result of a concrete implementation. If there already is some idea on separating the namespace from the location information, we should call it out more explicitly. Being able to configure remotes I see as a way to separate the concerns of location and namespace. I'm not picky on the syntax, Additionally, I see a benefit of separating the location information out in allowing us to specify a scheme to more easily support non-http registries. If our registry.example.com location supported ftp and torrents, a user might run (of course we could also have scheme take multiple arguments): |
|
@dmcgowan Let's add a canonicalization section to this proposal. We need to answer the following questions (with straw man answers):
These canonicalizations would not be permanent but really would provide a plan to migrate from simple names to long names. |
|
Scratch my suggestions. I hadn't fully internalized the discovery portion of this proposal. |
|
@stevvooe Can you walk us through the approach where an organisation has multiple registries, and wants to move a deliverable through them? Currently in Docker the coupling of name and transport/registry makes this very difficult. We often have these layers. Developers can push to untrusted, Production systems or end subscribers can only fetch from trusted. Someone in the middle has to So my teams want to build an image Can I actually do that under this namespace proposal, without having to add what feels like superflous tags to the front of everything (ignoring the promotion step, that logic is obviously out of scope) |
|
@wyaeld We are separating names and locations. This is the entire point of namespaces and discovery. It is also the goal of the new distribution system. The confusion here may be that they look like urls, which is a convenience. The name is designed to provide a clue, but it doesn't affix the ultimate location. This makes simple cases easy and hard cases possible. We may be able to better explain the concept in terms of the straw man cli syntax. For this example, let's say we have the roles of "developers", "promoters" and "production". The "developers" can pull from "production" and pull/push from "untrusted" as a policy. The "developers" docker instance would be configured as follows: This would allow the developers to push and pull to namespace The "promoters" docker instances would be configured to pull from "developers" and push to the production registry: This would allow the instances to pull from the "developers" created image, run some tests, and maybe run as a staging instance. When it's deemed ready, they can then push the image to the other configured repository. This example is roughly the model of git with the ability to manage multiple repositories by namespace. In the same vein of git, to support various distribution models, breaking out of this model should be possible: The main difference is that the name of the remote can be a part of the "branch" (or image name). While this thought exercise does work, using the location (registry) to manage promotion state may not the best idea. This is really what tags (at least the future of them) are for. The registry (the new one) is really designed as a system to move data around. The state of the data should be the responsibility of tags and the trust system. It provides the right model and much better guarantees. I hope this clarifies things. |
|
Thanks, great clarification, and addresses what we are after. tags alone aren't sufficient for the use-cases of the top-end of security conscious customers, they sometimes want it to be impossible to move untrusted/unaudited artifacts into secure environments. Promotion state will typically be managed by an external system which is very workflowish, but handles automatically pulling from would this work under your model? (shorthand form similar to git remotes) |
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
|
I think we should settle on and codify in this proposal, the git-inspired syntax of We should also aim for more consistency than Git and standardize that the local registry name is always separated by a space from a repository:tag. In some cases (fetching/pulling) git uses a / and in others (pushing) it uses a space and it's ridiculously frustrating when you're first learning git and keep using the wrong syntax for a given command. Allowing a user to manage their local namespace this way makes the problem of a globally unique namespace a moot point, because everyone's view of the world will be different and it's up to them to decide what they want it to look like. If we can equate it to the Git model, we can leverage existing user knowledge to make it simple to learn. |
|
We may want to add something codifying these particular goals:
These kind of define the namespace problem and the handoff point to the trust system. |
This is something that can't be enforced (and why should it be?). An image can have zero or more names, there's no way to limit it to one unless the name is the cryptographic digest of the image.
What does this mean? |
|
@titanous Sorry if these came out a little silly. These goals are more high-level than anything. They are meant to frame the concept of namespaces and the problems this proposal is meant to solve. These are not rules.
Just because it's unenforceable doesn't mean it can't be stated as a goal. No, it cannot be enforced under varying definitions of global. Meeting that goal might be to restrict the definition of "global" to a trust domain.
Simply that the target of a name can be verified. This is almost tautological but the idea is that the name is both human-readable and verifiable (perhaps, that should be a goal...). There are names that are human-readable but not cryptographically verifiable. A possible response to such a goal might include casing rules or restrict the character set used. |
|
@stevvooe what problem is the single name concept try to solve? A single SHA in git is verifiable, but might be named HEAD, origin/master, myapp:1.0 etc all at the same time. I feel like names are transient. The resolution of a name is determined by what git providers (or registries in this case) I choose to include in my worldview. |
There was a problem hiding this comment.
I suspect you're more interested in a "domain name" than a "host name". Cloud Foo Inc. would probably publish their images with namespace cloudfoo.io, which is not the name of a host. It is merely the name of a domain. I suggest using the phrase "domain name" instead of "DNS host name". If you want to be more specific, you could reference RFC 1034.
There was a problem hiding this comment.
Reading further, I see that you also want to include a port, which is not part of a domain or host name. :) Perhaps "domain name and port" or "fully qualified domain name and port" would be more accurate?
There was a problem hiding this comment.
@dmcgowan We may want to reconsider the addition of ports, in light of some of the recent discussion on discovery.
There was a problem hiding this comment.
it would be nice if the 'default' registry deployment was targeted at port 443, with a cert, and reverse proxy (if required). Then just give instructions to cut out those parts if people don't want them.
I doubt anyone actually wants to run their registry publicly on http/5000. Its done because for a long time, there wasn't a documented solution to do it properly.
Secure by default is a thing
|
@wyaeld Everything your saying is completely accurate. We are already bringing git-like hashes to refer to images, with moby/moby#11109. Now, we need to balance that approach with a sane naming scheme, hence the goal. For this goal, however, I am not sure git is the right analogy. Images are not branches. A more apt analogy is the domain name system. The physical location of "docker.com" or "github.com" may change, via DNS, but one can confirm that the update is accurate via a certificate. Remember, these are just goals and not binding technical requirements. They frame the discussion and provide a base for the actual requirements. |
|
@vladimir-v-diaz As long as the user/repo delegation is optional, I think the non-Docker Hub TUF use case can be exactly the same. The client will have an entry in its trust store mapping a repo URL to root key(s), I don't think there's any reason to special case it. |
|
@titanous @endophage @JustinCappos Is there a connection between non-Docker Hub repositories and Docker Hub? If so, does Docker Hub distribute the root.json metadata belonging to these exernally-managed repositories? If there isn't, how do non-Docker repositories distribute their root keys? I'm only wondering how the initial trust is established for the Root keys of non-Docker repositories. |
Includes description of namespace, discovery process, registry metadata, and trust models.
Connects to #188.