Skip to content

Commit 927eb84

Browse files
Dave Bartolomeomichaelnebel
andauthored
Update shared/threat-models/codeql/threatmodels/ThreatModels.qll
Co-authored-by: Michael Nebel <[email protected]>
1 parent 8d9e4d3 commit 927eb84

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

shared/threat-models/codeql/threatmodels/ThreatModels.qll

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,21 @@ private string getParentThreatModel(string child) {
4646
}
4747

4848
/**
49-
* Gets the `enabled` column of the highest-priority configuration row whose `kind` column includes
50-
* the specified threat model kind.
49+
* Holds if the `enabled` column is set to `true` of the highest-priority configuration row
50+
* whose `kind` column includes the specified threat model kind.
5151
*/
52-
private boolean threatModelExplicitState(string kind) {
52+
private predicate threatModelEnabled(string kind) {
5353
// Find the highest-oriority configuration row whose `kind` column includes the specified threat
5454
// model kind. If such a row exists and its `enabled` column is `true`, then the threat model is
5555
// enabled.
56-
(knownThreatModel(kind) or kind = "<other>") and
57-
result =
58-
max(boolean enabled, int priority |
59-
exists(string configuredKind | configuredKind = getParentThreatModel*(kind) |
60-
threatModelConfiguration(configuredKind, enabled, priority)
61-
)
62-
|
63-
enabled order by priority
56+
knownThreatModel(kind) and
57+
max(boolean enabled, int priority |
58+
exists(string configuredKind | configuredKind = getParentThreatModel*(kind) |
59+
threatModelConfiguration(configuredKind, enabled, priority)
6460
)
61+
|
62+
enabled order by priority
63+
) = true
6564
}
6665

6766
/**

0 commit comments

Comments
 (0)