diagnostics

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confidence

type Confidence int

Confidence reflects the degree of confidence that we have in an assessment

const (
	//Low Confidence in the assessment
	Low Confidence = iota
	//Medium Confidence in the assessment
	Medium
	//High Confidence in the assessment
	High
)

func (Confidence) MarshalJSON

func (conf Confidence) MarshalJSON() ([]byte, error)

MarshalJSON makes a string representation of the confidence

func (Confidence) String

func (conf Confidence) String() string

func (*Confidence) UnmarshalJSON

func (conf *Confidence) UnmarshalJSON(data []byte) error

UnmarshalJSON makes a string representation of the confidence

type DefaultSecurityDiagnosticsProvider

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

DefaultSecurityDiagnosticsProvider a default implementation

func (*DefaultSecurityDiagnosticsProvider) AddConsumers

func (sdp *DefaultSecurityDiagnosticsProvider) AddConsumers(consumers ...SecurityDiagnosticsConsumer)

AddConsumers adds consumers to be notified by this provider when there is a new diagnostics

func (*DefaultSecurityDiagnosticsProvider) Broadcast

func (sdp *DefaultSecurityDiagnosticsProvider) Broadcast(diagnostics SecurityDiagnostic)

Broadcast sends diagnostics to all registered consumers

type Evidence

type Evidence struct {
	Description string
	Confidence  Confidence
}

Evidence is an atomic piece of information that describes a security diagnostics

type Justification

type Justification struct {
	Headline Evidence   //Headline evidence
	Reasons  []Evidence //sub-reasons that justify why this is an issue
}

Justification describes why a piece of security diagnostic has been generated

type SecurityDiagnostic

type SecurityDiagnostic struct {
	Justification Justification
	Range         code.Range
	//Source code evidence optionally provided
	Source *string `json:"source,omitempty"`
	//Location is an optional value that could contain filepath or URI of resource that this diagnostic applies to
	Location   *string `json:"location,omitempty"`
	ProviderID string  //used for identifying the source of the diagnostics
}

SecurityDiagnostic describes a security issue

type SecurityDiagnosticsConsumer

type SecurityDiagnosticsConsumer interface {
	ReceiveDiagnostic(diagnostic SecurityDiagnostic)
}

SecurityDiagnosticsConsumer is an interface with a callback to receive security diagnostics

type SecurityDiagnosticsProvider

type SecurityDiagnosticsProvider interface {
	//AddConsumers adds consumers to be notified by this provider when there is a new diagnostics
	AddConsumers(consumers ...SecurityDiagnosticsConsumer)
	Broadcast(diagnostic SecurityDiagnostic)
}

SecurityDiagnosticsProvider interface for security diagnostics providers

Jump to

Keyboard shortcuts

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