12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- package cli
15
+ package manifest
16
16
17
17
import (
18
18
"bytes"
@@ -27,54 +27,55 @@ import (
27
27
28
28
"github.com/peterbourgon/ff/v3/ffcli"
29
29
"github.com/pkg/errors"
30
+ "github.com/sigstore/cosign/cmd/cosign/cli"
30
31
"k8s.io/apimachinery/pkg/util/yaml"
31
32
)
32
33
33
34
// VerifyManifestCommand verifies all image signatures on a supplied k8s resource
34
35
type VerifyManifestCommand struct {
35
- VerifyCommand
36
+ cli. VerifyCommand
36
37
}
37
38
38
39
// VerifyManifest builds and returns an ffcli command
39
40
func VerifyManifest () * ffcli.Command {
40
- cmd := VerifyManifestCommand {VerifyCommand : VerifyCommand {} }
41
- flagset := flag .NewFlagSet ("cosign verify- manifest" , flag .ExitOnError )
42
- ApplyVerifyFlags (& cmd .VerifyCommand , flagset )
41
+ cmd := VerifyManifestCommand {}
42
+ flagset := flag .NewFlagSet ("cosign manifest verify " , flag .ExitOnError )
43
+ cli . ApplyVerifyFlags (& cmd .VerifyCommand , flagset )
43
44
44
45
return & ffcli.Command {
45
- Name : "verify-manifest " ,
46
- ShortUsage : "cosign verify- manifest -key <key path>|<key url>|<kms uri> <path/to/manifest>" ,
46
+ Name : "verify" ,
47
+ ShortUsage : "cosign manifest verify -key <key path>|<key url>|<kms uri> <path/to/manifest>" ,
47
48
ShortHelp : "Verify all signatures of images specified in the manifest" ,
48
49
LongHelp : `Verify all signature of images in a Kubernetes resource manifest by checking claims
49
50
against the transparency log.
50
51
51
52
EXAMPLES
52
53
# verify cosign claims and signing certificates on images in the manifest
53
- cosign verify- manifest <path/to/my-deployment.yaml>
54
+ cosign manifest verify <path/to/my-deployment.yaml>
54
55
55
56
# additionally verify specified annotations
56
- cosign verify- manifest -a key1=val1 -a key2=val2 <path/to/my-deployment.yaml>
57
+ cosign manifest verify -a key1=val1 -a key2=val2 <path/to/my-deployment.yaml>
57
58
58
59
# (experimental) additionally, verify with the transparency log
59
- COSIGN_EXPERIMENTAL=1 cosign verify- manifest <path/to/my-deployment.yaml>
60
+ COSIGN_EXPERIMENTAL=1 cosign manifest verify <path/to/my-deployment.yaml>
60
61
61
62
# verify images with public key
62
- cosign verify- manifest -key cosign.pub <path/to/my-deployment.yaml>
63
+ cosign manifest verify -key cosign.pub <path/to/my-deployment.yaml>
63
64
64
65
# verify images with public key provided by URL
65
- cosign verify- manifest -key https://host.for/<FILE> <path/to/my-deployment.yaml>
66
+ cosign manifest verify -key https://host.for/<FILE> <path/to/my-deployment.yaml>
66
67
67
68
# verify images with public key stored in Azure Key Vault
68
- cosign verify- manifest -key azurekms://[VAULT_NAME][VAULT_URI]/[KEY] <path/to/my-deployment.yaml>
69
+ cosign manifest verify -key azurekms://[VAULT_NAME][VAULT_URI]/[KEY] <path/to/my-deployment.yaml>
69
70
70
71
# verify images with public key stored in AWS KMS
71
- cosign verify- manifest -key awskms://[ENDPOINT]/[ID/ALIAS/ARN] <path/to/my-deployment.yaml>
72
+ cosign manifest verify -key awskms://[ENDPOINT]/[ID/ALIAS/ARN] <path/to/my-deployment.yaml>
72
73
73
74
# verify images with public key stored in Google Cloud KMS
74
- cosign verify- manifest -key gcpkms://projects/[PROJECT]/locations/global/keyRings/[KEYRING]/cryptoKeys/[KEY] <path/to/my-deployment.yaml>
75
+ cosign manifest verify -key gcpkms://projects/[PROJECT]/locations/global/keyRings/[KEYRING]/cryptoKeys/[KEY] <path/to/my-deployment.yaml>
75
76
76
77
# verify images with public key stored in Hashicorp Vault
77
- cosign verify- manifest -key hashivault://[KEY] <path/to/my-deployment.yaml>` ,
78
+ cosign manifest verify -key hashivault://[KEY] <path/to/my-deployment.yaml>` ,
78
79
79
80
FlagSet : flagset ,
80
81
Exec : cmd .Exec ,
0 commit comments