Skip to content

Commit ac05a3e

Browse files
committed
feat(lib): Add Taint Tracking module and update Concepts
1 parent 614d6e3 commit ac05a3e

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

ql/lib/codeql/bicep/Concepts.qll

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
private import codeql.bicep.AST
22
private import codeql.bicep.CFG
3+
private import codeql.bicep.DataFlow
4+
private import codeql.threatmodels.ThreatModels
5+
6+
7+
/**
8+
* A data flow source for a specific threat-model.
9+
*
10+
* Extend this class to refine existing API models. If you want to model new APIs,
11+
* extend `ThreatModelSource::Range` instead.
12+
*/
13+
final class ThreatModelSource = ThreatModelSource::Range;
14+
15+
/**
16+
* Provides a class for modeling new sources for specific threat-models.
17+
*/
18+
module ThreatModelSource {
19+
/**
20+
* A data flow source, for a specific threat-model.
21+
*/
22+
abstract class Range extends DataFlow::Node {
23+
/**
24+
* Gets a string that represents the source kind with respect to threat modeling.
25+
*
26+
* See
27+
* - https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst
28+
* - https://github.com/github/codeql/blob/main/shared/threat-models/ext/threat-model-grouping.model.yml
29+
*/
30+
abstract string getThreatModel();
31+
32+
/**
33+
* Gets a string that describes the type of this threat-model source.
34+
*/
35+
abstract string getSourceType();
36+
}
37+
}
38+
39+
/**
40+
* A data flow source that is enabled in the current threat model configuration.
41+
*/
42+
class ActiveThreatModelSource extends ThreatModelSource {
43+
ActiveThreatModelSource() { currentThreatModel(this.getThreatModel()) }
44+
}
345

446
/**
547
* A Public Resource is a resource that is publicly accessible to the Internet.

ql/lib/codeql/bicep/TaintTracking.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import dataflow.TaintTracking

0 commit comments

Comments
 (0)