configs

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_SLACK_ICON = " "

Variables

Functions

func GetConsoleEcosystemIcons

func GetConsoleEcosystemIcons() map[FindingEcosystemType]string

func GetConsoleSeverityColors

func GetConsoleSeverityColors() map[FindingSeverityType]string

func GetIconForEcosystem

func GetIconForEcosystem(ecosystem FindingEcosystemType, ecosystems []EcosystemConfig) string

func GetIconForSeverity

func GetIconForSeverity(severity FindingSeverityType, severities []SeverityConfig) string

func NewSeverityMap

func NewSeverityMap() map[FindingSeverityType]int

NewSeverityMap returns a map of finding severities all associated with a value of 0, meant to be populated with a count of findings in the relevant scope. Notably, this map does not include either "Info" or "Undefined" severities, as these are only reported if present.

func SetConfigDefaults

func SetConfigDefaults()

Types

type Config

type Config struct {
	Default_slack_channel string
	Github_org            string
	Slack_auth_token      string
	Github_token          string
	Quiet                 bool
	Verbose               int
	Severity              []SeverityConfig
	Ecosystem             []EcosystemConfig
	Team                  []TeamConfig
	Reporters             []string
}

func GetUserConfig

func GetUserConfig(configFile string) (Config, error)

type EcosystemConfig

type EcosystemConfig struct {
	Label       string
	Slack_emoji string
}

type FindingEcosystemType

type FindingEcosystemType string
const (
	FindingEcosystemApt    FindingEcosystemType = "apt"
	FindingEcosystemCSharp FindingEcosystemType = "csharp"
	FindingEcosystemDart   FindingEcosystemType = "dart"
	FindingEcosystemErlang FindingEcosystemType = "erlang"
	FindingEcosystemGHA    FindingEcosystemType = "gha" // GitHub Actions
	FindingEcosystemGo     FindingEcosystemType = "go"
	FindingEcosystemJava   FindingEcosystemType = "java"
	FindingEcosystemJS     FindingEcosystemType = "js" // Includes TypeScript
	FindingEcosystemPHP    FindingEcosystemType = "php"
	FindingEcosystemPython FindingEcosystemType = "python"
	FindingEcosystemRPM    FindingEcosystemType = "rpm"
	FindingEcosystemRuby   FindingEcosystemType = "ruby"
	FindingEcosystemRust   FindingEcosystemType = "rust"
	FindingEcosystemSwift  FindingEcosystemType = "swift"
)

type FindingSeverityType

type FindingSeverityType uint8
const (
	FindingSeverityCritical FindingSeverityType = iota
	FindingSeverityHigh
	FindingSeverityModerate
	FindingSeverityLow
	FindingSeverityInfo
	FindingSeverityUndefined
)

func GetSeverityReportOrder

func GetSeverityReportOrder() []FindingSeverityType

GetSeverityReportOrder returns the order in which we want to report severities. This is necessary because we cannot declare a constant array in Go.

type SeverityConfig

type SeverityConfig struct {
	Label       string
	Slack_emoji string
}

type TeamConfig

type TeamConfig struct {
	Name          string
	Github_slug   string
	Slack_channel string
}

func GetTeamConfigBySlug

func GetTeamConfigBySlug(teamSlug string, teams []TeamConfig) (TeamConfig, error)

Jump to

Keyboard shortcuts

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