add imgcrypt stream processors to the default config#5135
add imgcrypt stream processors to the default config#5135fuweid merged 3 commits intocontainerd:masterfrom
Conversation
There was a problem hiding this comment.
Bike shedding: should this be "imgcrypt" or "ocicrypt"?
There was a problem hiding this comment.
imgcrypt is the project where ctd-decorder is coming from but ocicrypt could be a more generic name for a directory for looking for keys used generally for image encryption. -> "ocicrypt" ?
d9b56da to
f44f652
Compare
|
/test pull-containerd-node-e2e |
5fb3841 to
0d2be78
Compare
There was a problem hiding this comment.
@stefanberger Can we have some default value for this?
There was a problem hiding this comment.
I would call it /etc/ocicrypt_keyprovider.conf. I would NOT call it ocicrypt.conf, because this is the default name used by an other config file that was introduced earlier: https://github.com/containers/ocicrypt/blob/master/config/pkcs11config/config.go#L35
@lumjjb ?
There was a problem hiding this comment.
/etc/ocicrypt_keyprovider.conf sounds fine. We probably want to test this first with ctd-decoder tests to see if it will ignore the case of a file that isn't present.
There was a problem hiding this comment.
If we are going to place /etc/ocicrypt_keyprovider.conf outside /etc/containerd, do we want to have decryption-keys-path outside /etc/containerd too?
Or can we have everything under /etc/containerd/ocicrypt?
There was a problem hiding this comment.
I am fine with putting it in /etc/containerd/ocicrypt/ocicrypt_keyprovider.conf, i like the idea, would probably prevent some conflicts with other tools.
Btw, would the ctd-decoder also be packaged with the installation?
There was a problem hiding this comment.
Updated PR to add env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
Btw, would the ctd-decoder also be packaged with the installation?
SGTM, but out of the scope of this PR.
There was a problem hiding this comment.
Opened #5265 for discussing inclusion of ctd-decoder
|
Build succeeded.
|
Signed-off-by: Akihiro Suda <[email protected]>
`config_linux.go` and `config_windows.go` are identical. `config_unsupported.go` is also almost identical but enables debug logs by default. Signed-off-by: Akihiro Suda <[email protected]>
Enable the following config by default:
```toml
version = 2
[plugins."io.containerd.grpc.v1.cri".image_decryption]
key_model = "node"
[stream_processors]
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar.gzip"]
accepts = ["application/vnd.oci.image.layer.v1.tar+gzip+encrypted"]
returns = "application/vnd.oci.image.layer.v1.tar+gzip"
path = "ctd-decoder"
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar"]
accepts = ["application/vnd.oci.image.layer.v1.tar+encrypted"]
returns = "application/vnd.oci.image.layer.v1.tar"
path = "ctd-decoder"
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
```
Fix issue 5128
Signed-off-by: Akihiro Suda <[email protected]>
0d2be78 to
ecb881e
Compare
|
Build succeeded.
|
| MediaTypeDockerSchema1Manifest = "application/vnd.docker.distribution.manifest.v1+prettyjws" | ||
| // Encypted media types | ||
| MediaTypeImageLayerEncrypted = ocispec.MediaTypeImageLayer + "+encrypted" | ||
| MediaTypeImageLayerGzipEncrypted = ocispec.MediaTypeImageLayerGzip + "+encrypted" |
There was a problem hiding this comment.
FYI. There is a definition of the media type in https://github.com/containers/ocicrypt/blob/master/spec/spec.go. I'm guessing it may cause more dependencies for building certain builds though, so not sure what the implications there are if imported.
There was a problem hiding this comment.
I'd prefer not to add Go dependency on ocicrypt here
Enable the following config by default:
Fix #5128