generator

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTemperature      = 0.0
	DefaultBatchSize        = 10
	DefaultSleepOnRateLimit = 10 * time.Second
	DefaultRetryOnRateLimit = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

func New

func New(o Opts) (*Generator, error)

func (*Generator) GenerateStatements

func (g *Generator) GenerateStatements(ctx context.Context, vulns []Vulnerability, h func([]vex.Statement) error) error

type Hints

type Hints struct {
	Descriptions             []string
	Container                bool
	NotServer                bool
	UsedCommands             []string
	UnusedCommands           []string
	CompromiseOnAvailability bool // Focus on Confidentiality and Integrity
}

type Opts

type Opts struct {
	LLM              llms.Model
	Temperature      float64
	BatchSize        int // Decrease to avoid rate limit
	SleepOnRateLimit time.Duration
	RetryOnRateLimit int

	Hints Hints

	DebugDir string
}

type Vulnerability

type Vulnerability struct {
	VulnID      string `json:"vulnId"`
	PkgID       string `json:"pkgId"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	Severity    string `json:"severity,omitempty"`
}

Jump to

Keyboard shortcuts

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