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

Co-authored-by: Michael Nebel <michaelnebel@github.com>
This commit is contained in:
Dave Bartolomeo 2023-10-26 13:46:37 -04:00 коммит произвёл GitHub
Родитель 8d9e4d391f
Коммит 927eb8424d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 10 добавлений и 11 удалений

Просмотреть файл

@ -46,22 +46,21 @@ private string getParentThreatModel(string child) {
}
/**
* Gets the `enabled` column of the highest-priority configuration row whose `kind` column includes
* the specified threat model kind.
* Holds if the `enabled` column is set to `true` of the highest-priority configuration row
* whose `kind` column includes the specified threat model kind.
*/
private boolean threatModelExplicitState(string kind) {
private predicate threatModelEnabled(string kind) {
// Find the highest-oriority configuration row whose `kind` column includes the specified threat
// model kind. If such a row exists and its `enabled` column is `true`, then the threat model is
// enabled.
(knownThreatModel(kind) or kind = "<other>") and
result =
max(boolean enabled, int priority |
exists(string configuredKind | configuredKind = getParentThreatModel*(kind) |
threatModelConfiguration(configuredKind, enabled, priority)
)
|
enabled order by priority
knownThreatModel(kind) and
max(boolean enabled, int priority |
exists(string configuredKind | configuredKind = getParentThreatModel*(kind) |
threatModelConfiguration(configuredKind, enabled, priority)
)
|
enabled order by priority
) = true
}
/**