v1alpha1

package
v0.0.199 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 1 Imported by: 11

Documentation

Index

Constants

View Source
const (
	ControlTypeTagDevops         string = "devops"
	ControlTypeTagSecurity       string = "security"
	ControlTypeTagCompliance     string = "compliance"
	ControlTypeTagSecurityImpact string = "security-impact"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttackTrack

type AttackTrack struct {
	ApiVersion string                   `json:"apiVersion"`
	Kind       string                   `json:"kind"`
	Metadata   map[string]interface{}   `json:"metadata"`
	Spec       AttackTrackSpecification `json:"spec"`
}

func AttackTrackMock

func AttackTrackMock(data AttackTrackStep) *AttackTrack

func (*AttackTrack) GetApiVersion

func (at *AttackTrack) GetApiVersion() string

func (*AttackTrack) GetData

func (at *AttackTrack) GetData() IAttackTrackStep

func (*AttackTrack) GetDescription

func (at *AttackTrack) GetDescription() string

func (*AttackTrack) GetKind

func (at *AttackTrack) GetKind() string

func (*AttackTrack) GetName

func (at *AttackTrack) GetName() string

func (*AttackTrack) GetVersion

func (at *AttackTrack) GetVersion() string

func (*AttackTrack) IsValid

func (at *AttackTrack) IsValid() bool

IsValid returns true if an attack track is valid

func (*AttackTrack) Iterator

func (at *AttackTrack) Iterator() IAttackTrackIterator

==================== Iterator ====================

type AttackTrackAllPathsHandler

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

func NewAttackTrackAllPathsHandler

func NewAttackTrackAllPathsHandler(attackTrack IAttackTrack, lookup IAttackTrackControlsLookup) *AttackTrackAllPathsHandler

func (*AttackTrackAllPathsHandler) CalculateAllPaths

func (handler *AttackTrackAllPathsHandler) CalculateAllPaths() [][]IAttackTrackStep

type AttackTrackControlMock

type AttackTrackControlMock struct {
	ControlId  string
	Categories []string
	Tags       []string
	BaseScore  float64
	Severity   int
}

func (*AttackTrackControlMock) GetAttackTrackCategories

func (mock *AttackTrackControlMock) GetAttackTrackCategories(x string) []string

func (*AttackTrackControlMock) GetControlId

func (mock *AttackTrackControlMock) GetControlId() string

func (*AttackTrackControlMock) GetControlTypeTags

func (mock *AttackTrackControlMock) GetControlTypeTags() []string

func (*AttackTrackControlMock) GetScore

func (mock *AttackTrackControlMock) GetScore() float64

func (*AttackTrackControlMock) GetSeverity

func (mock *AttackTrackControlMock) GetSeverity() int

type AttackTrackControlsLookup

type AttackTrackControlsLookup map[string]map[string][]IAttackTrackControl

func NewAttackTrackControlsLookup

func NewAttackTrackControlsLookup(attackTracks []IAttackTrack, failedControlIds []string, allControls map[string]IAttackTrackControl) AttackTrackControlsLookup

func (*AttackTrackControlsLookup) GetAssociatedControls

func (at *AttackTrackControlsLookup) GetAssociatedControls(attackTrack, category string) []IAttackTrackControl

func (*AttackTrackControlsLookup) HasAssociatedControls

func (at *AttackTrackControlsLookup) HasAssociatedControls(attackTrack string) bool

type AttackTrackIterator

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

func (*AttackTrackIterator) HasNext

func (iter *AttackTrackIterator) HasNext() bool

func (*AttackTrackIterator) Next

type AttackTrackSpecification

type AttackTrackSpecification struct {
	Version     string          `json:"version,omitempty"`
	Description string          `json:"description,omitempty"`
	Data        AttackTrackStep `json:"data"`
}

type AttackTrackStep

type AttackTrackStep struct {
	Name        string            `json:"name"`
	Description string            `json:"description,omitempty"`
	SubSteps    []AttackTrackStep `json:"subSteps,omitempty"`

	// failed controls which are related to this step
	Controls []IAttackTrackControl `json:"-"`
}

func (*AttackTrackStep) GetControls

func (step *AttackTrackStep) GetControls() []IAttackTrackControl

func (*AttackTrackStep) GetDescription

func (step *AttackTrackStep) GetDescription() string

func (*AttackTrackStep) GetName

func (step *AttackTrackStep) GetName() string

func (*AttackTrackStep) IsPartOfAttackTrackPath

func (step *AttackTrackStep) IsPartOfAttackTrackPath() bool

IsPartOfAttackTrackPath checks if the step can be a part of an attack track path (i.e. step has failed controls)

func (*AttackTrackStep) Length

func (step *AttackTrackStep) Length() int

func (*AttackTrackStep) SetControls

func (step *AttackTrackStep) SetControls(controls []IAttackTrackControl)

func (*AttackTrackStep) SubStepAt

func (step *AttackTrackStep) SubStepAt(index int) IAttackTrackStep

type IAttackTrack

type IAttackTrack interface {
	GetApiVersion() string
	GetKind() string
	GetName() string
	GetDescription() string
	GetVersion() string
	GetData() IAttackTrackStep
	Iterator() IAttackTrackIterator
	IsValid() bool
}

type IAttackTrackControl

type IAttackTrackControl interface {
	GetAttackTrackCategories(attackTrack string) []string
	GetControlTypeTags() []string
	GetControlId() string
	GetScore() float64
	GetSeverity() int
}

A control related to an attack track step

type IAttackTrackControlsLookup

type IAttackTrackControlsLookup interface {
	// returns a list of controls associated with the given attack track and category
	GetAssociatedControls(attackTrack, category string) []IAttackTrackControl

	// returns true if attack track as any associated controls
	HasAssociatedControls(attackTrack string) bool
}

type IAttackTrackIterator

type IAttackTrackIterator interface {
	HasNext() bool
	Next() IAttackTrackStep
}

Iterator interface for iterating over the attack track's steps

type IAttackTrackStep

type IAttackTrackStep interface {
	GetName() string                            // returns the name of the step
	GetDescription() string                     // returns the description of the step
	GetControls() []IAttackTrackControl         // returns the list of controls which failed on this step
	SetControls(controls []IAttackTrackControl) // sets the list of controls which failed on this step
	Length() int                                // returns the number of sub steps
	SubStepAt(index int) IAttackTrackStep       // returns a sub step at the given index
	IsPartOfAttackTrackPath() bool              // checks if the step can be a part of an attack track path
}

A step in an attack track

Jump to

Keyboard shortcuts

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