diff --git a/cmd/skopeo/main.go b/cmd/skopeo/main.go index 51f918de..e849d3be 100644 --- a/cmd/skopeo/main.go +++ b/cmd/skopeo/main.go @@ -41,6 +41,10 @@ func createApp() *cli.App { Value: "", Usage: "Path to a trust policy file", }, + cli.BoolFlag{ + Name: "insecure-policy", + Usage: "run the tool without any policy check", + }, cli.StringFlag{ Name: "registries.d", Value: "", @@ -84,7 +88,9 @@ func getPolicyContext(c *cli.Context) (*signature.PolicyContext, error) { policyPath := c.GlobalString("policy") var policy *signature.Policy // This could be cached across calls, if we had an application context. var err error - if policyPath == "" { + if c.GlobalBool("insecure-policy") { + policy = &signature.Policy{Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()}} + } else if policyPath == "" { policy, err = signature.DefaultPolicy(nil) } else { policy, err = signature.NewPolicyFromFile(policyPath) diff --git a/completions/bash/skopeo b/completions/bash/skopeo index 86ded42e..6936910a 100644 --- a/completions/bash/skopeo +++ b/completions/bash/skopeo @@ -100,6 +100,7 @@ _skopeo_skopeo() { --registries.d " local boolean_options=" + --insecure-policy --debug --version -v --help -h diff --git a/docs/skopeo.1.md b/docs/skopeo.1.md index 4c6f03d9..2a2feec7 100644 --- a/docs/skopeo.1.md +++ b/docs/skopeo.1.md @@ -39,6 +39,8 @@ Most commands refer to container images, using a _transport_`:`_details_ format. **--policy** _path-to-policy_ Path to a policy.json file to use for verifying signatures and deciding whether an image is trusted, overriding the default trust policy file. + **--insecure-policy** Adopt an insecure, permissive policy that allows anything. This obviates the need for a policy file. + **--registries.d** _dir_ use registry configuration files in _dir_ (e.g. for docker signature storage), overriding the default path. **--help**|**-h** Show help