utils

package
v0.0.0-...-6cfc1b2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName        = "traceanalyzer"
	ModuleDescription = "Inspects request and responses to detect insecure practices"
)
View Source
const (
	SeverityInfo     = "INFO"
	SeverityLow      = "LOW"
	SeverityMedium   = "MEDIUM"
	SeverityHigh     = "HIGH"
	SeverityCritical = "CRITICAL"
)

Variables

This section is empty.

Functions

func FindHeader

func FindHeader(headers []*_models.Header, headerName string) (index int, found bool)

func GetPathParams

func GetPathParams(specPath string, opPath string) map[string]string

func Min

func Min(x, y int) int

func ReadDictionaryFiles

func ReadDictionaryFiles(filenames []string) ([]string, error)

func SeverityToAlert

func SeverityToAlert(severity string) core.AlertSeverity

func WalkFiles

func WalkFiles(root string) ([]string, error)

Types

type API

type API = string

type BaseTraceAnalyzerAPIAnnotation

type BaseTraceAnalyzerAPIAnnotation struct {
	SpecPath   string `json:"path"`
	SpecMethod string `json:"method"`
}

func (BaseTraceAnalyzerAPIAnnotation) Method

func (BaseTraceAnalyzerAPIAnnotation) Path

func (BaseTraceAnalyzerAPIAnnotation) Severity

func (BaseTraceAnalyzerAPIAnnotation) SpecLocation

func (a BaseTraceAnalyzerAPIAnnotation) SpecLocation() string

func (BaseTraceAnalyzerAPIAnnotation) TTL

type Finding

type Finding struct {
	ShortDesc    string
	DetailedDesc string
	Severity     string
	Alert        core.AlertSeverity
}

A finding is an interpreted annotation.

type TraceAnalyzerAPIAnnotation

type TraceAnalyzerAPIAnnotation interface {
	Name() string
	Path() string
	Method() string
	Aggregate(TraceAnalyzerAnnotation) (notify bool)
	Severity() string
	TTL() time.Duration
	Redacted() TraceAnalyzerAPIAnnotation
	ToAPIFinding() oapicommon.APIFinding
}

type TraceAnalyzerAnnotation

type TraceAnalyzerAnnotation interface {
	Name() string
	NewAPIAnnotation(path, method string) TraceAnalyzerAPIAnnotation
	Severity() string
	Redacted() TraceAnalyzerAnnotation
	ToFinding() Finding
}

Jump to

Keyboard shortcuts

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