Comments (1)
Basically because transports and their configuration, and signature verification are conceptually quite separate things, and because sigstore
is a docker/distribution-specific idea which does not fit the generic signature policy.
In more detail:
policy.json
does not care where anything about the images is really stored, neither the manifests nor the signatures, or what is necessary to access anything; as far as it cares, transports
→docker
→docker.io/library/busybox
are just names which allow choosing a relevant set of requirements from the policy file.
OTOH, the containers/image.types.ImageTransport
abstraction allows reading and writing images, whatever the policy is. In particular, docker:
is only one of the five currently supported transports; none of the others use the sigstore mechanism; it would be a bit weird to have sigstores as a policy.json
field.
In practical terms,
- Noone should need to define a policy—let alone a restrictive policy—just to be able to read/write/copy around signatures. It should be possible to have a policy of
insecureAcceptAnything
whileskopeo copy
copies all existing signatures between sources and destinations.- Actually,
policy.json
is not involved at all when writing images to destinations; we don’t have any restrictions on saving images, why would we? So it would be pretty weird to havepolicy.json
sections which we don’t need for anything but theirsigstore-staging
URLs.
- Actually,
- The policy allows defining multiple requirements per namespace (“has a signature by the department who created it” + “is based on a signed ISV image”). If the
sigstore
location were defined in each policy requirement, would the signatures need to be read from all paths specified by each of the requirements? Would the code be required to validate the signatures against each requirement beforeskopeo copy
were allowed to present is as “correctly stored” to the rest? It gets messy. policy.json
is parsed very strictly, to avoid mishaps due to typos: unknown keys and duplicates are rejected, and any failure stops the program in its tracks with absolutely no effort to recover or partially work. Generally we probably want the configuration mechanisms to be a bit more forgiving [or, well, managed by a tool and an API instead of raw files, but this is UNIX and here we are], so as little as possible should be inpolicy.json
.
Of course this is all just code and data structures, and we can define any number of equivalent formulations of data structures, and any number of serializations, so we could have an all-in-one integrated config file which contains signature verification policies and CA keys and hostname overrides and “use older protocol version” overrides and…
perhaps something like
{
"transports": {
"docker": {
"docker-registries": {
"docker.io": {
"insecure": false,
"ca-certificate": "$base64-data",
"v1-fallback": false,
"enforce-atomic-signatures": true,
},
"namespaces": {
"docker.io/library/busybox": {
"sigstore": "$url",
"sigstore-staging": "$url2",
"policyRequirements": [{
"type": "signedBy",
// …
}]
}
}
}
and similarly keep CAs and what not for atomic
in here. It's not obvious to me that this is really easier to use, given the extra nesting needed, while we still retain that paranoid parser.
Also writing tools like atomic trust
which need to understand the contents of the file is noticeably more difficult with an integrated format: At the moment policy.json
does not say much, but what it says is critical, so a tool to interpret policy.json
really should loudly fail if it finds anything unexpected. If we had a single config file for policy and everything else, the tools would really have to silently ignore unrecognized fields to be able to move at any practical speed, and then how certain are we that it is always safe to ignore fields (see that “enforce-atomic-signatures” field; something like that is being added to projectatomic/docker right now)?
from image.
Related Issues (20)
- [Clarification] copy.CopySpecifcImages and Instances list HOT 2
- Is the new LayersData field the compressed size? HOT 7
- internal/signature.FromBlob is not forward-compatible
- Dependency Dashboard
- Support copying images for specific platforms/architectures HOT 2
- Multiple copies of the default signature policy path
- storage tests are mostly broken when run as root
- ENOEXEC with a credential helper HOT 6
- Support Docker image references with tag and digest HOT 6
- [feature request][performance] sort layers by size before remote-to-remote copy HOT 8
- Support for non-TLS HTTP HOT 5
- pull by digest broken on aes encrypted image pushed to dockerhub HOT 2
- Some sequence of multiple GPGME mechanisms / signing + verification operations causes hangs
- Support custom header in registry HOT 1
- Feature request - skopeo delete - oci transport support HOT 1
- Allow referring images in oci: (and oci-archive: ?) by manifest digest HOT 8
- Disable Dependabot filing version updates HOT 2
- Add support for OCI artifacts “attached” to an image via `subject` HOT 3
- `GetDigest` could skip API call when passed a digest HOT 1
- Ambiguous discussion of detached signature in containers-signature.5.md HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.