report

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const DashboardPath = "dashboard.html"
View Source
const DetailsPath = "assets/index.html"
View Source
const ManageAssetsPath = "assets/edit-assets.html"

Variables

View Source
var (
	ColorRed        = drawing.ColorFromHex("f44336")
	ColorPurple     = drawing.ColorFromHex("9c27b0")
	ColorIndigo     = drawing.ColorFromHex("3f51b5")
	ColorLightBlue  = drawing.ColorFromHex("03a9f4")
	ColorTeal       = drawing.ColorFromHex("009688")
	ColorLightGreen = drawing.ColorFromHex("8bc34a")
	ColorYellow     = drawing.ColorFromHex("ffeb3b")
	ColorOrange     = drawing.ColorFromHex("ff9800")

	ColorPink       = drawing.ColorFromHex("e91e63")
	ColorDeepPurple = drawing.ColorFromHex("673ab7")
	ColorBlue       = drawing.ColorFromHex("2196f3")
	ColorCyan       = drawing.ColorFromHex("00bcd4")
	ColorGreen      = drawing.ColorFromHex("4caf50")
	ColorLime       = drawing.ColorFromHex("cddc39")
	ColorAmber      = drawing.ColorFromHex("ffc107")
	ColorDeepOrange = drawing.ColorFromHex("ff5722")
	ColorGrey       = drawing.ColorFromHex("9e9e9e")

	ColorBrown    = drawing.ColorFromHex("795548")
	ColorBlueGrey = drawing.ColorFromHex("607d8b")
	ColorWhite    = drawing.ColorFromHex("ffffff")
	ColorBlack    = drawing.ColorFromHex("000000")

	MaterialPalette = []drawing.Color{
		ColorRed,
		ColorPurple,
		ColorIndigo,
		ColorLightBlue,
		ColorTeal,
		ColorLightGreen,
		ColorYellow,
		ColorOrange,

		ColorPink,
		ColorDeepPurple,
		ColorBlue,
		ColorCyan,
		ColorGreen,
		ColorLime,
		ColorAmber,
		ColorDeepOrange,
		ColorGrey,

		ColorBrown,
		ColorBlueGrey,
		ColorWhite,
		ColorBlack,
	}

	BulmaPalette = []drawing.Color{
		drawing.ColorFromHex("00D1B2"),
		drawing.ColorFromHex("3273DC"),
		drawing.ColorFromHex("23D160"),
		drawing.ColorFromHex("FFDD57"),
		drawing.ColorFromHex("FF3860"),
		drawing.ColorFromHex("363636"),
	}
)

Material design color palette, according to: http://htmlcolorcodes.com/color-chart/

Functions

func ChartToBytes

func ChartToBytes(v interface{}) ([]byte, error)

func GenerateFullReport

func GenerateFullReport(conf config.Config, awsConfig *aws.Config, folder string, reportData *vulcan.ReportData, teamName string) (string, error)

GenerateFullReport generates the html report suitable to be published as a static web page. Returns the url or the file path, depending on configuration, where the report generated is stored.

func GenerateLocalFilePathAndRemoteURL added in v1.0.1

func GenerateLocalFilePathAndRemoteURL(proxy, bucket, folder, localTempDir, filename, extension string) (string, string, error)

func GenerateOverview

func GenerateOverview(conf config.Config, awsConfig *aws.Config, folder string, reportData *vulcan.ReportData, teamName, teamID, scanID string) (string, error)

GenerateOverview generates content of the overview report suitable to be send as email. Returns the url or the file path, depending on configuration, where the report generated is stored.

func RiskToActionString

func RiskToActionString(risk int) string

Types

type AssetVulns

type AssetVulns struct {
	Asset string                 `json:"asset" xml:"asset"`
	Count VulnsCount             `json:"vulnerabilities_count" xml:"vulnerabilities_count"`
	Vulns []vulcan.Vulnerability `json:"vulnerabilities" xml:"vulnerabilities"`
}

type Chart

type Chart struct {
	ImageURL string
	Values   []chart.Value
}

type FullReport

