inventory

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ProductionTargetsStatusConfigured    = "configured"
	ProductionTargetsStatusNotConfigured = "not_configured"
	ProductionTargetsStatusInvalid       = "invalid"
)

Variables

This section is empty.

Functions

func KeyForFinding

func KeyForFinding(finding model.Finding) string

func ReclassifyApprovalWithMatcher added in v1.0.2

func ReclassifyApprovalWithMatcher(inv *Inventory, matcher func(Tool) bool)

ReclassifyApprovalWithMatcher applies explicit approved-list policy matching and recomputes approval summary plus dependent derived fields.

Types

type AdoptionSummary added in v1.0.2

type AdoptionSummary struct {
	OrgWide    int `json:"org_wide" yaml:"org_wide"`
	TeamLevel  int `json:"team_level" yaml:"team_level"`
	Individual int `json:"individual" yaml:"individual"`
	OneOff     int `json:"one_off" yaml:"one_off"`
}

type AgentPrivilegeMapEntry added in v1.0.2

type AgentPrivilegeMapEntry struct {
	AgentID                  string   `json:"agent_id" yaml:"agent_id"`
	ToolID                   string   `json:"tool_id" yaml:"tool_id"`
	ToolType                 string   `json:"tool_type" yaml:"tool_type"`
	Org                      string   `json:"org" yaml:"org"`
	Repos                    []string `json:"repos" yaml:"repos"`
	Permissions              []string `json:"permissions" yaml:"permissions"`
	EndpointClass            string   `json:"endpoint_class" yaml:"endpoint_class"`
	DataClass                string   `json:"data_class" yaml:"data_class"`
	AutonomyLevel            string   `json:"autonomy_level" yaml:"autonomy_level"`
	RiskScore                float64  `json:"risk_score" yaml:"risk_score"`
	WriteCapable             bool     `json:"write_capable" yaml:"write_capable"`
	CredentialAccess         bool     `json:"credential_access" yaml:"credential_access"`
	ExecCapable              bool     `json:"exec_capable" yaml:"exec_capable"`
	ProductionWrite          bool     `json:"production_write" yaml:"production_write"`
	MatchedProductionTargets []string `json:"matched_production_targets,omitempty" yaml:"matched_production_targets,omitempty"`
}

type ApprovalSummary added in v1.0.2

type ApprovalSummary struct {
	ApprovedTools        int      `json:"approved_tools" yaml:"approved_tools"`
	UnapprovedTools      int      `json:"unapproved_tools" yaml:"unapproved_tools"`
	UnknownTools         int      `json:"unknown_tools" yaml:"unknown_tools"`
	ApprovedPercent      float64  `json:"approved_percent" yaml:"approved_percent"`
	UnapprovedPercent    float64  `json:"unapproved_percent" yaml:"unapproved_percent"`
	UnknownPercent       float64  `json:"unknown_percent" yaml:"unknown_percent"`
	UnapprovedPerApprove *float64 `json:"unapproved_per_approved" yaml:"unapproved_per_approved"`
}

type BuildInput

type BuildInput struct {
	Manifest              source.Manifest
	Findings              []model.Finding
	Contexts              map[string]ToolContext
	Methodology           MethodologySummary
	RepoExposureSummaries []exposure.RepoExposureSummary
	GeneratedAt           time.Time
}

type ControlRollup added in v1.0.2

type ControlRollup struct {
	Regulation string `json:"regulation" yaml:"regulation"`
	ControlID  string `json:"control_id" yaml:"control_id"`
	Total      int    `json:"total" yaml:"total"`
	Pass       int    `json:"pass" yaml:"pass"`
	Gap        int    `json:"gap" yaml:"gap"`
	Unknown    int    `json:"unknown" yaml:"unknown"`
}

type Inventory

type Inventory struct {
	InventoryVersion      string                         `json:"inventory_version" yaml:"inventory_version"`
	GeneratedAt           string                         `json:"generated_at" yaml:"generated_at"`
	Org                   string                         `json:"org" yaml:"org"`
	Tools                 []Tool                         `json:"tools" yaml:"tools"`
	Methodology           MethodologySummary             `json:"methodology" yaml:"methodology"`
	ApprovalSummary       ApprovalSummary                `json:"approval_summary" yaml:"approval_summary"`
	AdoptionSummary       AdoptionSummary                `json:"adoption_summary" yaml:"adoption_summary"`
	RegulatorySummary     RegulatorySummary              `json:"regulatory_summary" yaml:"regulatory_summary"`
	RepoExposureSummaries []exposure.RepoExposureSummary `json:"repo_exposure_summaries" yaml:"repo_exposure_summaries"`
	PrivilegeBudget       PrivilegeBudget                `json:"privilege_budget" yaml:"privilege_budget"`
	AgentPrivilegeMap     []AgentPrivilegeMapEntry       `json:"agent_privilege_map" yaml:"agent_privilege_map"`
	Summary               Summary                        `json:"summary" yaml:"summary"`
}

func Build

func Build(input BuildInput) Inventory

type MethodologyDetector added in v1.0.2

type MethodologyDetector struct {
	ID           string `json:"id" yaml:"id"`
	Version      string `json:"version" yaml:"version"`
	FindingCount int    `json:"finding_count" yaml:"finding_count"`
}

type MethodologySummary added in v1.0.2

