mirror of
https://github.com/containers/skopeo.git
synced 2025-08-31 22:28:33 +00:00
Merge pull request #319 from kofalt/insecure-policy-flag-redux
Insecure policy flag redux
This commit is contained in:
@@ -41,6 +41,10 @@ func createApp() *cli.App {
|
|||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Path to a trust policy file",
|
Usage: "Path to a trust policy file",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "insecure-policy",
|
||||||
|
Usage: "run the tool without any policy check",
|
||||||
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "registries.d",
|
Name: "registries.d",
|
||||||
Value: "",
|
Value: "",
|
||||||
@@ -84,7 +88,9 @@ func getPolicyContext(c *cli.Context) (*signature.PolicyContext, error) {
|
|||||||
policyPath := c.GlobalString("policy")
|
policyPath := c.GlobalString("policy")
|
||||||
var policy *signature.Policy // This could be cached across calls, if we had an application context.
|
var policy *signature.Policy // This could be cached across calls, if we had an application context.
|
||||||
var err error
|
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)
|
policy, err = signature.DefaultPolicy(nil)
|
||||||
} else {
|
} else {
|
||||||
policy, err = signature.NewPolicyFromFile(policyPath)
|
policy, err = signature.NewPolicyFromFile(policyPath)
|
||||||
|
@@ -100,6 +100,7 @@ _skopeo_skopeo() {
|
|||||||
--registries.d
|
--registries.d
|
||||||
"
|
"
|
||||||
local boolean_options="
|
local boolean_options="
|
||||||
|
--insecure-policy
|
||||||
--debug
|
--debug
|
||||||
--version -v
|
--version -v
|
||||||
--help -h
|
--help -h
|
||||||
|
@@ -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.
|
**--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.
|
**--registries.d** _dir_ use registry configuration files in _dir_ (e.g. for docker signature storage), overriding the default path.
|
||||||
|
|
||||||
**--help**|**-h** Show help
|
**--help**|**-h** Show help
|
||||||
|
Reference in New Issue
Block a user