Documentation ¶
Overview ¶
Package tasks contains all implementations of tasks; these are instantiated and run from the main package
Index ¶
- Constants
- func IsVulnerabilityExportExcluded(excluded []string, vulnID string) bool
- func JoinNotes(s model.Statement) string
- func LinksAsCSV(s model.Statement) string
- type BaseTask
- type CreateTask
- type ExportTask
- func (t *ExportTask) Execute() (success bool)
- func (t *ExportTask) WithDenylist(bl []string) *ExportTask
- func (t *ExportTask) WithExportScripts(scripts []conf.ExportScript) *ExportTask
- func (t *ExportTask) WithOutputFile(filename string) *ExportTask
- func (t *ExportTask) WithSource(s string) *ExportTask
- func (t *ExportTask) WithTarget(target string) *ExportTask
- type ImportTask
- type Importer
- type ImporterPool
- type MergeTask
- type PullTask
- type SetupTask
- type SteadyAffectedLib
- type SteadyLibID
- type Task
Constants ¶
const (
// BugsEndpoint is the endpoint for the rest-backend API to fetch bugs
BugsEndpoint = "/bugs"
)
const GUIPort string = "3001"
GUIPort is the port (on localhost) on which the Statement creation wizart will be exposed
Variables ¶
This section is empty.
Functions ¶
func IsVulnerabilityExportExcluded ¶
IsVulnerabilityExportExcluded checks if a vulnerability id should be excluded from the export
Types ¶
type BaseTask ¶
type BaseTask struct {
// contains filtered or unexported fields
}
BaseTask defines the basis for all task implementations
type CreateTask ¶
type CreateTask struct { BaseTask // contains filtered or unexported fields }
CreateTask is the task that performs merging of statements, reconciling any conflicts using a set of pre-defined policies.
func (*CreateTask) Execute ¶
func (t *CreateTask) Execute() (success bool)
Execute performs the actual task and returns true on success
func (*CreateTask) WithGUI ¶
func (t *CreateTask) WithGUI(enableGUI bool) *CreateTask
WithGUI enables a graphical UI to create the new statement
func (*CreateTask) WithVulnerabilityID ¶ added in v0.6.3
func (t *CreateTask) WithVulnerabilityID(id string) *CreateTask
WithVulnerabilityID sets the ID of the vulnerability we're creating a statement for
type ExportTask ¶
type ExportTask struct { BaseTask // contains filtered or unexported fields }
ExportTask is the task that generates a script to import statements into 3rd-party systems
func (*ExportTask) Execute ¶
func (t *ExportTask) Execute() (success bool)
Execute performs the actual merge task and returns true on success The task supports both exporting sets of statements and individual statements. To export sets of statements, the source must be a directory containing either statements or subdirectories that contain, each, a statement. A source can also be an individual statement file. If no source is specified, the task aborts. If a default directory must be considered, it must be set in the calling command.
func (*ExportTask) WithDenylist ¶
func (t *ExportTask) WithDenylist(bl []string) *ExportTask
WithDenylist sets the identifiers of vulnerabilities to exclude from the export
func (*ExportTask) WithExportScripts ¶
func (t *ExportTask) WithExportScripts(scripts []conf.ExportScript) *ExportTask
WithExportScripts passes the export script templates to the task
func (*ExportTask) WithOutputFile ¶
func (t *ExportTask) WithOutputFile(filename string) *ExportTask
WithOutputFile sets the name of the file that the export will produce
func (*ExportTask) WithSource ¶
func (t *ExportTask) WithSource(s string) *ExportTask
WithSource sets the source to export from
func (*ExportTask) WithTarget ¶
func (t *ExportTask) WithTarget(target string) *ExportTask
WithTarget sets the target type
type ImportTask ¶
type ImportTask struct { BaseTask // contains filtered or unexported fields }
ImportTask is the task that performs exporting of vulnerability information from a Steady backend or database, and produces a text-based (YAML) representation, useful for further processing (e.g., manual inspection, uploading to a repository, analysis, etc.)
func (*ImportTask) Execute ¶
func (t *ImportTask) Execute() (success bool)
Execute performs the actual task and returns true on success
func (*ImportTask) WithBackend ¶
func (t *ImportTask) WithBackend(backend string) *ImportTask
WithBackend sets the URL of the backend from which data will be imported
func (*ImportTask) WithConcurrency ¶
func (t *ImportTask) WithConcurrency(c int) *ImportTask
WithConcurrency sets the number of concurrent importers
func (*ImportTask) WithLimit ¶
func (t *ImportTask) WithLimit(l int) *ImportTask
WithLimit sets the maximum number of statements that will be imported
func (*ImportTask) WithOutputPath ¶
func (t *ImportTask) WithOutputPath(p string) *ImportTask
WithOutputPath sets the path to which the imported data will be saved
type Importer ¶
type Importer struct { Backend string `yaml:"backend"` Bugs []*model.Bug Statements map[string]model.Statement SkippedStatements []model.Statement Client *http.Client Filter map[string][]*regexp.Regexp ProgressBar *progressbar.ProgressBar Verbose bool }
Importer is used to download and convert bugs to statements. Each exporter instance gets a slice of bugs to fetch. Multiple importers can be used ad once, as part of a pool of importers (ImporterPool).
type ImporterPool ¶
type ImporterPool []Importer
ImporterPool is a pool of importers
func NewImporterPool ¶
func NewImporterPool(backend string, concurrent int, limit int, filter map[string][]*regexp.Regexp, verbose bool) (*ImporterPool, error)
NewImporterPool instantiates a pool of Exporters, each taking care of fetching vulnerability data for a subset of the overall set of vulnerabilities stored in the Steady backend.
type MergeTask ¶
type MergeTask struct { BaseTask // contains filtered or unexported fields }
MergeTask is the task that performs merging of statements, reconciling any conflicts using a set of pre-defined policies.
func NewMergeTask ¶
func NewMergeTask() (mergeTask *MergeTask)
NewMergeTask constructs a new MergeTask
func (*MergeTask) WithPolicy ¶
WithPolicy sets the policy to be used to merge sources
type PullTask ¶
type PullTask struct { BaseTask // contains filtered or unexported fields }
PullTask is the task that performs merging of statements, reconciling any conflicts using a set of pre-defined policies.
type SetupTask ¶
type SetupTask struct { BaseTask // contains filtered or unexported fields }
SetupTask is the task that performs merging of statements, reconciling any conflicts using a set of pre-defined policies.
func (*SetupTask) WithForce ¶ added in v0.6.1
WithForce sets the flag that controls whether the setup should be done even if a configuration file is already existing (in which case, it will be overwritten)
func (*SetupTask) WithInteractiveMode ¶
WithInteractiveMode enables interactive mode
type SteadyAffectedLib ¶
type SteadyAffectedLib struct { LibraryID SteadyLibID `json:"libraryId"` Affected bool `json:"affected"` Explanation string `json:"explanation"` Source string `json:"source"` }
SteadyAffectedLib represents an affected artifact as represented in the output of the Steady API /backend/bugs/CVE-2019-0232/affectedLibIds?onlyWellKnown=true
type SteadyLibID ¶
type SteadyLibID struct { ArtifactID string `json:"artifact"` GroupID string `json:"group"` Version string `json:"version"` }
SteadyLibID represents a GAV in the output of the Steady API