ScannerScaffolding

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfiguration

type BuildConfiguration struct {
	CommitId      string `json:"commit_id"`
	RepositoryUrl string `json:"repository_url"`
	Branch        string `json:"branch"`
}

type EngineStatus

type EngineStatus struct {
	LastSuccessfulConnection      time.Time `json:"last_successful_connection"`
	HadSuccessfulEngineConnection bool      `json:"had_successful_connection"`
}

type Finding

type Finding struct {
	Id          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Location    string                 `json:"location"`
	Severity    string                 `json:"severity"`
	Category    string                 `json:"category"`
	OsiLayer    string                 `json:"osi_layer"`
	Hint        string                 `json:"hint"`
	Reference   Reference              `json:"reference"`
	Attributes  map[string]interface{} `json:"attributes"`
}

type JobFailure

type JobFailure struct {
	JobId        string
	ErrorMessage string
	ErrorDetails string
}

type JobResult

type JobResult struct {
	JobId       string
	Findings    []Finding
	RawFindings string
}

type Reference

type Reference struct {
	Id     string `json:"id"`
	Source string `json:"source"`
}

type Result

type Result struct {
	Findings    []Finding `json:"findings"`
	RawFindings string    `json:"rawFindings"`
	ScannerId   string    `json:"scannerId"`
	ScannerType string    `json:"scannerType"`
}

type ScanError

type ScanError struct {
	ErrorMessage string `json:"errorMessage"`
	ErrorDetails string `json:"errorDetails"`
	ScannerId    string `json:"scannerId"`
}

type ScanJob

type ScanJob struct {
	JobId   string   `json:"jobId"`
	Targets []Target `json:"targets"`
}

type ScannerConfiguration

type ScannerConfiguration struct {
	EngineUrl                string
	TaskName                 string
	ScannerType              string
	TestScannerFunctionality func() TestRun
}

type ScannerScaffolding

type ScannerScaffolding struct {
	ScannerId   string
	ScannerType string
	TaskName    string

	EngineUrl string

	Jobs     chan ScanJob
	Results  chan JobResult
	Failures chan JobFailure

	StartedAt      time.Time
	InitialTestRun TestRun
	TaskStatus     *TaskStatus
	EngineStatus   *EngineStatus
}

func CreateJobConnection

func CreateJobConnection(configuration ScannerConfiguration) ScannerScaffolding

func (*ScannerScaffolding) StartStatusServer

func (scanner *ScannerScaffolding) StartStatusServer()

type ScannerStatus

type ScannerStatus struct {
	StartedAt          time.Time          `json:"started_at"`
	WorkerId           string             `json:"worker_id"`
	Healthcheck        string             `json:"healthcheck"`
	TaskStatus         TaskStatus         `json:"status"`
	EngineStatus       EngineStatus       `json:"engine"`
	ScannerStatus      TestRun            `json:"scanner"`
	BuildConfiguration BuildConfiguration `json:"build"`
}

type Target

type Target struct {
	Name       string                 `json:"name"`
	Location   string                 `json:"location"`
	Attributes map[string]interface{} `json:"attributes"`
}

type TaskStatus

type TaskStatus struct {
	Started   int `json:"started"`
	Completed int `json:"completed"`
	Failed    int `json:"failed"`
}

type TestRun

type TestRun struct {
	Version    string `json:"version"`             // Version of Scanner
	Details    string `json:"test_run_details"`    // Description of the Test run. How was it performed?
	Successful bool   `json:"test_run_successful"` // Was the test run successful?
}

Jump to

Keyboard shortcuts

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