scan

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	SourcePath  string   `json:"source_path"`
	Models      []string `json:"models,omitempty"`
	Tools       []string `json:"tools,omitempty"`
	Identity    string   `json:"identity,omitempty"`
	MCPServer   string   `json:"mcp_server,omitempty"`
	Environment string   `json:"environment,omitempty"`
	Owner       string   `json:"owner,omitempty"`
	Confidence  float64  `json:"confidence"`
}

type Evidence

type Evidence struct {
	Path string `json:"path"`
	Line int    `json:"line"`
}

type Finding

type Finding struct {
	ID                   string     `json:"id"`
	RuleID               string     `json:"rule_id"`
	Severity             string     `json:"severity"`
	Message              string     `json:"message"`
	AgentID              string     `json:"agent_id"`
	Confidence           float64    `json:"confidence"`
	Evidence             []Evidence `json:"evidence"`
	RemediationHint      string     `json:"remediation_hint"`
	Suppressed           bool       `json:"suppressed,omitempty"`
	SuppressionReason    string     `json:"suppression_reason,omitempty"`
	SuppressionExpiresAt string     `json:"suppression_expires_at,omitempty"`
}

type Identity

type Identity struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	SourcePath string `json:"source_path"`
}

type MCPServer

type MCPServer struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	Approved   bool     `json:"approved"`
	Transport  string   `json:"transport,omitempty"`
	AuthMethod string   `json:"auth_method,omitempty"`
	Tools      []string `json:"tools,omitempty"`
	SourcePath string   `json:"source_path"`
}

type Model

type Model struct {
	ID         string `json:"id"`
	Provider   string `json:"provider"`
	Name       string `json:"name"`
	SourcePath string `json:"source_path"`
}

type Options

type Options struct {
	DryRun          bool
	ConfigPath      string
	DebugWriter     io.Writer
	SuppressionPath string
}

type Relationship

type Relationship struct {
	ID         string   `json:"id"`
	FromType   string   `json:"from_type"`
	FromID     string   `json:"from_id"`
	EdgeType   string   `json:"edge_type"`
	ToType     string   `json:"to_type"`
	ToID       string   `json:"to_id"`
	Evidence   Evidence `json:"evidence"`
	Confidence float64  `json:"confidence"`
}

type Report

type Report struct {
	SchemaVersion string         `json:"schema_version"`
	Root          string         `json:"root"`
	ReadOnly      bool           `json:"read_only"`
	MetadataOnly  bool           `json:"metadata_only"`
	FilesScanned  int            `json:"files_scanned"`
	FilesSkipped  int            `json:"files_skipped"`
	Sources       []Source       `json:"sources,omitempty"`
	Agents        []Agent        `json:"agents"`
	Models        []Model        `json:"models,omitempty"`
	Identities    []Identity     `json:"identities,omitempty"`
	MCPServers    []MCPServer    `json:"mcp_servers,omitempty"`
	Relationships []Relationship `json:"relationships,omitempty"`
	Findings      []Finding      `json:"findings"`
	ReadFiles     []string       `json:"read_files,omitempty"`
}

func Run

func Run(root string, options Options) (Report, error)

func (Report) SARIF

func (r Report) SARIF() ([]byte, error)

SARIF returns a deterministic SARIF 2.1.0 log for the report findings.

func (Report) Text

func (r Report) Text() string

type Source

type Source struct {
	ID         string `json:"id"`
	Type       string `json:"type"`
	Path       string `json:"path"`
	TrustLevel string `json:"trust_level"`
}

Jump to

Keyboard shortcuts

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