-
Notifications
You must be signed in to change notification settings - Fork 652
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
serialization: Drop rootfs.type (which had only one legal value) #224
serialization: Drop rootfs.type (which had only one legal value) #224
Conversation
cc @stevvooe |
👎 I made my opinion clear in #211 (comment). I'll repeat here, since you seem to have missed it:
Note that, in practice, there is the possibility of encountering other values of this field, but it is unlikely. However, if they are encountered, that conversion cannot safely proceed. Removing this field is more likely to be actively harmful than leaving it in place. I'm not defending whether or not this field is useful. I'm trying to stem the tide of unnecessary change. This is particularly pathological, as it is subtly different and not actively harmful. |
@stevvooe I am having a hard time understanding the meaning of this response. You are saying that this field is never used and shouldn't be interpreted but we should keep it so we don't drop it in serialization and deserialization? Sorry, just having a difficult time understanding the danger in dropping it. Is there a concrete example? |
On Wed, Aug 31, 2016 at 01:54:04PM -0700, Stephen Day wrote:
I saw it, I'm just not convinced yet. Handling this issue by itself
I was looking for some details behind “unintended consequences” 1,
The current image-spec wording does not say anything like “if you see
This spec is seeded by the Docker spec; it's not bound to exactly |
I'm also having great difficulty understanding the rationale for keeping On 31 August 2016 at 22:54, Stephen Day [email protected] wrote:
|
I never said it wasn't interpreted. Docker uses it to internally interpret the meaning of The fact is, the field exists in the wild, with varying values, for Windows container images. Though it isn't in "production", it may be seen as part of an earlier release. If these diff ids are interpreted incorrectly, an image may be incorrectly assembled. Retaining this field with this values makes it absolutely explicit what these diff ids actually mean. This is particularly dangerous due to the way Go processes JSON, which would lead to this field being ignored in practice. If a config with a different value is encountered in the wild, it will be impossible to detect without making that definition explicit. Are you willing to take a risk that code converting from the docker image format always gets this subtlety just right? I understand this may offend one's sense of aesthetics but leaving this in place and making it explicit is just the safest option. |
@stevvooe Do you have links to the code or whatever that caused this issue? Then we can make a big footnote for future readers. |
@philips Yea, let me see what I can find here. |
On Wed, Aug 31, 2016 at 05:20:15PM -0700, Stephen Day wrote:
But as image-spec stands (with or without this PR), there's only one
As does not setting the field and referencing the config with a
With the language in-flight in #164 (which I think should cover the The right approach is to translate the Docker config to an OCI config, |
@wking I understand what you're saying and you're right from a theoretical perspective. However, we need to take a harm reduction approach to security. Introducing a potential security land mine then saying "whoops, should have read this part more carefully" isn't acceptable. The result is bad and we've gained nothing from having a "simpler" specification. |
On Wed, Aug 31, 2016 at 06:52:40PM -0700, Stephen Day wrote:
So let's try and figure out what the side effects of a sloppy $ git log --oneline -G 'layers+base' So the removal will presumably land in Docker 1.13. That means that What were the semantics of the layers+base type, and what happens if Or is the base layer just some security patches, and layers+base |
cb9a5a9
to
5d032cb
Compare
5d032cb
to
7402389
Compare
I've received a little more information on the role of this field. It actually selects the hashing algorithm used for the image ID/rootfs. If that algorithm changes, this field changes value. Removing it will make otherwise compatible images completely incompatible. What reason do you have for making this incompatible? Is this just really about field hygiene? |
On Fri, Sep 02, 2016 at 03:35:44PM -0700, Stephen Day wrote:
Can you link to code? I'm not sure why you'd need something other
It's hard to say without looking at code, but if the field consumers And translation is still deterministic and straightforward 1. I am
Yes. Each property defined by the spec should have a clear purpose
|
@wking At this point, I have painted a very clear picture of why this field is needed and you're simply rejecting the premises. I'm sorry, but you're creating work and subtlety for no good reason. This PR and the implications that come with removing this field are a massive waste of time. |
On Fri, Sep 02, 2016 at 04:01:11PM -0700, Stephen Day wrote:
Ah, you're saying 1 that touching the config at all changes the Maybe there are systems which handle trust by signing configs? In But if the rootfs.type value is ‘layers’, the registry can leave the And if the rootfs.type value is not -defined-in-this-spec- [edit: ‘layers’] or an Is that config-signature-preservation issue the only problem you see? [3]: I'm concerned about tarbomb exposure in that case and would like |
I think @wking is raising a lot of valid points here. @stevvooe can you please give a tangible example of how this can cause a security issue? If it really is a potential landmine then we should be crystal clear in the spec about why it's so important so implementers can take appropriate caution. As it stands the implications are not obvious. |
@jonboulle The value If you're asking for an example of an active exploit that involves some contrived sequence of events that lead to an injection, you're going to be disappointed. That simply isn't how security works. If we knew there was an exploit, we'd suggest a full fix for it. In this case, this PR is suggesting that we take implicitly, what was explicit before, which creates a possible risk that needs mitigation. The safest option here is to leave the field in place and mark for removal in a later version if it can be shown that it is truly not needed. The best part is that this option requires no work at all, other than me, sitting here, asserting that this community should not take undue security risks. The approach here is not dissimilar to putting ashtrays in airplane lavatories. They may look useless but they prevent the plane from catching on fire for the one asshole that doesn't follow the rules and smokes anyways. Just because the implications of removing the ash tray aren't obvious doesn't mean we remove the ash tray. |
Here is an example of value of |
On Tue, Sep 06, 2016 at 12:56:27PM -0700, Stephen Day wrote:
The code in 1 is not compatible with our ChainID definition 2, ChainID(layerN) is always the empty string if rootfs.type is Which seems like a pretty crazy thing to say (1 is pretty
I'm not clear on how the ChainID is ever useful for validating When naming an object, hash something high enough up the Merkle tree I don't think the ChainID would ever fit that criterion for an image
If the OCI updates the config spec with different layer semantics, we One way to avoid confusion would be to clearly document (and provide a |
@wking I am not going to repeat my points again, so I would please ask that you take some time to read and understand my position before responding. |
* Docker's [v1.1](https://github.com/docker/docker/blob/master/image/spec/v1.1.md#container-runconfig-field-descriptions) and [v1.2](https://github.com/docker/docker/blob/master/image/spec/v1.2.md#container-runconfig-field-descriptions) declare a [`rootfs.type`] property but only document a `layers` argument. | ||
The OCI configuration does not provide a `rootfs.type` property, and treats all configurations as if they used Docker's `layers` value. | ||
Translators converting Docker v1.1 or v1.2 configurations to OCI configurations should error out if `rootfs.type` contains any string other than `layers`. | ||
Translators converting OCI configurations to Docker v1.1 or v1.2 configurations shuold always set `rootfs.type` to `layers`. |
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.
`/s/shuold/should/
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.
I'd rather drop the field [1], but have been unable to convince Stephen that there would not be side effects of that approach. So we're back to my initial recommendation that we require the 'layers' value [2] and require implementations to error out if they see an unknown value [3]. The use of “unknown” vs. “another” allows image and implementation authors to collaborate on additional layer types if they see a need to do so while ensuring that users not party to such extensions don't get silently-broken behavior. This relies on extention types being suitably namespaced/unique so that two separate extension groups don't pick the same type string, but that seems like a reasonably safe bet. The spec does not provide any way to version this field, so users wondering "is my tooling modern enough to handle this image and any rootfs.type extensions it may contain?" should ask their tooling to validate the image. [1]: opencontainers#224 Subject: serialization: Drop rootfs.type (which had only one legal value) [2]: opencontainers#211 (comment) Subject: serialization: remove windows-specific layers+base rootfs [3]: opencontainers#211 (comment) Signed-off-by: W. Trevor King <[email protected]>
I'd rather drop the field [1], but have been unable to convince Stephen that there would not be side effects of that approach. So we're back to my initial recommendation that we require the 'layers' value [2] and require implementations to error out if they see an unknown value [3]. The use of "unknown" vs. "another" allows image and implementation authors to collaborate on additional layer types if they see a need to do so while ensuring that users not party to such extensions don't get silently-broken behavior. This relies on extention types being suitably namespaced/unique so that two separate extension groups don't pick the same type string, but that seems like a reasonably safe bet. The spec does not provide any way to version this field, so users wondering "is my tooling modern enough to handle this image and any rootfs.type extensions it may contain?" should ask their tooling to validate the image. [1]: opencontainers#224 Subject: serialization: Drop rootfs.type (which had only one legal value) [2]: opencontainers#211 (comment) Subject: serialization: remove windows-specific layers+base rootfs [3]: opencontainers#211 (comment) Signed-off-by: W. Trevor King <[email protected]>
On Wed, Sep 07, 2016 at 02:32:26PM -0700, Brandon Philips wrote:
I've filed this alternative approach as #277 (is that 50 issues/PRs in |
With 0c52d5d (serialization: remove windows-specific layers+base rootfs, 2016-08-26, opencontainers#211) this field became a single-choice field. We could keep the field to make the current "layers" approach explicit in the face of future rootfs types, but we'd have to solidify the wording around it to cover what should happen when rootfs.type was not set, or if rootfs.type was an unrecognized value. It seems easier to remove it and make the "layers" approach implicit default, so that's what this commit does. We can restore the field later if/when we have another rootfs type without breaking forward compatibility. Code translating between Docker and OCI image renderings can drop/restore this field while it is translating Docker ↔ OCI media types, so I don't expect compatibility issues from this change. Signed-off-by: W. Trevor King <[email protected]>
7402389
to
8f8e481
Compare
I'd rather drop the field [1], but have been unable to convince Stephen that there would not be side effects of that approach. So we're back to my initial recommendation that we require the 'layers' value [2] and require implementations to error out if they see an unknown value [3]. The use of "unknown" vs. "another" allows image and implementation authors to collaborate on additional layer types if they see a need to do so while ensuring that users not party to such extensions don't get silently-broken behavior. This relies on extention types being suitably namespaced/unique so that two separate extension groups don't pick the same type string, but that seems like a reasonably safe bet. The spec does not provide any way to version this field, so users wondering "is my tooling modern enough to handle this image and any rootfs.type extensions it may contain?" should ask their tooling to validate the image. [1]: opencontainers/image-spec#224 Subject: serialization: Drop rootfs.type (which had only one legal value) [2]: opencontainers/image-spec#211 (comment) Subject: serialization: remove windows-specific layers+base rootfs [3]: opencontainers/image-spec#211 (comment) Signed-off-by: W. Trevor King <[email protected]>
I'd rather drop the field [1], but have been unable to convince Stephen that there would not be side effects of that approach. So we're back to my initial recommendation that we require the 'layers' value [2] and require implementations to error out if they see an unknown value [3]. The use of "unknown" vs. "another" allows image and implementation authors to collaborate on additional layer types if they see a need to do so while ensuring that users not party to such extensions don't get silently-broken behavior. This relies on extention types being suitably namespaced/unique so that two separate extension groups don't pick the same type string, but that seems like a reasonably safe bet. The spec does not provide any way to version this field, so users wondering "is my tooling modern enough to handle this image and any rootfs.type extensions it may contain?" should ask their tooling to validate the image. [1]: opencontainers/image-spec#224 Subject: serialization: Drop rootfs.type (which had only one legal value) [2]: opencontainers/image-spec#211 (comment) Subject: serialization: remove windows-specific layers+base rootfs [3]: opencontainers/image-spec#211 (comment) Signed-off-by: W. Trevor King <[email protected]>
I'd rather drop the field [1], but have been unable to convince Stephen that there would not be side effects of that approach. So we're back to my initial recommendation that we require the 'layers' value [2] and require implementations to error out if they see an unknown value [3]. The use of "unknown" vs. "another" allows image and implementation authors to collaborate on additional layer types if they see a need to do so while ensuring that users not party to such extensions don't get silently-broken behavior. This relies on extention types being suitably namespaced/unique so that two separate extension groups don't pick the same type string, but that seems like a reasonably safe bet. The spec does not provide any way to version this field, so users wondering "is my tooling modern enough to handle this image and any rootfs.type extensions it may contain?" should ask their tooling to validate the image. [1]: opencontainers/image-spec#224 Subject: serialization: Drop rootfs.type (which had only one legal value) [2]: opencontainers/image-spec#211 (comment) Subject: serialization: remove windows-specific layers+base rootfs [3]: opencontainers/image-spec#211 (comment) Signed-off-by: W. Trevor King <[email protected]>
I'd rather drop the field [1], but have been unable to convince Stephen that there would not be side effects of that approach. So we're back to my initial recommendation that we require the 'layers' value [2] and require implementations to error out if they see an unknown value [3]. The use of "unknown" vs. "another" allows image and implementation authors to collaborate on additional layer types if they see a need to do so while ensuring that users not party to such extensions don't get silently-broken behavior. This relies on extention types being suitably namespaced/unique so that two separate extension groups don't pick the same type string, but that seems like a reasonably safe bet. The spec does not provide any way to version this field, so users wondering "is my tooling modern enough to handle this image and any rootfs.type extensions it may contain?" should ask their tooling to validate the image. [1]: opencontainers/image-spec#224 Subject: serialization: Drop rootfs.type (which had only one legal value) [2]: opencontainers/image-spec#211 (comment) Subject: serialization: remove windows-specific layers+base rootfs [3]: opencontainers/image-spec#211 (comment) Signed-off-by: W. Trevor King <[email protected]>
I'd rather drop the field [1], but have been unable to convince Stephen that there would not be side effects of that approach. So we're back to my initial recommendation that we require the 'layers' value [2] and require implementations to error out if they see an unknown value [3]. The use of "unknown" vs. "another" allows image and implementation authors to collaborate on additional layer types if they see a need to do so while ensuring that users not party to such extensions don't get silently-broken behavior. This relies on extention types being suitably namespaced/unique so that two separate extension groups don't pick the same type string, but that seems like a reasonably safe bet. The spec does not provide any way to version this field, so users wondering "is my tooling modern enough to handle this image and any rootfs.type extensions it may contain?" should ask their tooling to validate the image. [1]: opencontainers/image-spec#224 Subject: serialization: Drop rootfs.type (which had only one legal value) [2]: opencontainers/image-spec#211 (comment) Subject: serialization: remove windows-specific layers+base rootfs [3]: opencontainers/image-spec#211 (comment) Signed-off-by: W. Trevor King <[email protected]>
With 0c52d5d (serialization: remove windows-specific layers+base rootfs, 2016-08-26, #211) this field became a single-choice field. We could keep the field to make the current "layers" approach explicit in the face of future rootfs types, but we'd have to solidify the wording around it to cover what should happen when rootfs.type was not set, or if rootfs.type was an unrecognized value. It seems easier to remove it and make the "layers" approach implicit default, so that's what this commit does. We can restore the field later if/when we have another rootfs type without breaking forward compatibility.
Code translating between Docker and OCI image renderings can drop/restore this field while it is translating Docker ↔ OCI media types, so I don't expect compatibility issues from this change.
Spun off from this discussion.