Skip to content

Commit 7d1186c

Browse files
committed
Add the first version of taint analysis config format
1 parent 332c215 commit 7d1186c

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

docs/TaintAnalysis.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Taint Analysis
2+
3+
## Configuration
4+
5+
- Each method description can contain the key `conditions` (optionally).
6+
- Keys like `add-to` or `remove-from` may contain a list of values or only one value.
7+
Possible values:
8+
- this
9+
- arg1
10+
- arg2
11+
- ...
12+
- return
13+
- Fully qualified name of the method may be determined in parts.
14+
15+
**Example:**
16+
17+
```YAML
18+
sources:
19+
com:
20+
abc.method1:
21+
add-to: [this, return]
22+
marks: nullable
23+
bca.method2:
24+
add-to: return
25+
marks: [sensitive-data, sql-injection]
26+
27+
passes:
28+
com.abc.method2:
29+
conditions:
30+
this: "some string" # value: bool, int, float or string
31+
arg0:
32+
not: ""
33+
arg1: <int> # type
34+
arg2: [1, 2, 3] # arg2 should be equal to one of: 1, 2 or 3
35+
arg3:
36+
not: [4, 5, 6]
37+
arg4: [<float>, <java.lang.String>]
38+
arg5:
39+
not: [<int>, <boolean>]
40+
return: false
41+
get-from: [this, arg1, arg3]
42+
add-to: [return]
43+
marks: sensitive-data
44+
45+
cleaners:
46+
java.lang.String.isEmpty:
47+
conditions:
48+
return: true
49+
remove-from: this
50+
marks: [sensitive-data, sql-injection]
51+
com.company.method8:
52+
remove-from: [arg1, return]
53+
marks: nullable
54+
55+
sinks:
56+
org.example:
57+
log:
58+
check-in: arg1
59+
marks: [sensitive-data, nullable]
60+
sink0:
61+
check-in: [arg1, arg3]
62+
marks: nullable
63+
```

0 commit comments

Comments
 (0)