remediation

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempFile

func CreateTempFile(filePathCopyFrom, tmpFilePath string) string

CreateTempFile creates a temporary file with the content as the file pointed in the filePathCopyFrom

Types

type File

type File struct {
	FilePath        string `json:"file_name"`
	Line            int    `json:"line"`
	Remediation     string `json:"remediation"`
	RemediationType string `json:"remediation_type"`
	SimilarityID    string `json:"similarity_id"`
	SearchKey       string `json:"search_key"`
	ExpectedValue   string `json:"expected_value"`
	ActualValue     string `json:"actual_value"`
}

File presents the result information related to the file

type Query

type Query struct {
	Files   []File `json:"files"`
	QueryID string `json:"query_id"`
}

Query includes all the files that presents a result related to the queryID

type Remediation

type Remediation struct {
	Line          int
	Remediation   string
	SimilarityID  string
	QueryID       string
	SearchKey     string
	ExpectedValue string
	ActualValue   string
}

Remediation presents all the relevant information for the fix

type ReplacementInfo

type ReplacementInfo struct {
	Before string `json:"before"`
	After  string `json:"after"`
}

ReplacementInfo presents the relevant information to do the replacement

type Report

type Report struct {
	Queries []Query `json:"queries"`
}

Report includes all query results

type Set

type Set struct {
	Replacement []Remediation
	Addition    []Remediation
}

Set includes all the replacements and additions related to a file

type Summary

type Summary struct {
	SelectedRemediationNumber   int
	ActualRemediationDoneNumber int
}

Summary represents the information about the number of selected remediation and remediation done

func (*Summary) GetRemediationSets

func (s *Summary) GetRemediationSets(results Report, include []string) map[string]interface{}

GetRemediationSets collects all the replacements and additions per file

func (*Summary) GetRemediationSetsFromVulns

func (s *Summary) GetRemediationSetsFromVulns(vulnerabilities []model.Vulnerability, include []string) map[string]interface{}

GetRemediationSetsFromVulns collects all the replacements and additions per file from []model.Vulnerability

func (*Summary) RemediateFile

func (s *Summary) RemediateFile(filePath string, remediationSet Set) error

RemediateFile remediationSets the replacements first and secondly, the additions sorted down

Jump to

Keyboard shortcuts

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