mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
JS: Minor improvements to threat-model Concepts
Mirroring what was done for Python
This commit is contained in:
@@ -16,6 +16,11 @@ private import codeql.threatmodels.ThreatModels
|
||||
class ThreatModelSource extends DataFlow::Node instanceof ThreatModelSource::Range {
|
||||
/**
|
||||
* Gets a string that represents the source kind with respect to threat modeling.
|
||||
*
|
||||
*
|
||||
* See
|
||||
* - https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst
|
||||
* - https://github.com/github/codeql/blob/main/shared/threat-models/ext/threat-model-grouping.model.yml
|
||||
*/
|
||||
string getThreatModel() { result = super.getThreatModel() }
|
||||
|
||||
@@ -34,6 +39,10 @@ module ThreatModelSource {
|
||||
abstract class Range extends DataFlow::Node {
|
||||
/**
|
||||
* Gets a string that represents the source kind with respect to threat modeling.
|
||||
*
|
||||
* See
|
||||
* - https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst
|
||||
* - https://github.com/github/codeql/blob/main/shared/threat-models/ext/threat-model-grouping.model.yml
|
||||
*/
|
||||
abstract string getThreatModel();
|
||||
|
||||
@@ -45,11 +54,11 @@ module ThreatModelSource {
|
||||
/**
|
||||
* A data flow source that is enabled in the current threat model configuration.
|
||||
*/
|
||||
class ActiveThreatModelSource extends DataFlow::Node {
|
||||
class ActiveThreatModelSource extends ThreatModelSource {
|
||||
ActiveThreatModelSource() {
|
||||
exists(string kind |
|
||||
currentThreatModel(kind) and
|
||||
this.(ThreatModelSource).getThreatModel() = kind
|
||||
this.getThreatModel() = kind
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user