k8smanifest

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "k8smanifest"

Name is the identifier for this attestor.

RunType is the run stage at which this attestor is executed.

View Source
const Type = "https://witness.dev/attestations/k8smanifest/v0.2"

Type is the URI identifying the predicate type.

Variables

This section is empty.

Functions

func DigestForRef

func DigestForRef(reference string) (string, error)

func WithExtraIgnoreAnnotations

func WithExtraIgnoreAnnotations(anns ...string) func(*Attestor)

WithExtraIgnoreAnnotations appends additional ephemeral annotations to ignore.

func WithExtraIgnoreFields

func WithExtraIgnoreFields(fields ...string) func(*Attestor)

WithExtraIgnoreFields appends additional ephemeral fields to ignore.

func WithKubeContext

func WithKubeContext(context string) func(*Attestor)

WithKubeContext sets the kubeconfig path used in server-side dry-run.

func WithKubeconfigPath

func WithKubeconfigPath(path string) func(*Attestor)

WithKubeconfigPath sets the kubeconfig path used in server-side dry-run.

func WithRecordClusterInfo

func WithRecordClusterInfo(record bool) func(*Attestor)

WithRecordClusterInfo sets the cluster information recording option.

func WithServerSideDryRun

func WithServerSideDryRun(dryRun bool) func(*Attestor)

WithServerSideDryRun sets the server-side dry-run option.

Types

type Attestor

type Attestor struct {
	ServerSideDryRun  bool     `json:"serversidedryrun,omitempty"`
	RecordClusterInfo bool     `json:"recordclusterinfo,omitempty"`
	KubeconfigPath    string   `json:"kubeconfig,omitempty"`
	KubeContext       string   `json:"kubecontext,omitempty"`
	IgnoreFields      []string `json:"ignorefields,omitempty" jsonschema:"title=ignorefields"`
	IgnoreAnnotations []string `json:"ignoreannotations,omitempty"`

	RecordedDocs []RecordedObject `json:"recordeddocs,omitempty"`

	ClusterInfo ClusterInfo `json:"clusterinfo"`
	// contains filtered or unexported fields
}

Attestor implements the Witness Attestor interface for Kubernetes manifests.

func New

func New() *Attestor

New returns a default Attestor

func (*Attestor) Attest

func (a *Attestor) Attest(ctx *attestation.AttestationContext) error

Attest processes any YAML/JSON products, removes ephemeral fields, etc.

func (*Attestor) Name

func (a *Attestor) Name() string

Name satisfies the Attestor interface.

func (*Attestor) RunType

func (a *Attestor) RunType() attestation.RunType

RunType satisfies the Attestor interface.

func (*Attestor) Schema

func (a *Attestor) Schema() *jsonschema.Schema

Schema provides a JSON schema for this attestor.

func (*Attestor) Subjects

func (a *Attestor) Subjects() map[string]cryptoutil.DigestSet

Subjects returns computed subject digests

func (*Attestor) Type

func (a *Attestor) Type() string

Type satisfies the Attestor interface.

type ClusterInfo

type ClusterInfo struct {
	Server        string                  `json:"server"`
	RecordedNodes map[string]RecordedNode `json:"nodes"`
}

type RecordedImage

type RecordedImage struct {
	Reference string            `json:"reference"`
	Digest    map[string]string `json:"digest"`
}

Recorded image stores the details of images found in kubernetes manifests

type RecordedNode

type RecordedNode struct {
	Name     string                `json:"name"`
	Labels   map[string]string     `json:"labels"`
	NodeInfo corev1.NodeSystemInfo `json:"nodeInfo"`
}

type RecordedObject

type RecordedObject struct {
	FilePath       string          `json:"filepath"`
	Kind           string          `json:"kind"`
	Name           string          `json:"name"`
	Data           json.RawMessage `json:"data"`
	SubjectKey     string          `json:"subjectkey"`
	RecordedImages []RecordedImage `json:"recordedimages"`
}

RecordedObject stores ephemeral-cleaned doc details.

Jump to

Keyboard shortcuts

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