type FullReport struct {
	Jira                string      `json:"-" xml:"-"`
	ContactChannel      string      `json:"-" xml:"-"`
	ContactEmail        string      `json:"-" xml:"-"`
	LocalTempDir        string      `json:"-" xml:"-"`
	PublicResourcesPath string      `json:"-" xml:"-"`
	Bucket              string      `json:"-" xml:"-"`
	Folder              string      `json:"-" xml:"-"`
	Filename            string      `json:"-" xml:"-"`
	Extension           string      `json:"-" xml:"-"`
	Proxy               string      `json:"-" xml:"-"`
	UploadToS3          bool        `json:"-" xml:"-"`
	AWSConfig           *aws.Config `json:"-" xml:"-"`

	Risk                    vulcanreport.SeverityRank `json:"risk" xml:"risk"`
	ScanID                  string                    `json:"scan_id" xml:"scan_id"`
	ScanTime                string                    `json:"scan_time" xml:"scan_time"`
	TeamName                string                    `json:"team_name" xml:"team_name"`
	Vulnerabilities         int                       `json:"vulnerabilities" xml:"vulnerabilities"`
	VulnerabilitiesPerAsset []AssetVulns              `json:"assets" xml:"assets"`
	Groups                  []Group                   `json:"groups" xml:"groups"`

	GAID string `json:"-" xml:"-"`

	HomeURL           string `json:"-" xml:"-"`
	JSONExportURL     string `json:"-" xml:"-"`
	ManageAssetsURL   string `json:"-" xml:"-"`
	DetailsURL        string `json:"-" xml:"-"`
	DashboardURL      string `json:"-" xml:"-"`
	DocumentationLink string `json:"-" xml:"-"`
	RoadmapLink       string `json:"-" xml:""`
}

func (*FullReport) Generate

func (fr *FullReport) Generate() (string, error)

func (*FullReport) Regenerate

func (fr *FullReport) Regenerate() (string, error)

type Group

type Group struct {
	Summary         string                 `json:"summary" xml:"summary"`
	Recommendations []string               `json:"recommendations" xml:"recommendations"`
	Vulns           []vulcan.Vulnerability `json:"vulnerabilities" xml:"vulnerabilities"`
}

type HistoricalChart

type HistoricalChart struct {
	ImageURL string
	Values   []float64
	Dates    []time.Time
}

type Overview

type Overview struct {
	LocalTempDir string

	Bucket         string
	Folder         string
	Filename       string
	Extension      string
	LinkFullReport string
	CompanyName    string
	SupportEmail   string
	ContactEmail   string
	ContactChannel string
	Proxy          string
	UploadToS3     bool
	AWSConfig      *aws.Config

	ScanID   string
	TeamID   string
	TeamName string

	ActionRequired       string
	ActionRequiredStyle  string
	ImpactLevel          string
	ImpactLevelStyle     string
	VulnerabilitiesCount string

	TopVulnerabilities     []vulcan.VulnerabilityCount
	VulnerabilityPerImpact Chart
	VulnerabilityPerAsset  Chart
	VulnerableAssetsChart  HistoricalChart
	ImpactLevelChart       HistoricalChart
}

Overview ...

func (*Overview) Generate

func (o *Overview) Generate() (string, error)

func (*Overview) HandleImpactLevelChart

func (o *Overview) HandleImpactLevelChart() error

func (*Overview) HandleVulnerabilityPerAsset

func (o *Overview) HandleVulnerabilityPerAsset() error

func (*Overview) HandleVulnerabilityPerImpact

func (o *Overview) HandleVulnerabilityPerImpact() error

func (*Overview) HandleVulnerableAssetsChart

func (o *Overview) HandleVulnerableAssetsChart() error

type VulnsCount

type VulnsCount struct {
	Info     int `json:"info" xml:"info"`
	Low      int `json:"low" xml:"low"`
	Medium   int `json:"medium" xml:"medium"`
	High     int `json:"high" xml:"high"`
	Critical int `json:"critical" xml:"critical"`
	Issues   int `json:"total" xml:"total"`
}

Jump to

Keyboard shortcuts

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