cobraphp 0.1.0.dev2__py3-none-any.whl → 0.1.0.dev3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cobraphp/analysis/__init__.py +3 -1
- {cobraphp-0.1.0.dev2.dist-info → cobraphp-0.1.0.dev3.dist-info}/METADATA +11 -1
- {cobraphp-0.1.0.dev2.dist-info → cobraphp-0.1.0.dev3.dist-info}/RECORD +6 -6
- {cobraphp-0.1.0.dev2.dist-info → cobraphp-0.1.0.dev3.dist-info}/WHEEL +0 -0
- {cobraphp-0.1.0.dev2.dist-info → cobraphp-0.1.0.dev3.dist-info}/licenses/LICENSE +0 -0
- {cobraphp-0.1.0.dev2.dist-info → cobraphp-0.1.0.dev3.dist-info}/top_level.txt +0 -0
cobraphp/analysis/__init__.py
CHANGED
|
@@ -10,7 +10,7 @@ from php_parser_py import AST
|
|
|
10
10
|
|
|
11
11
|
from ._call_builder import CallBuilder
|
|
12
12
|
from ._errors import AnalysisTimeoutError, StaticAnalysisError
|
|
13
|
-
from ._file_filter import make_app_file_filter
|
|
13
|
+
from ._file_filter import app_file_filter, framework_excluded_dirs, make_app_file_filter
|
|
14
14
|
from ._records import DataFlowGraph, backward_slice, call_graph_export, data_flow_graph
|
|
15
15
|
from ._source_kinds import DATABASE, USER_INPUT
|
|
16
16
|
from ._taint_propagator import TaintPropagator
|
|
@@ -53,8 +53,10 @@ __all__ = [
|
|
|
53
53
|
"AnalysisTimeoutError",
|
|
54
54
|
"DataFlowGraph",
|
|
55
55
|
"StaticAnalysisError",
|
|
56
|
+
"app_file_filter",
|
|
56
57
|
"backward_slice",
|
|
57
58
|
"build_call_graph",
|
|
58
59
|
"build_data_flow",
|
|
60
|
+
"framework_excluded_dirs",
|
|
59
61
|
"make_app_file_filter",
|
|
60
62
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cobraphp
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev3
|
|
4
4
|
Summary: Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects.
|
|
5
5
|
License-Expression: GPL-2.0-only
|
|
6
6
|
Requires-Python: >=3.11
|
|
@@ -75,6 +75,16 @@ for node_id in flow.tainted[USER_INPUT]:
|
|
|
75
75
|
print(node_id, backward_slice(flow, node_id, max_depth=3))
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
Apply the same file exclusions outside `parse_project`:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from cobraphp.analysis import app_file_filter, framework_excluded_dirs
|
|
82
|
+
|
|
83
|
+
framework_dirs = framework_excluded_dirs(root.resolve())
|
|
84
|
+
app_files = [p for p in root.resolve().rglob("*.php")
|
|
85
|
+
if app_file_filter(p) and not any(p.is_relative_to(d) for d in framework_dirs)]
|
|
86
|
+
```
|
|
87
|
+
|
|
78
88
|
Handle a failure:
|
|
79
89
|
|
|
80
90
|
```python
|
|
@@ -8,7 +8,7 @@ cobraphp/graphs.py,sha256=5f4ZbC4mouxlkeGTEhivDbhyK2ZwdO87KPWCnCnaXLI,1793
|
|
|
8
8
|
cobraphp/project.py,sha256=LL4RhwIB-eInyIqD30Us948bDFizDZzK31YhgZOOug0,1497
|
|
9
9
|
cobraphp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
cobraphp/results.py,sha256=fc5CUVPZ__SDdKyxQ1UyQJt3FSM6yfzOfaBCGL1Wtss,3055
|
|
11
|
-
cobraphp/analysis/__init__.py,sha256=
|
|
11
|
+
cobraphp/analysis/__init__.py,sha256=mFh_hJC6njArcr0jPi4uiblvM0ARONwejann69LOa5o,2469
|
|
12
12
|
cobraphp/analysis/_ast_types.py,sha256=4_7ga_CcAbRxLTKuXCn-Bhn7Elprnq13r561hxJTtSw,661
|
|
13
13
|
cobraphp/analysis/_call_builder.py,sha256=TAQAxBSLwgrVzBFaU9QNLcDtHwbLNRSYg-kZlb3-ptw,6189
|
|
14
14
|
cobraphp/analysis/_call_graph.py,sha256=nlo_8VCvc5JzVTrH7MMicbT49Rgwd-EuAewLrJoALx8,8081
|
|
@@ -28,8 +28,8 @@ cobraphp/analysis/frameworks.toml,sha256=MUGFYwMC6P7h-cj2_WUMGytYHWA9ZCTuGg_7LTk
|
|
|
28
28
|
cobraphp/analysis/php_ast_types.toml,sha256=fvh3SfjGm1IyJvRkBAhnOLnxCdT5ejowxDBRuOIxOcg,1032
|
|
29
29
|
cobraphp/analysis/rules/database_taint.yaml,sha256=xCx64v2RjponPfEYZOQUqSqP_ltV8YB-t5NldjOstcI,3495
|
|
30
30
|
cobraphp/analysis/rules/user_input_taint.yaml,sha256=47nknffSg_wIKGPg8Ya-r4POa4nWswopju2IEkcFvtc,6998
|
|
31
|
-
cobraphp-0.1.0.
|
|
32
|
-
cobraphp-0.1.0.
|
|
33
|
-
cobraphp-0.1.0.
|
|
34
|
-
cobraphp-0.1.0.
|
|
35
|
-
cobraphp-0.1.0.
|
|
31
|
+
cobraphp-0.1.0.dev3.dist-info/licenses/LICENSE,sha256=-cN1ob5KQfe3AwHdg8kcuJ5BVnR4hZt37vN1pS14JQU,18091
|
|
32
|
+
cobraphp-0.1.0.dev3.dist-info/METADATA,sha256=O6GcLERoltia3S3ixbnouAiY0Ckqyj-0szhcO3ztDCM,4431
|
|
33
|
+
cobraphp-0.1.0.dev3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
34
|
+
cobraphp-0.1.0.dev3.dist-info/top_level.txt,sha256=55CayiaOZMnPngJQf8IqO50E-l0BQONI8DTpnn-gtJk,9
|
|
35
|
+
cobraphp-0.1.0.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|