Skip to content

Commit 279800e

Browse files
committed
Use shorter naming scheme for types
1 parent 6a67bd5 commit 279800e

28 files changed

+338
-68
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: sourceModel
5+
data:
6+
- ["github.com/nonexistent/test", "SEmbedI1", True, "Source", "", "", "ReturnValue", "remote", "manual"]
7+
- addsTo:
8+
pack: codeql/go-all
9+
extensible: summaryModel
10+
data:
11+
- ["github.com/nonexistent/test", "SEmbedI1", True, "Step", "", "", "Argument[0]", "ReturnValue", "value", "manual"]
12+
- addsTo:
13+
pack: codeql/go-all
14+
extensible: sinkModel
15+
data:
16+
- ["github.com/nonexistent/test", "SEmbedI1", True, "Sink", "", "", "Argument[0]", "path-injection", "manual"]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
invalidModelRow
2+
paths
3+
| test.go:14:7:14:16 | call to Source | test.go:16:9:16:9 | y |
4+
| test.go:26:7:26:16 | call to Source | test.go:28:9:28:9 | y |
5+
| test.go:38:7:38:16 | call to Source | test.go:40:9:40:9 | y |
6+
| test.go:50:7:50:16 | call to Source | test.go:52:9:52:9 | y |
7+
| test.go:62:7:62:16 | call to Source | test.go:64:9:64:9 | y |
8+
| test.go:74:7:74:16 | call to Source | test.go:76:9:76:9 | y |
9+
sources
10+
| test.go:14:7:14:16 | call to Source |
11+
| test.go:26:7:26:16 | call to Source |
12+
| test.go:38:7:38:16 | call to Source |
13+
| test.go:50:7:50:16 | call to Source |
14+
| test.go:62:7:62:16 | call to Source |
15+
| test.go:74:7:74:16 | call to Source |
16+
sinks
17+
| test.go:16:9:16:9 | y |
18+
| test.go:28:9:28:9 | y |
19+
| test.go:40:9:40:9 | y |
20+
| test.go:52:9:52:9 | y |
21+
| test.go:64:9:64:9 | y |
22+
| test.go:76:9:76:9 | y |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: sourceModel
5+
data:
6+
- ["github.com/nonexistent/test", "SEmbedI2", True, "Source", "", "", "ReturnValue", "remote", "manual"]
7+
- addsTo:
8+
pack: codeql/go-all
9+
extensible: summaryModel
10+
data:
11+
- ["github.com/nonexistent/test", "SEmbedI2", True, "Step", "", "", "Argument[0]", "ReturnValue", "value", "manual"]
12+
- addsTo:
13+
pack: codeql/go-all
14+
extensible: sinkModel
15+
data:
16+
- ["github.com/nonexistent/test", "SEmbedI2", True, "Sink", "", "", "Argument[0]", "path-injection", "manual"]
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ query predicate paths(DataFlow::Node source, DataFlow::Node sink) { Flow::flow(s
1616
query predicate sources(DataFlow::Node source) { source instanceof RemoteFlowSource }
1717

1818
query predicate sinks(DataFlow::Node sink) { sink = any(FileSystemAccess fsa).getAPathArgument() }
19-
// predicate foo() {
20-
// }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
invalidModelRow
2+
paths
3+
sources
4+
sinks
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: sourceModel
5+
data:
6+
- ["github.com/nonexistent/test", "SEmbedS1", True, "Source", "", "", "ReturnValue", "remote", "manual"]
7+
- addsTo:
8+
pack: codeql/go-all
9+
extensible: summaryModel
10+
data:
11+
- ["github.com/nonexistent/test", "SEmbedS1", True, "Step", "", "", "Argument[0]", "ReturnValue", "value", "manual"]
12+
- addsTo:
13+
pack: codeql/go-all
14+
extensible: sinkModel
15+
data:
16+
- ["github.com/nonexistent/test", "SEmbedS1", True, "Sink", "", "", "Argument[0]", "path-injection", "manual"]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import go
2+
import semmle.go.dataflow.ExternalFlow
3+
import ModelValidation
4+
import semmle.go.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
5+
6+
module Config implements DataFlow::ConfigSig {
7+
predicate isSource(DataFlow::Node source) { sources(source) }
8+
9+
predicate isSink(DataFlow::Node sink) { sinks(sink) }
10+
}
11+
12+
module Flow = DataFlow::Global<Config>;
13+
14+
query predicate paths(DataFlow::Node source, DataFlow::Node sink) { Flow::flow(source, sink) }
15+
16+
query predicate sources(DataFlow::Node source) { source instanceof RemoteFlowSource }
17+
18+
query predicate sinks(DataFlow::Node sink) { sink = any(FileSystemAccess fsa).getAPathArgument() }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
invalidModelRow
2+
paths
3+
sources
4+
sinks

0 commit comments

Comments
 (0)