Help us shape the future of Go! Take the 2026 Go Developer Survey

evidence

package
v0.4.23 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxAuditEvents = 1000
)
View Source
const SchemaVersion = "v1"

Variables

This section is empty.

Functions

func Append

func Append(root string, event AuditEvent) error

func WithActor

func WithActor(ctx context.Context, interfaceName, identity string) context.Context

Types

type Actor

type Actor struct {
	Interface string   `json:"interface"`
	Identity  string   `json:"identity,omitempty"`
	Issuer    string   `json:"issuer,omitempty"`
	Subject   string   `json:"subject,omitempty"`
	Assurance string   `json:"assurance,omitempty"`
	Methods   []string `json:"authentication_methods,omitempty"`
}

func ActorFromContext

func ActorFromContext(ctx context.Context) Actor

type AuditEvent

type AuditEvent struct {
	SchemaVersion       string    `json:"schema_version"`
	ID                  string    `json:"id"`
	Timestamp           time.Time `json:"timestamp"`
	Actor               Actor     `json:"actor"`
	Target              string    `json:"target"`
	ApplicationID       string    `json:"application_id,omitempty"`
	DeploymentID        string    `json:"deployment_id,omitempty"`
	Application         string    `json:"application"`
	Environment         string    `json:"environment"`
	Operation           string    `json:"operation"`
	Capability          string    `json:"capability,omitempty"`
	Resource            string    `json:"resource,omitempty"`
	Provider            string    `json:"provider,omitempty"`
	Placement           string    `json:"placement,omitempty"`
	Ownership           string    `json:"ownership,omitempty"`
	PolicyResult        string    `json:"policy_result,omitempty"`
	AuthorizationResult string    `json:"authorization_result,omitempty"`
	CorrelationID       string    `json:"correlation_id,omitempty"`
	LifecycleResult     string    `json:"lifecycle_result,omitempty"`
	VerificationResult  string    `json:"verification_result,omitempty"`
	Outcome             string    `json:"outcome"`
	Detail              string    `json:"detail,omitempty"`
}

func Filter

func Filter(events []AuditEvent, target, application, environment string) []AuditEvent

func Load

func Load(root string) ([]AuditEvent, error)

func NewAuditEvent

func NewAuditEvent(ctx context.Context, target, application, environment, operation, outcome string) AuditEvent

func (AuditEvent) Validate

func (e AuditEvent) Validate() error

type Bundle

type Bundle struct {
	ContractVersion string       `json:"contract_version"`
	SchemaVersion   string       `json:"schema_version"`
	Target          string       `json:"target"`
	ApplicationID   string       `json:"application_id"`
	DeploymentID    string       `json:"deployment_id"`
	Application     string       `json:"application"`
	Environment     string       `json:"environment"`
	Desired         []Record     `json:"desired_state"`
	Enforced        []Record     `json:"enforced_policy"`
	Observed        []Record     `json:"observed_state"`
	Verified        []Record     `json:"verified_result"`
	Exceptions      []Record     `json:"explicit_exceptions,omitempty"`
	Unsupported     []Record     `json:"unsupported_controls,omitempty"`
	Recovery        *Recovery    `json:"recovery,omitempty"`
	Audit           []AuditEvent `json:"audit_events,omitempty"`
	Integrity       Integrity    `json:"integrity"`
}

func Seal

func Seal(bundle Bundle) (Bundle, error)

type Integrity

type Integrity struct {
	Algorithm string `json:"algorithm"`
	Digest    string `json:"digest"`
}

type Record

type Record struct {
	Kind       StateKind `json:"kind"`
	ID         string    `json:"id"`
	Status     string    `json:"status,omitempty"`
	Resource   string    `json:"resource,omitempty"`
	Capability string    `json:"capability,omitempty"`
	Provider   string    `json:"provider,omitempty"`
	Placement  string    `json:"placement,omitempty"`
	Ownership  string    `json:"ownership,omitempty"`
	Detail     string    `json:"detail,omitempty"`
}

type Recovery

type Recovery struct {
	LastBackup   *time.Time            `json:"last_backup,omitempty"`
	LastRestore  *time.Time            `json:"last_restore,omitempty"`
	Contributors []RecoveryContributor `json:"contributors,omitempty"`
}

type RecoveryContributor

type RecoveryContributor struct {
	StateClass         string `json:"state_class"`
	LogicalResource    string `json:"logical_resource,omitempty"`
	Ownership          string `json:"ownership"`
	Support            string `json:"support"`
	Selected           bool   `json:"selected"`
	Durable            bool   `json:"durable,omitempty"`
	ExplicitlyExcluded bool   `json:"explicitly_excluded,omitempty"`
	Verified           bool   `json:"verified,omitempty"`
	Reason             string `json:"reason,omitempty"`
}

type StateKind

type StateKind string
const (
	StateDesired     StateKind = "desired"
	StateEnforced    StateKind = "enforced"
	StateObserved    StateKind = "observed"
	StateVerified    StateKind = "verified"
	StateException   StateKind = "exception"
	StateUnsupported StateKind = "unsupported"
)

Jump to

Keyboard shortcuts

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