output

package
v0.0.0-...-b63ef67 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HIGH   = "high"
	MEDIUM = "medium"
	LOW    = "low"
)

severity

View Source
const (
	Indent = "  " // Indentation for Json printing
)

Variables

View Source
var (
	MgmtConsoleURL string
	ToaeKey        string
)

Functions

func ExitOnSeverity

func ExitOnSeverity(severity string, count int, failOnCount int)

func FailOn

func FailOn(details SevCount, failOnHighCount int, failOnMediumCount int, failOnLowCount int, failOnCount int)

func GetHostname

func GetHostname() string

func IngestSecretScanResults

func IngestSecretScanResults(secretScanMsg string, index string) error

func PrintColoredSecrets

func PrintColoredSecrets(secrets []SecretFound, isFirstSecret *bool)

func SecretToSecretInfo

func SecretToSecretInfo(out SecretFound) *pb.SecretInfo

func SecretsToSecretInfos

func SecretsToSecretInfos(out []SecretFound) []*pb.SecretInfo

func WriteTableOutput

func WriteTableOutput(report *[]SecretFound) error

Types

type JSONDirSecretsOutput

type JSONDirSecretsOutput struct {
	Timestamp time.Time
	DirName   string `json:"Directory Name"`
	Secrets   []SecretFound
}

func (*JSONDirSecretsOutput) GetSecrets

func (dirOutput *JSONDirSecretsOutput) GetSecrets() []SecretFound

func (*JSONDirSecretsOutput) SetDirName

func (dirOutput *JSONDirSecretsOutput) SetDirName(dirName string)

func (*JSONDirSecretsOutput) SetSecrets

func (dirOutput *JSONDirSecretsOutput) SetSecrets(secrets []SecretFound)

func (*JSONDirSecretsOutput) SetTime

func (dirOutput *JSONDirSecretsOutput) SetTime()

func (JSONDirSecretsOutput) WriteJSON

func (dirOutput JSONDirSecretsOutput) WriteJSON() error

func (JSONDirSecretsOutput) WriteTable

func (dirOutput JSONDirSecretsOutput) WriteTable() error

type JSONImageSecretsOutput

type JSONImageSecretsOutput struct {
	Timestamp   time.Time
	ImageName   string `json:"Image Name"`
	ImageID     string `json:"Image ID"`
	ContainerID string `json:"Container ID"`
	Secrets     []SecretFound
}

func (*JSONImageSecretsOutput) GetSecrets

func (imageOutput *JSONImageSecretsOutput) GetSecrets() []SecretFound

func (*JSONImageSecretsOutput) SetImageID

func (imageOutput *JSONImageSecretsOutput) SetImageID(imageID string)

func (*JSONImageSecretsOutput) SetImageName

func (imageOutput *JSONImageSecretsOutput) SetImageName(imageName string)

func (*JSONImageSecretsOutput) SetSecrets

func (imageOutput *JSONImageSecretsOutput) SetSecrets(secrets []SecretFound)

func (*JSONImageSecretsOutput) SetTime

func (imageOutput *JSONImageSecretsOutput) SetTime()

func (JSONImageSecretsOutput) WriteJSON

func (imageOutput JSONImageSecretsOutput) WriteJSON() error

func (JSONImageSecretsOutput) WriteTable

func (imageOutput JSONImageSecretsOutput) WriteTable() error

type Publisher

type Publisher struct {
	// contains filtered or unexported fields
}

func NewPublisher

func NewPublisher(url string, port string, key string) (*Publisher, error)

func (*Publisher) IngestSecretScanResults

func (p *Publisher) IngestSecretScanResults(scanID string, secrets []SecretFound) error

func (*Publisher) PublishScanError

func (p *Publisher) PublishScanError(scanID, errMsg string)

func (*Publisher) PublishScanStatusMessage

func (p *Publisher) PublishScanStatusMessage(scanID, message, status string)

func (*Publisher) PublishScanStatusPeriodic

func (p *Publisher) PublishScanStatusPeriodic(scanID, status string)

func (*Publisher) SendReport

func (p *Publisher) SendReport(hostname, imageName, containerID, nodeType string)

func (*Publisher) StartScan

func (p *Publisher) StartScan(nodeID, nodeType string) string

func (*Publisher) StopPublishScanStatus

func (p *Publisher) StopPublishScanStatus()

type SecretFound

type SecretFound struct {
	LayerID               string  `json:"Image Layer ID,omitempty"`
	RuleID                int     `json:"Matched Rule ID,omitempty"`
	RuleName              string  `json:"Matched Rule Name,omitempty"`
	PartToMatch           string  `json:"Matched Part,omitempty"`
	Match                 string  `json:"String to Match,omitempty"`
	Regex                 string  `json:"Signature to Match,omitempty"`
	Severity              string  `json:"Severity,omitempty"`
	SeverityScore         float64 `json:"Severity Score,omitempty"`
	PrintBufferStartIndex int     `json:"Starting Index of Match in Original Content,omitempty"`
	MatchFromByte         int     `json:"Relative Starting Index of Match in Displayed Substring"`
	MatchToByte           int     `json:"Relative Ending Index of Match in Displayed Substring"`
	CompleteFilename      string  `json:"Full File Name,omitempty"`
	MatchedContents       string  `json:"Matched Contents,omitempty"`
}

type SevCount

type SevCount struct {
	Total  int
	High   int
	Medium int
	Low    int
}

func CountBySeverity

func CountBySeverity(report []SecretFound) SevCount

Jump to

Keyboard shortcuts

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