scan

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScanFilesystemTool = mcp.NewTool(
		"scan_filesystem",
		mcp.WithDescription(`Scan a local filesystem project for vulnerabilities, misconfigurations, licenses, and secrets issue using Trivy. 
Follow the instructions that are given in the response.`),
		targetString,
		scanTypeArray,
		severityArray,
		outputFormatString,
		fixedOnlyBool,
		targetTypeString("filesystem"),
		mcp.WithToolAnnotation(mcp.ToolAnnotation{
			Title: "Scan local filesystem with Trivy",
		}),
	)

	ScanImageTool = mcp.NewTool(
		"scan_image",
		mcp.WithDescription(`Scan a container image for vulnerabilities, misconfigurations, licenses, and secrets issue using Trivy
Follow the instructions that are given in the response.`),
		targetString,
		scanTypeArray,
		severityArray,
		outputFormatString,
		fixedOnlyBool,
		targetTypeString("image"),
		mcp.WithToolAnnotation(mcp.ToolAnnotation{
			Title: "Scan a container image with Trivy",
		}),
	)

	ScanRepositoryTool = mcp.NewTool(
		"scan_repository",
		mcp.WithDescription(`Scan a remote git repository for vulnerabilities, misconfigurations, licenses, and secrets issue using Trivy.
Follow the instructions that are given in the response.`),
		targetString,
		scanTypeArray,
		severityArray,
		outputFormatString,
		fixedOnlyBool,
		targetTypeString("repository"),
		mcp.WithToolAnnotation(mcp.ToolAnnotation{
			Title: "Scan a remote git repository with Trivy",
		}),
	)
)

Functions

This section is empty.

Types

type Next added in v0.0.15

type Next struct {
	Tool    string         `json:"tool,omitempty"`    // "findings.list"
	Args    map[string]any `json:"args,omitempty"`    // pre-filled args
	Why     string         `json:"why,omitempty"`     // 1 sentence hint
	Preview []string       `json:"preview,omitempty"` // first few finding IDs
}

type ScanResponse added in v0.0.15

type ScanResponse struct {
	BatchID                      string                               `json:"batch_id"`
	Fingerprint                  string                               `json:"fingerprint"` // hash of normalized content
	Counts                       map[string]map[findings.Severity]int `json:"counts"`      // by severity/category for quick glance
	AssurancePolicyFailureCounts int                                  `json:"assurance_policy_failure_counts,omitempty"`
	Meta                         map[string]string                    `json:"meta,omitempty"`
	Next                         Next                                 `json:"next"`
}

type ScanTools

type ScanTools struct {
	// contains filtered or unexported fields
}

func NewScanTools

func NewScanTools(opts flag.Options, trivyTempDir string, findingStore *findings.Store) *ScanTools

func (*ScanTools) ScanWithTrivyHandler

func (t *ScanTools) ScanWithTrivyHandler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

Jump to

Keyboard shortcuts

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