|
6 | 6 |
|
7 | 7 | private import codeql.rust.dataflow.DataFlow |
8 | 8 | private import codeql.threatmodels.ThreatModels |
| 9 | +private import codeql.rust.Frameworks |
9 | 10 |
|
10 | 11 | /** |
11 | 12 | * A data flow source for a specific threat-model. |
@@ -46,6 +47,63 @@ class ActiveThreatModelSource extends ThreatModelSource { |
46 | 47 | ActiveThreatModelSource() { currentThreatModel(this.getThreatModel()) } |
47 | 48 | } |
48 | 49 |
|
| 50 | +/** |
| 51 | + * A data flow source corresponding to the program's command line arguments or path. |
| 52 | + */ |
| 53 | +final class CommandLineArgsSource = CommandLineArgsSource::Range; |
| 54 | + |
| 55 | +/** |
| 56 | + * Provides a class for modeling new sources for the program's command line arguments or path. |
| 57 | + */ |
| 58 | +module CommandLineArgsSource { |
| 59 | + /** |
| 60 | + * A data flow source corresponding to the program's command line arguments or path. |
| 61 | + */ |
| 62 | + abstract class Range extends ThreatModelSource::Range { |
| 63 | + override string getThreatModel() { result = "commandargs" } |
| 64 | + |
| 65 | + override string getSourceType() { result = "CommandLineArgs" } |
| 66 | + } |
| 67 | +} |
| 68 | + |
| 69 | +/** |
| 70 | + * A data flow source corresponding to the program's environment. |
| 71 | + */ |
| 72 | +final class EnvironmentSource = EnvironmentSource::Range; |
| 73 | + |
| 74 | +/** |
| 75 | + * Provides a class for modeling new sources for the program's environment. |
| 76 | + */ |
| 77 | +module EnvironmentSource { |
| 78 | + /** |
| 79 | + * A data flow source corresponding to the program's environment. |
| 80 | + */ |
| 81 | + abstract class Range extends ThreatModelSource::Range { |
| 82 | + override string getThreatModel() { result = "environment" } |
| 83 | + |
| 84 | + override string getSourceType() { result = "EnvironmentSource" } |
| 85 | + } |
| 86 | +} |
| 87 | + |
| 88 | +/** |
| 89 | + * A data flow source for remote (network) data. |
| 90 | + */ |
| 91 | +final class RemoteSource = RemoteSource::Range; |
| 92 | + |
| 93 | +/** |
| 94 | + * Provides a class for modeling new sources of remote (network) data. |
| 95 | + */ |
| 96 | +module RemoteSource { |
| 97 | + /** |
| 98 | + * A data flow source for remote (network) data. |
| 99 | + */ |
| 100 | + abstract class Range extends ThreatModelSource::Range { |
| 101 | + override string getThreatModel() { result = "remote" } |
| 102 | + |
| 103 | + override string getSourceType() { result = "RemoteSource" } |
| 104 | + } |
| 105 | +} |
| 106 | + |
49 | 107 | /** |
50 | 108 | * A data-flow node that constructs a SQL statement. |
51 | 109 | * |
|
0 commit comments