policy

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttestationToPayloadJSON

func AttestationToPayloadJSON(ctx context.Context, predicateType string, verifiedAttestation oci.Signature) ([]byte, error)

AttestationToPayloadJSON takes in a verified Attestation (oci.Signature) and marshals it into a JSON depending on the payload that's then consumable by policy engine like cue, rego, etc.

Anything fed here must have been validated with either `VerifyLocalImageAttestations` or `VerifyImageAttestations`

If there's no error, and payload is empty means the predicateType did not match the attestation.

func EvaluatePolicyAgainstJSON

func EvaluatePolicyAgainstJSON(ctx context.Context, name, policyType string, policyBody string, jsonBytes []byte) error

EvaluatePolicyAgainstJson is used to run a policy engine against JSON bytes. These bytes can be for example Attestations, or ClusterImagePolicy result types. name - which attestation are we evaluating policyType - cue|rego policyBody - String representing either cue or rego language jsonBytes - Bytes to evaluate against the policyBody in the given language

Types

This section is empty.

Jump to

Keyboard shortcuts

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