@@ -36,7 +36,7 @@ In this example, we'll show how to add the following argument, passed to **sudo*
36
36
37
37
.. code-block :: python
38
38
39
- from fabric.api import sudo
39
+ from fabric.operations import sudo
40
40
sudo(cmd) # <-- add 'cmd' as a taint sink
41
41
42
42
Note that this sink is already recognized by the CodeQL Python analysis, but for this example, you could use the following data extension:
@@ -48,16 +48,16 @@ Note that this sink is already recognized by the CodeQL Python analysis, but for
48
48
pack : codeql/python-all
49
49
extensible : sinkModel
50
50
data :
51
- - ["fabric", "Member[api ].Member[sudo].Argument[0]", "command-injection"]
51
+ - ["fabric", "Member[operations ].Member[sudo].Argument[0]", "command-injection"]
52
52
53
53
54
54
- Since we're adding a new sink, we add a tuple to the **sinkModel ** extensible predicate.
55
55
- The first column, **"fabric" **, identifies a set of values from which to begin the search for the sink.
56
56
The string **"fabric" ** means we start at the places where the codebase imports the package **fabric **.
57
57
- The second column is an access path that is evaluated from left to right, starting at the values that were identified by the first column.
58
58
59
- - **Member[api ] ** selects accesses to the **api ** package .
60
- - **Member[sudo] ** selects accesses to the **sudo ** function in the **api ** package .
59
+ - **Member[operations ] ** selects accesses to the **operations ** module .
60
+ - **Member[sudo] ** selects accesses to the **sudo ** function in the **operations ** module .
61
61
- **Argument[0] ** selects the first argument to calls to that function.
62
62
63
63
- **command-injection ** indicates that this is considered a sink for the command injection query.
0 commit comments