Skip to content

Commit

Permalink
🐛 fix inverted risk factor evaluation (#1208)
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Mar 29, 2024
1 parent 5df10e5 commit 83417d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions examples/risk.mql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ policies:

- uid: sshd-02
title: Prevent weaker CBC ciphers from being used
mql: sshd.config.ciphers.all( /cbc/ )
mql: sshd.config.ciphers.none( /128/ )
impact: 80

# Here we use a referenced query. You can put multiple policies
Expand All @@ -41,9 +41,10 @@ policies:
- uid: sshd-service
title: SSHd Service running
docs:
active: The SSH service is running and can expose security issues in SSH or the asset to outside attackers.
active: The SSH service is running and can expose security issues to outside attackers.
inactive: The SSH service is not running, which reduces the attack surface on the asset.
magnitude: 0.7
is_absolute: true
software:
- name: openssh-server
- type: alpm
Expand Down
2 changes: 1 addition & 1 deletion policy/executor/internal/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *BufferedCollector) consumeRisk(score *policy.Score, risks map[string]bo
}

for _, riskMRN := range riskMRNs {
isDetected := score.Value != 100
isDetected := score.Value == 100
risks[riskMRN] = risks[riskMRN] || isDetected
}
return true
Expand Down

0 comments on commit 83417d3

Please sign in to comment.