You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/taint-analysis.adoc
+61-51
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,16 @@ This documentation is dedicated to providing guidance on using our taint analysi
9
9
10
10
== Enabling Taint Analysis
11
11
12
+
Taint analysis can be enabled in one of two ways, or both approaches together:
13
+
14
+
* using the YAML configuration file.
15
+
16
+
* using the programmatic configuration provider.
17
+
18
+
=== YAML Configuration File
19
+
12
20
In Tai-e, taint analysis is designed and implemented as a plugin of pointer analysis framework.
13
-
To enable taint analysis, simply start pointer analysis with option `taint-config`, for example:
21
+
To enable taint analysis with the YAML configuration file, simply start pointer analysis with option `taint-config`, for example:
14
22
15
23
[source]
16
24
----
@@ -23,6 +31,58 @@ In the upcoming section, we will provide a comprehensive guide on crafting a con
23
31
TIP: You could use various pointer analysis techniques to obtain different precision/efficiency tradeoffs.
24
32
For additional details, please refer to <<pointer-analysis-framework#pointer-analysis-framework,Pointer Analysis Framework>>.
25
33
34
+
35
+
==== Interactive Mode
36
+
37
+
Interactive mode enables users to modify the taint configuration file(s) and re-run taint analysis without needing to re-run the whole program analysis.
38
+
39
+
This feature significantly speeds up both taint configuration development/debugging and production scenarios that running multiple configuration sets.
40
+
41
+
To enable interactive mode, append additional `taint-interactive-mode:true` option when starting the taint analysis, for example:
42
+
43
+
[source]
44
+
----
45
+
-a pta=...;taint-config:<path/to/config>;taint-interactive-mode:true;...
46
+
----
47
+
48
+
Once the taint analysis completes, Tai-e will enter an interactive state where you can:
49
+
50
+
1. Modify the taint configuration file(s) and press `r` in the console to re-run the taint analysis with your updated configuration.
51
+
2. Press `e` in the console to exit interactive mode.
52
+
53
+
54
+
=== Programmatic Taint Configuration Provider
55
+
56
+
In addition to the YAML configuration file, Tai-e also supports programmatic taint configuration.
57
+
58
+
To enable it, start pointer analysis with option `taint-config-providers`, for example:
59
+
60
+
[source]
61
+
----
62
+
-a pta=...;taint-config-providers:[my.example.MyTaintConfigProvider];...
63
+
----
64
+
65
+
The class `my.example.MyTaintConfigProvider` should extend the interface `pascal.taie.analysis.pta.plugin.taint.TaintConfigProvider`.
66
+
67
+
[source,java,subs="verbatim"]
68
+
----
69
+
package my.example;
70
+
71
+
public class MyTaintConfigProvider extends TaintConfigProvider {
72
+
public MyTaintConfigProvider(ClassHierarchy hierarchy, TypeSystem typeSystem) {
In this section, we present instructions on configuring sources, sinks, taint transfers, and sanitizers for the taint analysis using a YAML configuration file.
@@ -368,56 +428,6 @@ Users can simply place all relevant configuration files within a designated dire
368
428
TIP: The taint analysis will traverse the directory iteratively during the configuration loading process.
369
429
Therefore, you have the flexibility to organize the configuration files as you see fit, including placing them in multiple subdirectories if desired.
370
430
371
-
=== Programmatic Taint Configuration Provider
372
-
373
-
In addition to the YAML configuration file, Tai-e also supports programmatic taint configuration.
374
-
375
-
To enable it, start pointer analysis with option `taint-config-providers`, for example:
376
-
377
-
[source]
378
-
----
379
-
-a pta=...;taint-config-providers:[my.example.MyTaintConfigProvider];...
380
-
----
381
-
382
-
The class `my.example.MyTaintConfigProvider` should extend the interface `pascal.taie.analysis.pta.plugin.taint.TaintConfigProvider`.
383
-
384
-
[source,java,subs="verbatim"]
385
-
----
386
-
package my.example;
387
-
388
-
public class MyTaintConfigProvider extends TaintConfigProvider {
389
-
public MyTaintConfigProvider(ClassHierarchy hierarchy, TypeSystem typeSystem) {
Interactive mode enables users to modify the taint configuration file(s) and re-run taint analysis without needing to re-run the whole program analysis.
405
-
406
-
This feature significantly speeds up both taint configuration development/debugging and production scenarios that running multiple configuration sets.
407
-
408
-
To enable interactive mode, append additional `taint-interactive-mode:true` option when starting the taint analysis, for example:
409
-
410
-
[source]
411
-
----
412
-
-a pta=...;taint-config:<path/to/config>;taint-interactive-mode:true;...
413
-
----
414
-
415
-
Once the taint analysis completes, Tai-e will enter an interactive state where you can:
416
-
417
-
1. Modify the taint configuration file(s) and press `r` in the console to re-run the taint analysis with your updated configuration.
418
-
2. Press `e` in the console to exit interactive mode.
419
-
420
-
421
431
== Output of Taint Analysis
422
432
Currently, the output of the taint analysis consists of two parts: console output and taint flow graph.
0 commit comments