sign

package
v0.0.0-...-9b5a78d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommonMessageMask = []string{
	fmt.Sprintf("metadata.labels.\"%s\"", common.ResourceIntegrityLabelKey),
	fmt.Sprintf("metadata.labels.\"%s\"", common.ReasonLabelKey),
	fmt.Sprintf("metadata.annotations.\"%s\"", common.SignatureAnnotationKey),
	fmt.Sprintf("metadata.annotations.\"%s\"", common.MessageAnnotationKey),
	fmt.Sprintf("metadata.annotations.\"%s\"", common.CertificateAnnotationKey),
	fmt.Sprintf("metadata.annotations.\"%s\"", common.SignatureTypeAnnotationKey),
	fmt.Sprintf("metadata.annotations.\"%s\"", common.MessageScopeAnnotationKey),
	fmt.Sprintf("metadata.annotations.\"%s\"", common.MutableAttrsAnnotationKey),
	"metadata.annotations.namespace",
	"metadata.annotations.kubectl.\"kubernetes.io/last-applied-configuration\"",
	"metadata.managedFields",
	"metadata.creationTimestamp",
	"metadata.generation",
	"metadata.annotations.deprecated.daemonset.template.generation",
	"metadata.namespace",
	"metadata.resourceVersion",
	"metadata.selfLink",
	"metadata.uid",
}

Functions

func GenerateMessageFromRawObj

func GenerateMessageFromRawObj(rawObj []byte, filter, mutableAttrs string) string

Types

type ConcreteSignatureEvaluator

type ConcreteSignatureEvaluator struct {
	// contains filtered or unexported fields
}

func (*ConcreteSignatureEvaluator) Eval

func (*ConcreteSignatureEvaluator) GetResourceSignature

func (self *ConcreteSignatureEvaluator) GetResourceSignature(ref *common.ResourceRef, reqc *common.ReqContext, resSigList *vrsig.ResourceSignatureList) *GeneralSignature

type GeneralSignature

type GeneralSignature struct {
	SignType SignatureType
	// contains filtered or unexported fields
}

type HelmVerifier

type HelmVerifier struct {
	VerifyType  VerifyType
	Namespace   string
	KeyPathList []string
}

func (*HelmVerifier) Verify

func (self *HelmVerifier) Verify(sig *GeneralSignature, reqc *common.ReqContext, signingProfile rspapi.ResourceSigningProfile) (*SigVerifyResult, error)

type ResourceVerifier

type ResourceVerifier struct {
	VerifyType  VerifyType
	Namespace   string
	KeyPathList []string
}

func (*ResourceVerifier) IsPatchWithScopeKey

func (self *ResourceVerifier) IsPatchWithScopeKey(orgObj, rawObj []byte, scope string) bool

func (*ResourceVerifier) MatchMessage

func (self *ResourceVerifier) MatchMessage(message, reqObj []byte, protectAttrs, unprotectAttrs []*profile.AttrsPattern, allowDiffPatterns []*mapnode.DiffPattern, resScope string, signType SignatureType) (bool, string)

func (*ResourceVerifier) Verify

type SigVerifyResult

type SigVerifyResult struct {
	Error  *common.CheckError
	Signer *common.SignerInfo
}

type SignatureEvaluator

type SignatureEvaluator interface {
	Eval(reqc *common.ReqContext, resSigList *vrsig.ResourceSignatureList, signingProfile rspapi.ResourceSigningProfile) (*common.SignatureEvalResult, error)
}

func NewSignatureEvaluator

func NewSignatureEvaluator(config *config.VerifierConfig, policy *policy.SignPolicy, plugins map[string]bool) (SignatureEvaluator, error)

type SignatureType

type SignatureType string
const (
	SignatureTypeUnknown          SignatureType = ""
	SignatureTypeResource         SignatureType = "Resource"
	SignatureTypeApplyingResource SignatureType = "ApplyingResource"
	SignatureTypePatch            SignatureType = "Patch"
	SignatureTypeHelm             SignatureType = "Helm"
)

type VerifierInterface

type VerifierInterface interface {
	Verify(sig *GeneralSignature, reqc *common.ReqContext, signingProfile rspapi.ResourceSigningProfile) (*SigVerifyResult, error)
}

func NewVerifier

func NewVerifier(verifyType VerifyType, signType SignatureType, verifierNamespace string, keyPathList []string) VerifierInterface

type VerifyType

type VerifyType string
const (
	VerifyTypeX509 VerifyType = "x509"
	VerifyTypePGP  VerifyType = "pgp"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL