model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KindTerraform FileKind = "TF"
	KindJSON      FileKind = "JSON"
	KindYAML      FileKind = "YAML"

	SeverityHigh   = "HIGH"
	SeverityMedium = "MEDIUM"
	SeverityLow    = "LOW"
	SeverityInfo   = "INFO"

	IssueTypeMissingAttribute   IssueType = "MissingAttribute"
	IssueTypeRedundantAttribute IssueType = "RedundantAttribute"
	IssueTypeIncorrectValue     IssueType = "IncorrectValue"
)

Variables

Functions

This section is empty.

Types

type Counters

type Counters struct {
	ScannedFiles           int `json:"files_scanned"`
	ParsedFiles            int `json:"files_parsed"`
	FailedToScanFiles      int `json:"files_failed_to_scan"`
	TotalQueries           int `json:"queries_total"`
	FailedToExecuteQueries int `json:"queries_failed_to_execute"`
}

type Document

type Document map[string]interface{}

func (Document) MarshalEasyJSON

func (v Document) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Document) MarshalJSON

func (v Document) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Document) UnmarshalEasyJSON

func (v *Document) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Document) UnmarshalJSON

func (v *Document) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Documents

type Documents struct {
	Documents []Document `json:"document"`
}

func (Documents) MarshalEasyJSON

func (v Documents) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Documents) MarshalJSON

func (v Documents) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Documents) UnmarshalEasyJSON

func (v *Documents) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Documents) UnmarshalJSON

func (v *Documents) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Extensions

type Extensions map[string]struct{}

func (Extensions) Include

func (e Extensions) Include(ext string) bool

func (Extensions) MatchedFilesRegex

func (e Extensions) MatchedFilesRegex() string

type FileKind

type FileKind string

type FileMetadata

type FileMetadata struct {
	ID           string `db:"id"`
	ScanID       string `db:"scan_id"`
	Document     Document
	OriginalData string   `db:"orig_data"`
	Kind         FileKind `db:"kind"`
	FileName     string   `db:"file_name"`
}

type FileMetadatas

type FileMetadatas []FileMetadata

func (FileMetadatas) Combine

func (m FileMetadatas) Combine() Documents

func (FileMetadatas) ToMap

func (m FileMetadatas) ToMap() map[string]FileMetadata

type IssueType

type IssueType string

type QueryMetadata

type QueryMetadata struct {
	Query    string
	Content  string
	Metadata map[string]interface{}
}

type Severity

type Severity string

type SeverityCounter

type SeverityCounter struct {
	Severity Severity `json:"severity"`
	Counter  int      `json:"counter"`
}

type SeveritySummary

type SeveritySummary struct {
	ScanID           string            `json:"scanId"`
	SeverityCounters []SeverityCounter `json:"severityCounters"`
	TotalCounter     int               `json:"totalCounter"`
}

type Summary

type Summary struct {
	Counters
	Queries []VulnerableQuery `json:"queries"`
}

func CreateSummary

func CreateSummary(counters Counters, vulnerabilities []Vulnerability) Summary

type Vulnerability

type Vulnerability struct {
	ID               int       `json:"id"`
	ScanID           string    `db:"scan_id" json:"-"`
	FileID           string    `db:"file_id" json:"-"`
	FileName         string    `db:"file_name" json:"fileName"`
	QueryID          string    `db:"query_id" json:"queryID"`
	QueryName        string    `db:"query_name" json:"queryName"`
	Severity         Severity  `json:"severity"`
	Line             int       `json:"line"`
	IssueType        IssueType `db:"issue_type" json:"issueType"`
	SearchKey        string    `db:"search_key" json:"searchKey"`
	KeyExpectedValue string    `db:"key_expected_value" json:"expectedValue"`
	KeyActualValue   string    `db:"key_actual_value" json:"actualValue"`
	Value            *string   `db:"value" json:"value"`
	Output           string    `json:"-"`
}

type VulnerableFile

type VulnerableFile struct {
	FileName         string    `json:"file_name"`
	Line             int       `json:"line"`
	IssueType        IssueType `json:"issue_type"`
	SearchKey        string    `json:"search_key"`
	KeyExpectedValue string    `json:"expected_value"`
	KeyActualValue   string    `json:"actual_value"`
	Value            *string   `json:"value"`
}

type VulnerableQuery

type VulnerableQuery struct {
	QueryName string           `json:"query_name"`
	QueryID   string           `json:"query_id"`
	Severity  Severity         `json:"severity"`
	Files     []VulnerableFile `json:"files"`
}

Jump to

Keyboard shortcuts

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