File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed
reporthandling/attacktrack/v1alpha1 Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,11 @@ func GetAttackTrackMock(data AttackTrackStep) IAttackTrack {
4141
4242// Mocked AttackTrackStep implementation for testing
4343type AttackTrackStepMock struct {
44- Name string
45- Description string
46- SubSteps []AttackTrackStepMock
47- Controls []IAttackTrackControl
44+ Name string
45+ Description string
46+ ChecksVulnerabilities bool
47+ SubSteps []AttackTrackStepMock
48+ Controls []IAttackTrackControl
4849}
4950
5051// Mocked AttackTrackStep methods
@@ -68,6 +69,10 @@ func (s AttackTrackStepMock) IsLeaf() bool {
6869 return len (s .SubSteps ) == 0
6970}
7071
72+ func (s AttackTrackStepMock ) DoesCheckVulnerabilities () bool {
73+ return s .ChecksVulnerabilities
74+ }
75+
7176func (a AttackTrackStepMock ) IsPartOfAttackTrackPath () bool {
7277 return len (a .Controls ) > 0
7378}
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ func (step *AttackTrackStep) IsLeaf() bool {
3333 return step .Length () == 0
3434}
3535
36+ func (step * AttackTrackStep ) DoesCheckVulnerabilities () bool {
37+ return step .ChecksVulnerabilities
38+ }
39+
3640// Equal checks if the given attack track step is equal to the current one
3741// If compareControls is true, the controls are also compared
3842func (s * AttackTrackStep ) Equal (other * AttackTrackStep , compareControls bool ) bool {
Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ type AttackTrackSpecification struct {
2121}
2222
2323type AttackTrackStep struct {
24- Name string `json:"name"`
25- Description string `json:"description,omitempty"`
26- SubSteps []AttackTrackStep `json:"subSteps,omitempty"`
24+ Name string `json:"name"`
25+ Description string `json:"description,omitempty"`
26+ ChecksVulnerabilities bool `json:"checksVulnerabilities,omitempty"`
27+ SubSteps []AttackTrackStep `json:"subSteps,omitempty"`
2728
2829 // failed controls which are related to this step
2930 Controls []IAttackTrackControl `json:"-"`
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ type IAttackTrackStep interface {
2121 SubStepAt (index int ) IAttackTrackStep // returns a sub step at the given index
2222 IsPartOfAttackTrackPath () bool // checks if the step can be a part of an attack track path
2323 IsLeaf () bool // checks if the step is a leaf node
24+ DoesCheckVulnerabilities () bool // checks if the step checks for vulnerabilities
2425}
2526
2627// A control related to an attack track step
You can’t perform that action at this time.
0 commit comments