File tree Expand file tree Collapse file tree 4 files changed +64
-0
lines changed
semmle/code/java/dataflow Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ extensions :
2+
3+ - addsTo :
4+ pack : codeql/java-all
5+ extensible : supportedThreatModels
6+ data :
7+ - ["default"] # The "default" threat model is always included.
Original file line number Diff line number Diff line change 1+ extensions :
2+
3+ - addsTo :
4+ pack : codeql/java-all
5+ extensible : threatModelGrouping
6+ data :
7+ # Default threat model
8+ - ["remote", "default"]
9+ - ["uri-path", "default"]
10+
11+ # Android threat models
12+ - ["android-widget", "android"]
13+ - ["android-external-storage-dir", "android"]
14+ - ["contentprovider", "android"]
15+ - ["android-external-storage-dir", "android"]
16+
17+ # Remote threat models
18+ - ["request", "remote"]
19+ - ["response", "remote"]
20+
21+ # Local threat models
22+ - ["database", "local"]
23+ - ["cli", "local"]
24+ - ["environment", "local"]
25+ - ["file", "local"]
Original file line number Diff line number Diff line change @@ -15,4 +15,5 @@ dataExtensions:
1515 - ext/*.model.yml
1616 - ext/generated/*.model.yml
1717 - ext/experimental/*.model.yml
18+ - ext/threatmodels/*.model.yml
1819warnOnImplicitThis : true
Original file line number Diff line number Diff line change 1+ /**
2+ * INTERNAL use only. This is an experimental API subject to change without notice.
3+ *
4+ * This module provides extensible predicates for configuring which kinds of MaD models
5+ * are applicable to generic queries.
6+ */
7+
8+ private import ExternalFlowExtensions
9+
10+ /**
11+ * Holds if the specified kind of source model is supported for the current query.
12+ */
13+ extensible private predicate supportedThreatModels ( string kind ) ;
14+
15+ /**
16+ * Holds if the specified kind of source model is containted within the specified group.
17+ */
18+ extensible private predicate threatModelGrouping ( string kind , string group ) ;
19+
20+ /**
21+ * Gets the threat models that are direct descendants of the specified kind/group.
22+ */
23+ private string getChildThreatModel ( string group ) { threatModelGrouping ( result , group ) }
24+
25+ /**
26+ * Holds if the source model kind `kind` is relevant for generic queries
27+ * under the current threat model configuration.
28+ */
29+ predicate sourceModelKindConfig ( string kind ) {
30+ exists ( string group | supportedThreatModels ( group ) and kind = getChildThreatModel * ( group ) )
31+ }
You can’t perform that action at this time.
0 commit comments