lifecycle

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GapStaleMissing         = "stale_missing"
	GapOwnerlessExposure    = "ownerless_exposure"
	GapInactiveCredentialed = "inactive_but_credentialed" // #nosec G101 -- lifecycle enum label, not credential material.
	GapOverApproved         = "over_approved"
	GapOrphanedIdentity     = "orphaned_identity"
	GapRevokedStillPresent  = "revoked_still_present"
	GapApprovalExpired      = "approval_expired"
	GapPresenceDrift        = "presence_absence_drift"
)

Variables

This section is empty.

Functions

func AppendTransitionRecord

func AppendTransitionRecord(chain *proof.Chain, transition Transition, eventType string) error

func ChainPath

func ChainPath(statePath string) string

func LoadChain

func LoadChain(path string) (*proof.Chain, error)

func ParseExpiry

func ParseExpiry(raw string, now time.Time) (time.Time, error)

func RecordsForAgent

func RecordsForAgent(chain *proof.Chain, agentID string) []proof.Record

func SaveChain

func SaveChain(path string, chain *proof.Chain) error

Types

type Gap added in v1.3.0

type Gap struct {
	GapID            string   `json:"gap_id" yaml:"gap_id"`
	ReasonCode       string   `json:"reason_code" yaml:"reason_code"`
	Severity         string   `json:"severity" yaml:"severity"`
	AgentID          string   `json:"agent_id" yaml:"agent_id"`
	ToolID           string   `json:"tool_id,omitempty" yaml:"tool_id,omitempty"`
	ToolType         string   `json:"tool_type,omitempty" yaml:"tool_type,omitempty"`
	Org              string   `json:"org" yaml:"org"`
	Repo             string   `json:"repo,omitempty" yaml:"repo,omitempty"`
	Location         string   `json:"location,omitempty" yaml:"location,omitempty"`
	Present          bool     `json:"present" yaml:"present"`
	LifecycleState   string   `json:"lifecycle_state,omitempty" yaml:"lifecycle_state,omitempty"`
	ApprovalStatus   string   `json:"approval_status,omitempty" yaml:"approval_status,omitempty"`
	Owner            string   `json:"owner,omitempty" yaml:"owner,omitempty"`
	OwnershipStatus  string   `json:"ownership_status,omitempty" yaml:"ownership_status,omitempty"`
	WriteCapable     bool     `json:"write_capable,omitempty" yaml:"write_capable,omitempty"`
	CredentialAccess bool     `json:"credential_access,omitempty" yaml:"credential_access,omitempty"`
	Message          string   `json:"message" yaml:"message"`
	EvidenceBasis    []string `json:"evidence_basis,omitempty" yaml:"evidence_basis,omitempty"`
}

func DetectGaps added in v1.3.0

func DetectGaps(input GapInput) []Gap

type GapInput added in v1.3.0

type GapInput struct {
	Identities  []manifest.IdentityRecord
	Inventory   *agginventory.Inventory
	Transitions []Transition
}

type InventoryMutation added in v1.2.0

type InventoryMutation struct {
	Action        string
	AgentID       string
	Owner         string
	EvidenceURL   string
	ControlID     string
	Reason        string
	ReviewCadence string
	ExpiresAt     time.Time
	Now           time.Time
}

type ObservedTool

type ObservedTool struct {
	AgentID       string
	LegacyAgentID string
	ToolID        string
	ToolType      string
	Org           string
	Repo          string
	Location      string
	DataClass     string
	EndpointClass string
	AutonomyLevel string
	RiskScore     float64
}

type Transition

type Transition struct {
	AgentID       string         `json:"agent_id" yaml:"agent_id"`
	PreviousState string         `json:"previous_state" yaml:"previous_state"`
	NewState      string         `json:"new_state" yaml:"new_state"`
	Trigger       string         `json:"trigger" yaml:"trigger"`
	Diff          map[string]any `json:"diff,omitempty" yaml:"diff,omitempty"`
	Timestamp     string         `json:"timestamp" yaml:"timestamp"`
}

func ApplyInventoryMutation added in v1.2.0

func ApplyInventoryMutation(m manifest.Manifest, mutation InventoryMutation) (manifest.Manifest, Transition, error)

func ApplyManualState

func ApplyManualState(m manifest.Manifest, agentID, state, approver, scope, reason string, expiresAt time.Time, now time.Time) (manifest.Manifest, Transition, error)

func Reconcile

func Reconcile(previous manifest.Manifest, observed []ObservedTool, now time.Time) (manifest.Manifest, []Transition)

Jump to

Keyboard shortcuts

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