report

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	HARMLESS int = iota
	LOW
	MEDIUM
	HIGH
	CRITICAL
)
View Source
const NAME string = "malcontent"

Variables

View Source
var BufferPool = sync.Pool{
	New: func() interface{} {
		return make([]byte, 0, 1024)
	},
}
View Source
var Levels = map[string]int{
	"ignore":     -1,
	"none":       -1,
	"harmless":   0,
	"low":        1,
	"notable":    2,
	"medium":     2,
	"suspicious": 3,
	"weird":      3,
	"high":       3,
	"crit":       4,
	"critical":   4,
}

Map to handle RiskLevel -> RiskScore conversions.

View Source
var RiskLevels = map[int]string{
	0: "NONE",
	1: "LOW",
	2: "MEDIUM",
	3: "HIGH",
	4: "CRITICAL",
}

Map to handle RiskScore -> RiskLevel conversions.

Functions

func Generate

func Generate(ctx context.Context, path string, mrs *yarax.ScanResults, c malcontent.Config, expath string, _ *clog.Logger, fc []byte) (*malcontent.FileReport, error)

func TrimPrefixes added in v1.5.0

func TrimPrefixes(path string, prefixes []string) string

TrimPrefixes removes the specified prefix from a given path for the purposes of sample test data generation. This function will only be used via the refresh package.

Types

type StringPool added in v1.8.0

type StringPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

StringPool holds data to handle string interning.

func NewStringPool added in v1.8.0

func NewStringPool(length int) *StringPool

NewStringPool creates a new string pool.

func (*StringPool) Intern added in v1.8.0

func (sp *StringPool) Intern(s string) string

Intern returns an interned version of the input string.

Jump to

Keyboard shortcuts

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