Skip to content

Commit 8786c70

Browse files
committed
Expand explanations of example global data-flow queries
1 parent 9998752 commit 8786c70

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/codeql/codeql-language-guides/analyzing-data-flow-in-ruby.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,10 @@ Class hierarchy
326326
Examples of global data flow
327327
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
328328

329-
This query shows a data flow configuration that uses all network input as data sources:
329+
The following global taint-tracking query finds path arguments in filesystem accesses that can be controlled by a remote user.
330+
- Since this is a taint-tracking query, the configuration class extends ``TaintTracking::Configuration``.
331+
- The ``isSource`` predicate defines sources as any data-flow nodes that are instances of ``RemoteFlowSource``.
332+
- The ``isSink`` predicate defines sinks as path arguments in any filesystem access, using ``FileSystemAccess`` from the ``Concepts`` library.
330333

331334
.. code-block:: ql
332335
@@ -349,7 +352,10 @@ This query shows a data flow configuration that uses all network input as data s
349352
where config.hasFlow(input, fileAccess)
350353
select fileAccess, "This file access uses data from $@.", input, "user-controllable input."
351354
352-
This data flow configuration tracks data flow from environment variables to opening files:
355+
The following global data-flow query finds calls to ``File.open`` where the filename argument comes from an environment variable.
356+
- Since this is a data-flow query, the configuration class extends ``DataFlow::Configuration``.
357+
- The ``isSource`` predicate defines sources as expression nodes representing lookups on the ``ENV`` hash.
358+
- The ``isSink`` predicate defines sinks as the first argument in any call to ``File.open``.
353359

354360
.. code-block:: ql
355361

0 commit comments

Comments
 (0)