config

package
v0.0.0-...-47a937c Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfEnforceConstraint

func CheckIfEnforceConstraint(constraintName string, aconfigs []ActionConfig) bool

not block even if invalid request

func CheckIfIgnoredConstraint

func CheckIfIgnoredConstraint(constraintName string, aconfigs []ActionConfig) bool

exclude from observation

func LoadKeySecret

func LoadKeySecret(keySecretNamespace, keySecretName string) (string, error)

func MatchPattern

func MatchPattern(pattern, value string) bool

func SetupLogger

func SetupLogger(config LogConfig, req admission.Request)

Types

type Action

type Action struct {
	Inform  bool `json:"inform,omitempty"`
	Enforce bool `json:"enforce,omitempty"`
}

type ActionConfig

type ActionConfig struct {
	ConstraintName string `json:"constraintName,omitempty"`
	Action         Action `json:"action,omitempty"`
}

type ConstraintConfig

type ConstraintConfig struct {
	Constraints []ActionConfig `json:"constraints,omitempty"`
}

Constraint Config

func LoadConstraintConfig

func LoadConstraintConfig() (ConstraintConfig, error)

type ImageProfile

type ImageProfile struct {
}

type ImageVerificationConfig

type ImageVerificationConfig struct {
}

type KeyConfig

type KeyConfig struct {
	KeySecretName      string `json:"keySecretName,omitempty"`
	KeySecretNamespace string `json:"keySecretNamespace,omitempty"`
}

type LogConfig

type LogConfig struct {
	Level                    string `json:"level,omitempty"`
	ManifestSigstoreLogLevel string `json:"manifestSigstoreLogLevel,omitempty"`
	Format                   string `json:"format,omitempty"`
}

type ObjectUserBinding

type ObjectUserBinding struct {
	Objects k8smanifest.ObjectReferenceList `json:"objects,omitempty"`
	Users   []string                        `json:"users,omitempty"`
}

func (ObjectUserBinding) Match

func (u ObjectUserBinding) Match(obj unstructured.Unstructured, username string) bool

type ObjectUserBindingList

type ObjectUserBindingList []ObjectUserBinding

func (ObjectUserBindingList) Match

type ParameterObject

type ParameterObject struct {
	ConstraintName                   string                          `json:"constraintName,omitempty"`
	SignatureRef                     SignatureRef                    `json:"signatureRef,omitempty"`
	KeyConfigs                       []KeyConfig                     `json:"keyConfigs,omitempty"`
	InScopeObjects                   k8smanifest.ObjectReferenceList `json:"inScopeObjects,omitempty"`
	SkipUsers                        ObjectUserBindingList           `json:"skipUsers,omitempty"`
	TargetServiceAccount             []string                        `json:"targetServiceAccount,omitempty"`
	ImageProfile                     ImageProfile                    `json:"imageProfile,omitempty"`
	k8smanifest.VerifyResourceOption `json:""`
}

func (*ParameterObject) DeepCopyInto

func (p *ParameterObject) DeepCopyInto(p2 *ParameterObject)

type RequestFilterProfile

type RequestFilterProfile struct {
	SkipObjects  k8smanifest.ObjectReferenceList    `json:"skipObjects,omitempty"`
	SkipUsers    ObjectUserBindingList              `json:"skipUsers,omitempty"`
	IgnoreFields k8smanifest.ObjectFieldBindingList `json:"ignoreFields,omitempty"`
}

type RequestHandlerConfig

type RequestHandlerConfig struct {
	ImageVerificationConfig ImageVerificationConfig `json:"imageVerificationConfig,omitempty"`
	KeyPathList             []string                `json:"keyPathList,omitempty"`
	SigStoreConfig          SigStoreConfig          `json:"sigStoreConfig,omitempty"`
	RequestFilterProfile    RequestFilterProfile    `json:"requestFilterProfile,omitempty"`
	Log                     LogConfig               `json:"log,omitempty"`
	SideEffectConfig        SideEffectConfig        `json:"sideEffect,omitempty"`
	Options                 []string
}

func LoadRequestHandlerConfig

func LoadRequestHandlerConfig() (*RequestHandlerConfig, error)

type ResourceRef

type ResourceRef struct {
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

type Rule

type Rule struct {
	Match   []string `json:"match,omitempty"`
	Exclude []string `json:"exclude,omitempty"`
}

type SideEffectConfig

type SideEffectConfig struct {
	// Event
	CreateDenyEvent bool `json:"createDenyEvent"`
}

type SigStoreConfig

type SigStoreConfig struct {
}

type SignatureRef

type SignatureRef struct {
	ImageRef              string      `json:"imageRef,omitempty"`
	SignatureResourceRef  ResourceRef `json:"signatureResourceRef,omitempty"`
	ProvenanceResourceRef ResourceRef `json:"provenanceResourceRef,omitempty"`
}

Jump to

Keyboard shortcuts

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