Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Zavhorodnii committed May 29, 2024
1 parent 3d5fc1f commit e9f71ed
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/security/risks/builtin/incomplete_model_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ func (r *IncompleteModelRule) GenerateRisks(input *types.Model) ([]*types.Risk,
risks := make([]*types.Risk, 0)
for _, id := range input.SortedTechnicalAssetIDs() {
technicalAsset := input.TechnicalAssets[id]
if !technicalAsset.OutOfScope {
if technicalAsset.Technologies.IsUnknown() {
risks = append(risks, r.createRiskTechAsset(technicalAsset))
}
for _, commLink := range technicalAsset.CommunicationLinks {
if commLink.Protocol == types.UnknownProtocol {
risks = append(risks, r.createRiskCommLink(technicalAsset, commLink))
}
if technicalAsset.OutOfScope {
continue
}
if technicalAsset.Technologies.IsUnknown() {
risks = append(risks, r.createRiskTechAsset(technicalAsset))
}
for _, commLink := range technicalAsset.CommunicationLinks {
if commLink.Protocol == types.UnknownProtocol {
risks = append(risks, r.createRiskCommLink(technicalAsset, commLink))
}
}
}
Expand Down

0 comments on commit e9f71ed

Please sign in to comment.