analysis

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BanditStartAnalysis

func BanditStartAnalysis(CID string, cOutput string)

BanditStartAnalysis analyses the output from Bandit and sets a cResult based on it.

func BrakemanStartAnalysis

func BrakemanStartAnalysis(CID string, cOutput string)

BrakemanStartAnalysis analyses the output from Brakeman and sets a cResult based on it.

func DockerRun

func DockerRun(RID string, analysis *types.Analysis, securityTest types.SecurityTest)

DockerRun starts a new container, runs a given securityTest in it and then updates AnalysisCollection.

func EnryStartAnalysis

func EnryStartAnalysis(CID string, cOutput string, RID string)

EnryStartAnalysis checks the languages of a repository, update them into mongoDB, and starts corresponding new securityTests.

func GosecStartAnalysis

func GosecStartAnalysis(CID string, cOutput string)

GosecStartAnalysis analyses the output from Gosec and sets a cResult based on it.

func MonitorAnalysis

func MonitorAnalysis(analysis *types.Analysis)

MonitorAnalysis querys an analysis every retryTick seconds to check if it has already finished.

func RetirejsStartAnalysis

func RetirejsStartAnalysis(CID string, cOutput string)

RetirejsStartAnalysis analyses the output from RetireJS and sets cResult basdes on it.

func SafetyStartAnalysis

func SafetyStartAnalysis(CID string, cOutput string)

SafetyStartAnalysis analyses the output from Safety and sets cResult based on it.

func StartAnalysis

func StartAnalysis(RID string, repository types.Repository)

StartAnalysis starts the analysis given a RID and a repository.

Types

type BanditOutput

type BanditOutput struct {
	Errors  json.RawMessage `json:"errors"`
	Results []Result        `json:"results"`
}

BanditOutput is the structs that holds the json output form bandit analysis.

type BrakemanOutput

type BrakemanOutput struct {
	Warnings []WarningItem `json:"warnings"`
}

BrakemanOutput is the struct that holds issues and stats found on a Brakeman scan.

type GosecIssue

type GosecIssue struct {
	Severity   string `json:"severity"`
	Confidence string `json:"confidence"`
	RuleID     string `json:"rule_id"`
	Details    string `json:"details"`
	File       string `json:"file"`
	Code       string `json:"code"`
	Line       string `json:"line"`
}

GosecIssue is the struct that holds all detailed information of a vulnerability found.

type GosecOutput

type GosecOutput struct {
	GosecIssues []GosecIssue
	GosecStats  GosecStats
}

GosecOutput is the struct that holds issues and stats found on a Gosec scan.

type GosecStats

type GosecStats struct {
	Files int `json:"files"`
	Lines int `json:"lines"`
	NoSec int `json:"nosec"`
	Found int `json:"found"`
}

GosecStats is the struct that holds the stats found on a Gosec scan.

type Result

type Result struct {
	Code            string `json:"code"`
	Filename        string `json:"filename"`
	IssueConfidence string `json:"issue_confidence"`
	IssueSeverity   string `json:"issue_severity"`
	IssueText       string `json:"issue_text"`
	LineNumber      int    `json:"line_number"`
	LineRange       []int  `json:"line_range"`
	TestID          string `json:"test_id"`
	TestName        string `json:"test_name"`
}

Result is the struct that holds detailed information of issues found in bandit analysis.

type RetirejsIdentifier

type RetirejsIdentifier struct {
	IssueFound string   `json:"issue"`
	Summary    string   `json:"summary"`
	CVE        []string `json:"CVE"`
}

RetirejsIdentifier is a struct that holds details on the vulnerabilities found.

type RetirejsIssue

type RetirejsIssue struct {
	File            string           `json:"file"`
	RetirejsResults []RetirejsResult `json:"results"`
}

RetirejsIssue is a struct that holds the results that were scanned and the file they came from.

type RetirejsOutput

type RetirejsOutput struct {
	RetirejsIssues []RetirejsIssue `json:"data"`
	Messages       json.RawMessage `json:"messages"`
	Errors         json.RawMessage `json:"errors"`
}

RetirejsOutput is the struct that holds issues, messages and errors found on a Retire scan.

type RetirejsResult

type RetirejsResult struct {
	Version                 string                  `json:"version"`
	Component               string                  `json:"component"`
	Detection               string                  `json:"detection"`
	RetirejsVulnerabilities []RetirejsVulnerability `json:"vulnerabilities"`
}

RetirejsResult is a struct that holds the vulnerabilities found on a component being used by the code being analysed.

type RetirejsVulnerability

type RetirejsVulnerability struct {
	Info                []string           `json:"info"`
	Below               string             `json:"below"`
	Severity            string             `json:"severity"`
	RetirejsIdentifiers RetirejsIdentifier `json:"identifiers"`
}

RetirejsVulnerability is a struct that holds info on what vulnerabilies were found.

type SafetyIssue

type SafetyIssue struct {
	Dependency string `json:"dependency"`
	Below      string `json:"vulnerable_below"`
	Version    string `json:"installed_version"`
	Comment    string `json:"description"`
	ID         string `json:"id"`
}

SafetyIssue is a struct that holds the results that were scanned and the file they came from.

type SafetyOutput

type SafetyOutput struct {
	SafetyIssues []SafetyIssue `json:"issues"`
}

SafetyOutput is the struct that holds issues, messages and errors found on a Safety scan.

type WarningItem

type WarningItem struct {
	Type       string `json:"warning_type"`
	Code       string `json:"code"`
	Message    string `json:"message"`
	File       string `json:"file"`
	Line       int    `json:"line"`
	Details    string `json:"link"`
	Confidence string `json:"confidence"`
}

WarningItem is the struct that holds all detailed information of a vulnerability found.

Jump to

Keyboard shortcuts

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