report

package
v0.0.0-...-d04516c Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeEmpty  = ReportType("empty")
	TypeRaw    = ReportType("raw")
	TypeMulti  = ReportType("multi")
	TypeIssues = ReportType("issues")
	TypeTechs  = ReportType("techs")
)
View Source
const (
	SeverityInfo   = Severity("info")
	SeverityLow    = Severity("low")
	SeverityMedium = Severity("medium")
	SeverityHigh   = Severity("high")
	SeverityError  = Severity("error")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Extra

type Extra struct {
	Url   string `json:"url" description:""`
	Title string `json:"title"`
}

type HttpBody

type HttpBody struct {
	ContentEncoding string `json:"contentEncoding"`
	Content         []byte `json:"content"`
}

type HttpEntity

type HttpEntity struct {
	Status string      `json:"status"`
	Header http.Header `json:"header"`
	Body   *HttpBody   `json:"body,omitempty"`
}

type HttpTransaction

type HttpTransaction struct {
	Id       int         `json:"id,omitempty"`
	Method   string      `json:"method"`
	Request  *HttpEntity `json:"request,omitempty"`
	Response *HttpEntity `json:"response,omitempty"`
}

type Issue

type Issue struct {
	Severity         Severity           `json:"severity"`
	Summary          string             `json:"summary"`
	Desc             string             `json:"desc,omitempty"`
	Urls             []*Url             `json:"urls,omitempty" description:"where this issue is happened"`
	Extras           []*Extra           `json:"extras,omitempty" bson:"extras" description:"information about vulnerability"`
	HttpTransactions []*HttpTransaction `json:"httpTransactions,omitempty" bson:"httpTransactions"`
}

type Raw

type Raw struct {
	Raw   string       `json:"raw"`
	Files []*file.Meta `json:"files,omitempty" bson:"files,omitempty"`
}

type Report

type Report struct {
	Id          bson.ObjectId `json:"id,omitempty" bson:"_id"`
	Type        ReportType    `json:"type" description:"one of [raw,issues,techs,multi,empty]"`
	Created     time.Time     `json:"created,omitempty" description:"when report is created"`
	Updated     time.Time     `json:"updated,omitempty" description:"when report is updated"`
	Scan        bson.ObjectId `json:"scan,omitempty" description:"scan id"`
	ScanSession bson.ObjectId `json:"scanSession,omitempty" bson:"scanSession" description:"scan session id"`

	Raw `json:",inline,omitempty" bson:"raw,inline"`

	Multi  []*Report `json:"multi,omitempty" bson:"multi,omitempty"`
	Issues []*Issue  `json:"issues,omitempty" bson:"issues,omitempty"`
	Techs  []*Tech   `json:"techs,omitempty"`
}

func (*Report) SetScan

func (r *Report) SetScan(scanId bson.ObjectId)

set scan to report and all multi reports if they are existed

func (*Report) SetScanSession

func (r *Report) SetScanSession(sessionId bson.ObjectId)

type ReportList

type ReportList struct {
	pagination.Meta `json:",inline"`
	Results         []*Report `json:"results"`
}

type ReportType

type ReportType string

func (ReportType) Convert

func (t ReportType) Convert(text string) (interface{}, error)

func (ReportType) Enum

func (t ReportType) Enum() []interface{}

func (ReportType) MarshalJSON

func (t ReportType) MarshalJSON() ([]byte, error)

It's a hack to show custom type as string in swagger

type Severity

type Severity string

func (Severity) Convert

func (t Severity) Convert(text string) (interface{}, error)

func (Severity) Enum

func (t Severity) Enum() []interface{}

func (Severity) MarshalJSON

func (t Severity) MarshalJSON() ([]byte, error)

It's a hack to show custom type as string in swagger

type Tech

type Tech struct {
	Categories []tech.Category `json:"categories,omitempty"`
	Name       string          `json:"name"`
	Version    string          `json:"version"`
	Confidence int             `json:"confidence"`
	Icon       string          `json:"icon,omitempty" description:"base64 image"`
	Url        string          `json:"url" description:"url to technology"`
}

type Url

type Url struct {
	Url string `json:"url"`
}

Jump to

Keyboard shortcuts

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