type MethodologySummary struct {
	WrkrVersion         string                `json:"wrkr_version" yaml:"wrkr_version"`
	ScanStartedAt       string                `json:"scan_started_at" yaml:"scan_started_at"`
	ScanCompletedAt     string                `json:"scan_completed_at" yaml:"scan_completed_at"`
	ScanDurationSeconds float64               `json:"scan_duration_seconds" yaml:"scan_duration_seconds"`
	RepoCount           int                   `json:"repo_count" yaml:"repo_count"`
	FileCountProcessed  int                   `json:"file_count_processed" yaml:"file_count_processed"`
	Detectors           []MethodologyDetector `json:"detectors" yaml:"detectors"`
}

type PermissionSurface added in v1.0.2

type PermissionSurface struct {
	Read  bool `json:"read" yaml:"read"`
	Write bool `json:"write" yaml:"write"`
	Admin bool `json:"admin" yaml:"admin"`
}

type PrivilegeBudget added in v1.0.2

type PrivilegeBudget struct {
	TotalTools            int                   `json:"total_tools" yaml:"total_tools"`
	WriteCapableTools     int                   `json:"write_capable_tools" yaml:"write_capable_tools"`
	CredentialAccessTools int                   `json:"credential_access_tools" yaml:"credential_access_tools"`
	ExecCapableTools      int                   `json:"exec_capable_tools" yaml:"exec_capable_tools"`
	ProductionWrite       ProductionWriteBudget `json:"production_write" yaml:"production_write"`
}

type ProductionWriteBudget added in v1.0.2

type ProductionWriteBudget struct {
	Configured bool   `json:"configured" yaml:"configured"`
	Status     string `json:"status" yaml:"status"`
	Count      *int   `json:"count" yaml:"count"`
}

type RegulationRollup added in v1.0.2

type RegulationRollup struct {
	Regulation string `json:"regulation" yaml:"regulation"`
	Total      int    `json:"total" yaml:"total"`
	Pass       int    `json:"pass" yaml:"pass"`
	Gap        int    `json:"gap" yaml:"gap"`
	Unknown    int    `json:"unknown" yaml:"unknown"`
}

type RegulatoryStatus added in v1.0.2

type RegulatoryStatus struct {
	Regulation string `json:"regulation" yaml:"regulation"`
	ControlID  string `json:"control_id" yaml:"control_id"`
	Status     string `json:"status" yaml:"status"`
	Rationale  string `json:"rationale" yaml:"rationale"`
}

type RegulatorySummary added in v1.0.2

type RegulatorySummary struct {
	ByRegulation []RegulationRollup `json:"by_regulation" yaml:"by_regulation"`
	ByControl    []ControlRollup    `json:"by_control" yaml:"by_control"`
}

type Summary

type Summary struct {
	TotalTools int `json:"total_tools" yaml:"total_tools"`
	HighRisk   int `json:"high_risk" yaml:"high_risk"`
	MediumRisk int `json:"medium_risk" yaml:"medium_risk"`
	LowRisk    int `json:"low_risk" yaml:"low_risk"`
}

type Tool

type Tool struct {
	ToolID            string             `json:"tool_id" yaml:"tool_id"`
	AgentID           string             `json:"agent_id" yaml:"agent_id"`
	DiscoveryMethod   string             `json:"discovery_method" yaml:"discovery_method"`
	ToolType          string             `json:"tool_type" yaml:"tool_type"`
	ToolCategory      string             `json:"tool_category" yaml:"tool_category"`
	ConfidenceScore   float64            `json:"confidence_score" yaml:"confidence_score"`
	Org               string             `json:"org" yaml:"org"`
	Repos             []string           `json:"repos" yaml:"repos"`
	Locations         []ToolLocation     `json:"locations" yaml:"locations"`
	Permissions       []string           `json:"permissions,omitempty" yaml:"permissions,omitempty"`
	PermissionSurface PermissionSurface  `json:"permission_surface" yaml:"permission_surface"`
	PermissionTier    string             `json:"permission_tier" yaml:"permission_tier"`
	RiskTier          string             `json:"risk_tier" yaml:"risk_tier"`
	AdoptionPattern   string             `json:"adoption_pattern" yaml:"adoption_pattern"`
	RegulatoryMapping []RegulatoryStatus `json:"regulatory_mapping" yaml:"regulatory_mapping"`
	EndpointClass     string             `json:"endpoint_class" yaml:"endpoint_class"`
	DataClass         string             `json:"data_class" yaml:"data_class"`
	AutonomyLevel     string             `json:"autonomy_level" yaml:"autonomy_level"`
	RiskScore         float64            `json:"risk_score" yaml:"risk_score"`
	ApprovalStatus    string             `json:"approval_status" yaml:"approval_status"`
	ApprovalClass     string             `json:"approval_classification" yaml:"approval_classification"`
	LifecycleState    string             `json:"lifecycle_state" yaml:"lifecycle_state"`
}

type ToolContext

type ToolContext struct {
	EndpointClass  string
	DataClass      string
	AutonomyLevel  string
	RiskScore      float64
	ApprovalStatus string
	LifecycleState string
}

type ToolLocation

type ToolLocation struct {
	Repo     string `json:"repo" yaml:"repo"`
	Location string `json:"location" yaml:"location"`
	Owner    string `json:"owner" yaml:"owner"`
}

Jump to

Keyboard shortcuts

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