Skip to content

Add a policy evaluation library#88

Merged
mtrmac merged 6 commits intocontainers:masterfrom
mtrmac:policy-eval
Jun 2, 2016
Merged

Add a policy evaluation library#88
mtrmac merged 6 commits intocontainers:masterfrom
mtrmac:policy-eval

Conversation

@mtrmac
Copy link
Contributor

@mtrmac mtrmac commented May 31, 2016

This is now mostly ready for review; in particular the public API structure of PolicyContext, and the internal abstraction of PolicyRequirement and PolicyReferenceMatch, are done.

The one thing I still want to get done before merging is to eliminate duplication between signature.go and policy_eval_signedby.go.

See individual commit messages for a little more detailed descriptions.

@mtrmac
Copy link
Contributor Author

mtrmac commented May 31, 2016

(Depends on #75, which will also be affected by the signature.go duplicate elimination; I will rebase as necessary.)

@mtrmac mtrmac force-pushed the policy-eval branch 4 times, most recently from 2942e5f to 4ab6b25 Compare June 1, 2016 17:24
@mtrmac
Copy link
Contributor Author

mtrmac commented Jun 1, 2016

The one thing I still want to get done before merging is to eliminate duplication between signature.go and policy_eval_signedby.go.

Done.

Calling this finished, ready for review.

@mtrmac mtrmac changed the title WIP: Add a policy evaluation library Add a policy evaluation library Jun 1, 2016
@runcom
Copy link
Member

runcom commented Jun 2, 2016

LGTM feel free to merge it (does it needs a rebase?)

mtrmac added 6 commits June 2, 2016 16:12
(The key was one-time-generated in a temporary directory,
and is, intentionally, not available.)

This is not conceptually related to the rest of the PR, just adding a
missing case to the test, except that the added fixture will be reused
in a prSignedBy test.
…gnature

To support verification of signatures when more than one key, or more
than one identity, are accepted, have verifyAndExtract signature accept
callbacks (in a struct so that they are explicitly named).

verifyAndExtractSignature now also validates the manifest digest.  It is
intended to become THE SINGLE PLACE where untrusted signature blobs
have signatures verified, are validated against other expectations, and
parsed, and converted into internal data structures available to other
code.

Also:
- Modifies VerifyDockerManifestSignature to use utils.ManifestMatchesDigest.
- Adds a test for Docker reference mismatch in VerifyDockerManifestSignature.
…ace/repo format

Using the canonical minimized format of Docker references introduces too
many ambiguities.

This also removes some validation of the scope string, but all that was
really doing was rejecting completely invalid input like uppercase.

Sadly it is not qutie obvious that we can detect and reject mistakes like
using "busybox" as a scope instead of the correct
"docker.io/library/busybox".  Perhaps require at least one dot or port
number in the host name?
Also move the declaration of the type from the mostly-public
policy_types.go to policy_eval.go.
Also move the declaration of the type from the mostly-public
policy_types.go to policy_eval.go.
…ImageAllowed

PolicyContext is intended to be the primary API for skopeo/signature:
supply a policy and an image, and ask specific, well-defined
(preferably yes/no) questions.
@mtrmac
Copy link
Contributor Author

mtrmac commented Jun 2, 2016

Yeah, this included #75 . Will merge after tests, thanks!

@mtrmac mtrmac merged commit bc8041a into containers:master Jun 2, 2016
@mtrmac mtrmac deleted the policy-eval branch June 2, 2016 14:25
@mtrmac mtrmac mentioned this pull request Oct 6, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants