model

package
v0.0.0-...-37aa375 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AnnotationReportName      = "fuzzer_report"
	AnnotationFindingsName    = "fuzzer_findings"
	OneHundredPercentConstant = 100
	ReportNameCRUDPrefix      = "definitions:"
	ReportNameSCNFuzzerPrefix = "path:"
	ReportNameRestlerPrefix   = "restler"
	MinLocationTokensNumber   = 4
	DefaultErrorMsg           = "An error occurred during the test"
)

Variables

View Source
var ZeroTime = time.Time{}.Unix()

ZeroTime The zero timestamp to use.

Functions

func AddFindingOnShortReport

func AddFindingOnShortReport(shortReport *restapi.ShortTestReport, path string, verb string, finding restapi.RawFindings) error

func ConvertRawFindingToAPIFinding

func ConvertRawFindingToAPIFinding(finding restapi.RawFindings) *common.APIFinding

func CopyTestFromTestWithReport

func CopyTestFromTestWithReport(fullTest restapi.TestWithReport) restapi.Test

func NewFinding

func NewFinding(name string, description string, risk string) restapi.Finding

func NewRawFindings

func NewRawFindings(message string, severity string, findingType string) restapi.RawFindings

func NewReport

func NewReport() restapi.FuzzingStatusAndReport

Types

type API

type API struct {
	ID        uint
	Name      string
	Port      uint
	Namespace string
	Fuzzed    bool
	InFuzzing bool
	TestsList []*TestItem
}

func NewAPI

func NewAPI(id uint, name string, port uint, namespace string) API

func (*API) AddErrorOnLastTest

func (api *API) AddErrorOnLastTest(fuzzerError error)

func (*API) AddNewStatusReport

func (api *API) AddNewStatusReport(report restapi.FuzzingStatusAndReport) error

func (*API) ForceProgressForLastTest

func (api *API) ForceProgressForLastTest(progress int) error

func (*API) GetLastAPIFindings

func (api *API) GetLastAPIFindings() *[]common.APIFinding

func (*API) GetLastFindings

func (api *API) GetLastFindings() *[]restapi.Finding

func (*API) GetLastReport

func (api *API) GetLastReport() *restapi.FuzzingStatusAndReport

func (*API) GetLastShortStatus

func (api *API) GetLastShortStatus() (*restapi.ShortTestReport, error)

func (*API) GetLastStatus

func (api *API) GetLastStatus() (restapi.FuzzingStatusEnum, error)

func (*API) GetLastStatusError

func (api *API) GetLastStatusError() (string, error)

func (*API) GetLastTest

func (api *API) GetLastTest() *restapi.TestWithReport

func (*API) GetShortStatusOnError

func (api *API) GetShortStatusOnError(msg string) (*restapi.ShortTestReport, error)

func (*API) GetTestByTimestamp

func (api *API) GetTestByTimestamp(timestamp int64) *restapi.TestWithReport

func (*API) GetTestShortReportByTimestamp

func (api *API) GetTestShortReportByTimestamp(timestamp int64) (*restapi.ShortTestReport, error)

func (*API) GetTestsList

func (api *API) GetTestsList() *[]restapi.Test

Return a list of tests with reduced informations.

func (*API) RetrieveInfoFromStore

func (api *API) RetrieveInfoFromStore(ctx context.Context, accessor core.BackendAccessor, moduleName string) error

func (*API) SetErrorForLastStatus

func (api *API) SetErrorForLastStatus(msg string) error

func (*API) StartFuzzing

func (api *API) StartFuzzing(params *FuzzingInput) (FuzzingTimestamp, error)

func (*API) StopFuzzing

func (api *API) StopFuzzing(fuzzerError error) error

func (*API) StoreLastFindingsData

func (api *API) StoreLastFindingsData(ctx context.Context, accessor core.BackendAccessor, moduleName string, data []byte) error

func (*API) StoreReportData

func (api *API) StoreReportData(ctx context.Context, accessor core.BackendAccessor, moduleName string, data restapi.FuzzingStatusAndReport) error

type FuzzingInput

type FuzzingInput struct {
	Auth      *restapi.AuthorizationScheme
	Depth     restapi.TestInputDepthEnum
	SpecsInfo *tools.FuzzerSpecsInfo
}

FuzzingInput: a struct to store all input parameters for fuzzing.

type FuzzingTimestamp

type FuzzingTimestamp = int64

FuzzingTimestamp the type used for our Timestamp.

type Model

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

Model: The Model struct.

func NewModel

func NewModel(ctx core.BackendAccessor) *Model

func (*Model) AddAPI

func (m *Model) AddAPI(id uint, name string, port uint, service string) *API

func (*Model) AddAPITest

func (m *Model) AddAPITest(apiID uint, message string) error

func (*Model) GetAPI

func (m *Model) GetAPI(ctx context.Context, apiID uint) (*API, error)

func (*Model) Init

func (m *Model) Init(ctx context.Context) error

func (*Model) ReceiveFullReport

func (m *Model) ReceiveFullReport(ctx context.Context, apiID uint, body []byte) error

func (*Model) StartAPIFuzzing

func (m *Model) StartAPIFuzzing(ctx context.Context, apiID uint, params *FuzzingInput) (FuzzingTimestamp, error)

func (*Model) StopAPIFuzzing

func (m *Model) StopAPIFuzzing(ctx context.Context, apiID uint, fuzzerError error) error

type TestItem

type TestItem struct {
	Test      *restapi.TestWithReport
	SpecsInfo *tools.FuzzerSpecsInfo
}

* A TestItem will link a report with the corresponding spec that generate the report.

func NewTest

func NewTest() *TestItem

Jump to

Keyboard shortcuts

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