Skip to content

Commit dc7d7f1

Browse files
committed
Rust: Clarify doc on FlowSink, FlowSource.
1 parent d187625 commit dc7d7f1

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

rust/ql/lib/codeql/rust/dataflow/FlowSink.qll

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
/** Provides classes and predicates for defining flow sinks. */
1+
/**
2+
* Provides classes and predicates for defining flow sinks.
3+
*
4+
* Flow sinks defined here feed into data flow configurations as follows:
5+
*
6+
* data from `*.model.yml` | QL extensions of `FlowSink::Range`
7+
* v v
8+
* `FlowSink` (associated with a models-as-data `kind` string)
9+
* v
10+
* `sinkNode` predicate | other QL defined sinks, for example using concepts
11+
* v v
12+
* various `Sink` classes for specific data flow configurations
13+
*
14+
* New sinks should be defined using models-as-data, QL extensions of
15+
* `FlowSink::Range`, or concepts. Data flow configurations should use the
16+
* `sinkNode` predicate and/or concepts to define their sinks.
17+
*/
218

319
private import rust
420
private import internal.FlowSummaryImpl as Impl
@@ -12,7 +28,7 @@ private module Sinks {
1228

1329
/** Provides the `Range` class used to define the extent of `FlowSink`. */
1430
module FlowSink {
15-
/** A flow source. */
31+
/** A flow sink. */
1632
abstract class Range extends Impl::Public::SinkElement {
1733
bindingset[this]
1834
Range() { any() }

rust/ql/lib/codeql/rust/dataflow/FlowSource.qll

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
/** Provides classes and predicates for defining flow sources. */
1+
/**
2+
* Provides classes and predicates for defining flow sources.
3+
*
4+
* Flow sources defined here feed into the `ActiveThreatModelSource` class and
5+
* ultimately reach data flow configurations as follows:
6+
*
7+
* data from `*.model.yml` | QL extensions of `FlowSource::Range`
8+
* v v
9+
* `FlowSource` (associated with a models-as-data `kind` string)
10+
* v
11+
* `sourceNode` predicate | (theoretically other QL defined sources)
12+
* v v
13+
* `ThreatModelSource` (associated with a threat model source type)
14+
* v
15+
* `ActiveThreatModelSource` (just the enabled sources)
16+
* v
17+
* various `Source` classes for specific data flow configurations
18+
*
19+
* New sources should be defined using models-as-data or QL extensions of
20+
* `FlowSource::Range`. Data flow configurations on the other hand should use
21+
* `ActiveThreatModelSource` to match sources enabled in the user
22+
* configuration.
23+
*/
224

325
private import rust
426
private import internal.FlowSummaryImpl as Impl

0 commit comments

Comments
 (0)