Documentation
¶
Index ¶
- Constants
- Variables
- func EnableExperimental() bool
- func NOf(args ...interface{}) int
- func OneOf(args ...interface{}) bool
- func ParsePredicateType(t string) (string, error)
- type AnnotationOptions
- type AttachSBOMOptions
- type AttachSignatureOptions
- type AttestOptions
- type CopyOptions
- type FilesOptions
- type FulcioOptions
- type GenerateKeyPairOptions
- type GenerateOptions
- type Info
- type InitializeOptions
- type Interface
- type KeyParseError
- type OIDCOptions
- type PIVToolAttestationOptions
- type PIVToolGenerateKeyOptions
- type PIVToolSetManagementKeyOptions
- type PIVToolSetPINOptions
- type PIVToolSetPUKOptions
- type PIVToolUnblockOptions
- type PolicyInitOptions
- type PolicySignOptions
- type PredicateLocalOptions
- type PredicateOptions
- type PredicateRemoteOptions
- type PubKeyParseError
- type PublicKeyOptions
- type ReferenceOptions
- type RegistryOptions
- type RekorOptions
- type RootOptions
- type SecurityKeyOptions
- type SignBlobOptions
- type SignOptions
- type TriangulateOptions
- type UploadBlobOptions
- type UploadWASMOptions
- type VerifyAttestationOptions
- type VerifyBlobOptions
- type VerifyDockerfileOptions
- type VerifyOptions
Constants ¶
const ( PredicateCustom = "custom" PredicateSLSA = "slsaprovenance" PredicateSPDX = "spdx" PredicateLink = "link" )
const (
ExperimentalEnv = "COSIGN_EXPERIMENTAL"
)
Variables ¶
var ( // Output of "git describe". The prerequisite is that the branch should be // tagged using the correct versioning strategy. GitVersion = "devel" )
Base version information.
This is the fallback data used when version information from git is not provided via go ldflags (e.g. via Makefile).
var PredicateTypeMap = map[string]string{ PredicateCustom: attestation.CosignCustomProvenanceV01, PredicateSLSA: in_toto.PredicateSLSAProvenanceV01, PredicateSPDX: in_toto.PredicateSPDX, PredicateLink: in_toto.PredicateLinkV1, }
PredicateTypeMap is the mapping between the predicate `type` option to predicate URI.
Functions ¶
func EnableExperimental ¶
func EnableExperimental() bool
func OneOf ¶
func OneOf(args ...interface{}) bool
OneOf ensures that only one of the supplied interfaces is set to a non-zero value.
func ParsePredicateType ¶
ParsePredicateType parses the predicate `type` flag passed into a predicate URI, or validates `type` is a valid URI.
Types ¶
type AnnotationOptions ¶
type AnnotationOptions struct {
Annotations []string
}
AnnotationOptions is the top level wrapper for the annotations.
func (*AnnotationOptions) AddFlags ¶
func (o *AnnotationOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
func (*AnnotationOptions) AnnotationsMap ¶
func (o *AnnotationOptions) AnnotationsMap() (sigs.AnnotationsMap, error)
type AttachSBOMOptions ¶
type AttachSBOMOptions struct {
SBOM string
SBOMType string
Registry RegistryOptions
}
AttachSBOMOptions is the top level wrapper for the attach sbom command.
func (*AttachSBOMOptions) AddFlags ¶
func (o *AttachSBOMOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type AttachSignatureOptions ¶
type AttachSignatureOptions struct {
Signature string
Payload string
Registry RegistryOptions
}
AttachSignatureOptions is the top level wrapper for the attach signature command.
func (*AttachSignatureOptions) AddFlags ¶
func (o *AttachSignatureOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type AttestOptions ¶
type AttestOptions struct {
Key string
Cert string
NoUpload bool
Force bool
Recursive bool
Rekor RekorOptions
Fulcio FulcioOptions
OIDC OIDCOptions
SecurityKey SecurityKeyOptions
Predicate PredicateLocalOptions
Registry RegistryOptions
}
AttestOptions is the top level wrapper for the attest command.
func (*AttestOptions) AddFlags ¶
func (o *AttestOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type CopyOptions ¶
type CopyOptions struct {
SignatureOnly bool
Force bool
Registry RegistryOptions
}
CopyOptions is the top level wrapper for the copy command.
func (*CopyOptions) AddFlags ¶
func (o *CopyOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type FilesOptions ¶
type FilesOptions struct {
Files []string
}
FilesOptions is the wrapper for the files.
func (*FilesOptions) AddFlags ¶
func (o *FilesOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
func (*FilesOptions) String ¶
func (o *FilesOptions) String() string
type FulcioOptions ¶
FulcioOptions is the wrapper for Fulcio related options.
func (*FulcioOptions) AddFlags ¶
func (o *FulcioOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type GenerateKeyPairOptions ¶
type GenerateKeyPairOptions struct {
// KMS Key Management Service
KMS string
}
GenerateKeyPairOptions is the top level wrapper for the generate-key-pair command.
func (*GenerateKeyPairOptions) AddFlags ¶
func (o *GenerateKeyPairOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type GenerateOptions ¶
type GenerateOptions struct {
AnnotationOptions
Registry RegistryOptions
}
GenerateOptions is the top level wrapper for the generate command.
func (*GenerateOptions) AddFlags ¶
func (o *GenerateOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type Info ¶
type Info struct {
GitVersion string
GitCommit string
GitTreeState string
BuildDate string
GoVersion string
Compiler string
Platform string
}
func VersionInfo ¶
func VersionInfo() Info
func (*Info) JSONString ¶
JSONString returns the JSON representation of the version info
type InitializeOptions ¶
InitializeOptions is the top level wrapper for the initialize command.
func (*InitializeOptions) AddFlags ¶
func (o *InitializeOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type KeyParseError ¶
type KeyParseError struct{}
KeyParseError is an error returned when an incorrect set of key flags are parsed by the CLI
func (*KeyParseError) Error ¶
func (e *KeyParseError) Error() string
type OIDCOptions ¶
OIDCOptions is the wrapper for OIDC related options.
func (*OIDCOptions) AddFlags ¶
func (o *OIDCOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PIVToolAttestationOptions ¶
PIVToolAttestationOptions is the wrapper for `piv-tool attestation` related options.
func (*PIVToolAttestationOptions) AddFlags ¶
func (o *PIVToolAttestationOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PIVToolGenerateKeyOptions ¶
type PIVToolGenerateKeyOptions struct {
ManagementKey string
RandomKey bool
Slot string
PINPolicy string
TouchPolicy string
}
PIVToolGenerateKeyOptions is the wrapper for `piv-tool generate-key` related options.
func (*PIVToolGenerateKeyOptions) AddFlags ¶
func (o *PIVToolGenerateKeyOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PIVToolSetManagementKeyOptions ¶
PIVToolSetManagementKeyOptions is the wrapper for `piv-tool set-management-key` related options.
func (*PIVToolSetManagementKeyOptions) AddFlags ¶
func (o *PIVToolSetManagementKeyOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PIVToolSetPINOptions ¶
PIVToolSetPINOptions is the wrapper for `piv-tool set-pin` related options.
func (*PIVToolSetPINOptions) AddFlags ¶
func (o *PIVToolSetPINOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PIVToolSetPUKOptions ¶
PIVToolSetPUKOptions is the wrapper for `piv-tool set-puk` related options.
func (*PIVToolSetPUKOptions) AddFlags ¶
func (o *PIVToolSetPUKOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PIVToolUnblockOptions ¶
PIVToolUnblockOptions is the wrapper for `piv-tool unblock` related options.
func (*PIVToolUnblockOptions) AddFlags ¶
func (o *PIVToolUnblockOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PolicyInitOptions ¶
type PolicyInitOptions struct {
ImageRef string
Maintainers []string
Threshold int
Expires int
OutFile string
Registry RegistryOptions
}
PolicyInitOptions is the top level wrapper for the policy-init command.
func (*PolicyInitOptions) AddFlags ¶
func (o *PolicyInitOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PolicySignOptions ¶
type PolicySignOptions struct {
ImageRef string
OutFile string
Registry RegistryOptions
Fulcio FulcioOptions
Rekor RekorOptions
OIDC OIDCOptions
}
func (*PolicySignOptions) AddFlags ¶
func (o *PolicySignOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PredicateLocalOptions ¶
type PredicateLocalOptions struct {
PredicateOptions
Path string
}
PredicateLocalOptions is the wrapper for predicate related options.
func (*PredicateLocalOptions) AddFlags ¶
func (o *PredicateLocalOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PredicateOptions ¶
type PredicateOptions struct {
Type string
}
PredicateOptions is the wrapper for predicate related options.
func (*PredicateOptions) AddFlags ¶
func (o *PredicateOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PredicateRemoteOptions ¶
type PredicateRemoteOptions struct {
PredicateOptions
}
PredicateRemoteOptions is the wrapper for remote predicate related options.
func (*PredicateRemoteOptions) AddFlags ¶
func (o *PredicateRemoteOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type PubKeyParseError ¶
type PubKeyParseError struct{}
PubKeyParseError is an error returned when an incorrect set of public key flags are parsed by the CLI
func (*PubKeyParseError) Error ¶
func (e *PubKeyParseError) Error() string
type PublicKeyOptions ¶
type PublicKeyOptions struct {
Key string
SecurityKey SecurityKeyOptions
OutFile string
}
PublicKeyOptions is the top level wrapper for the public-key command.
func (*PublicKeyOptions) AddFlags ¶
func (o *PublicKeyOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type ReferenceOptions ¶
type ReferenceOptions struct {
TagPrefix string
}
ReferenceOptions is a wrapper for image reference options.
func (*ReferenceOptions) AddFlags ¶
func (o *ReferenceOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type RegistryOptions ¶
type RegistryOptions struct {
AllowInsecure bool
KubernetesKeychain bool
RefOpts ReferenceOptions
}
RegistryOptions is the wrapper for the registry options.
func (*RegistryOptions) AddFlags ¶
func (o *RegistryOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
func (*RegistryOptions) ClientOpts ¶
func (*RegistryOptions) GetRegistryClientOpts ¶
func (o *RegistryOptions) GetRegistryClientOpts(ctx context.Context) []remote.Option
type RekorOptions ¶
type RekorOptions struct {
URL string
}
RekorOptions is the wrapper for Rekor related options.
func (*RekorOptions) AddFlags ¶
func (o *RekorOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type RootOptions ¶
RootOptions define flags and options for the root cosign cli.
func (*RootOptions) AddFlags ¶
func (o *RootOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type SecurityKeyOptions ¶
SecurityKeyOptions is the wrapper for security key related options.
func (*SecurityKeyOptions) AddFlags ¶
func (o *SecurityKeyOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type SignBlobOptions ¶
type SignBlobOptions struct {
Key string
Base64Output bool
Output string // TODO: this should be the root output file arg.
SecurityKey SecurityKeyOptions
Fulcio FulcioOptions
Rekor RekorOptions
OIDC OIDCOptions
Registry RegistryOptions
}
SignBlobOptions is the top level wrapper for the sign-blob command.
func (*SignBlobOptions) AddFlags ¶
func (o *SignBlobOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type SignOptions ¶
type SignOptions struct {
Key string
Cert string
Upload bool
PayloadPath string
Force bool
Recursive bool
Attachment string
Rekor RekorOptions
Fulcio FulcioOptions
OIDC OIDCOptions
SecurityKey SecurityKeyOptions
AnnotationOptions
Registry RegistryOptions
}
SignOptions is the top level wrapper for the sign command.
func (*SignOptions) AddFlags ¶
func (o *SignOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type TriangulateOptions ¶
type TriangulateOptions struct {
Type string
Registry RegistryOptions
}
TriangulateOptions is the top level wrapper for the triangulate command.
func (*TriangulateOptions) AddFlags ¶
func (o *TriangulateOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type UploadBlobOptions ¶
type UploadBlobOptions struct {
ContentType string
Files FilesOptions
Registry RegistryOptions
}
UploadBlobOptions is the top level wrapper for the `upload blob` command.
func (*UploadBlobOptions) AddFlags ¶
func (o *UploadBlobOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type UploadWASMOptions ¶
type UploadWASMOptions struct {
File string
Registry RegistryOptions
}
UploadWASMOptions is the top level wrapper for the `upload wasm` command.
func (*UploadWASMOptions) AddFlags ¶
func (o *UploadWASMOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type VerifyAttestationOptions ¶
type VerifyAttestationOptions struct {
Key string
CheckClaims bool
Output string
SecurityKey SecurityKeyOptions
Rekor RekorOptions
Fulcio FulcioOptions // TODO: the original command did not use id token, mistake?
Registry RegistryOptions
Predicate PredicateRemoteOptions
Policies []string
}
VerifyAttestationOptions is the top level wrapper for the `verify attestation` command.
func (*VerifyAttestationOptions) AddFlags ¶
func (o *VerifyAttestationOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type VerifyBlobOptions ¶
type VerifyBlobOptions struct {
Key string
Cert string
Signature string
SecurityKey SecurityKeyOptions
Rekor RekorOptions
Registry RegistryOptions
}
VerifyBlobOptions is the top level wrapper for the `verify blob` command.
func (*VerifyBlobOptions) AddFlags ¶
func (o *VerifyBlobOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type VerifyDockerfileOptions ¶
type VerifyDockerfileOptions struct {
VerifyOptions
BaseImageOnly bool
}
VerifyBlobOptions is the top level wrapper for the `verify blob` command.
func (*VerifyDockerfileOptions) AddFlags ¶
func (o *VerifyDockerfileOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
type VerifyOptions ¶
type VerifyOptions struct {
Key string
CertEmail string // TODO: merge into fulcio option as read mode?
CheckClaims bool
Attachment string
Output string
SecurityKey SecurityKeyOptions
Rekor RekorOptions
// TODO: this seems like it should have the Fulcio options.
Registry RegistryOptions
AnnotationOptions
}
VerifyOptions is the top level wrapper for the `verify` command.
func (*VerifyOptions) AddFlags ¶
func (o *VerifyOptions) AddFlags(cmd *cobra.Command)
AddFlags implements Interface
Source Files
¶
- annotations.go
- attach.go
- attest.go
- copy.go
- errors.go
- experimental.go
- files.go
- flags.go
- fulcio.go
- generate.go
- generate_key_pair.go
- initialize.go
- oidc.go
- options.go
- piv_tool.go
- policy.go
- predicate.go
- public_key.go
- reference.go
- registry.go
- rekor.go
- root.go
- security_key.go
- sign.go
- signblob.go
- triangulate.go
- upload.go
- verify.go
- version.go