Skip to content

Commit cef063e

Browse files
committed
release v1.0.6
1 parent a1ce341 commit cef063e

4 files changed

Lines changed: 74 additions & 24 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ venv
44
*.pyc
55
__pycache__/
66
/build/
7+
/dist
-16.4 KB
Binary file not shown.
Lines changed: 73 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,93 @@
11
Metadata-Version: 1.2
22
Name: dongtai-agent-python
3-
Version: 0.2.0
3+
Version: 1.0.6
44
Summary: DongTai IAST Agent for Python
55
Home-page: https://iast.huoxian.cn
66
Author: songjinghao
77
Author-email: jinghaosong@huoxian.cn
88
License: GPL-3
9-
Description: ## 1.下载探针
9+
Description: ## DongTai-agent-python
1010

11-
登陆 [IAST平台](https://iast.huoxian.cn/login) 在**部署IAST**中下载洞态IAST的Agent,将dongtai_agent_python.tar.gz文件放入WEB服务器(中间件)所在机器上
11+
[![django-project](https://img.shields.io/badge/django%20versions-3.2.8-blue)](https://www.djangoproject.com/)
12+
[![dongtai-project](https://img.shields.io/badge/dongtai%20versions-beta-green)](https://github.com/huoxianclub/dongtai)
13+
[![dongtai--agent--python](https://img.shields.io/badge/dongtai--agent--python-v1.0.6-lightgrey)](https://github.com/huoxianclub/dongtai-web)
1214

13-
注意,`curl url&projectName=<Demo Project>` 为可更改参数,`<projectName>`与创建的项目名称保持一致,agent将自动关联至项目;
14-
若下载时未配置`<projectName>`,可配置系统环境变量projectName,重启项目,同样生效,系统环境变量`<projectName>`优先级高于下载时配置的`<projectName>`;
15-
如果不配置该参数,需要进入项目管理中进行手工绑定。
16-
17-
## 2.安装探针
18-
- 找到下载的探针文件,直接执行命令
19-
```shell
20-
pip3 install ./dongtai-python-agent.tar.gz
21-
```
22-
23-
## 3.配置探针
15+
- [中文版本(Chinese version)](README.ZH_CN.md)
16+
17+
## Project Introduction
18+
19+
Dongtai-agent-python is DongTai Iast's data acquisition tool for Python applications. In a Python application with the iast agent added, the required data is collected by rewriting class bytecode, and then the data is sent to dongtai-OpenAPI service, and then the cloud engine processes the data to determine whether there are security holes.
20+
21+
DongTai-agent-python
22+
23+
- `dongtai_agent_python/config.json` For configuration DongTai-openapi Url、Token、Web-ProjectName。
24+
- `dongtai_agent_python/cli` Control the hot update of the agent version。
25+
- `dongtai_agent_python/middleware/` Used to access different python frameworks, currently supports Django and Flask, both of which are introduced in the form of middleware。
26+
- `dongtai_agent_python/assess/` Hook the underlying method of python according to the cloud strategy。
27+
- `dongtai_agent_python/report/` Report the collected data of the agent to the DongTai-openapi service。
28+
29+
## Application Scenarios
30+
31+
- DevOps
32+
- Security test the application before it goes online
33+
- Third-party Component Management
34+
- Code audit
35+
- 0 Day digging
2436

25-
### 3.1 Django
37+
## Quick Start
2638

27-
1.进入app的主目录
39+
Please refer to the [Quick Start](https://hxsecurity.github.io/DongTai-Doc/#/doc/tutorial/quickstart).
40+
41+
## Quick Development
42+
43+
1. Fork the [DongTai-agent-python](https://github.com/HXSecurity/DongTai-agent-python) , clone your fork:
44+
45+
```
46+
git clone https://github.com/<your-username>/DongTai-agent-python
47+
```
48+
49+
2. Write code to your needs.
50+
51+
3. The project is packaged and executed in the root directory of the agent project
52+
```shell
53+
python3 setup.py sdist
54+
```
55+
56+
4. Install the agent <br>
57+
After packaging, the dist directory will be generated, and the installation package will be found in the dist directory, Put the dongtai_agent_python.tar.gz installation package on the machine where the Web-server is located,Execute pip installation
58+
59+
```shell
60+
pip3 install ./dongtai-python-agent.tar.gz
61+
```
62+
63+
## 4.Project access Agent
2864

29-
2.打开`app/settings.py`文件,找到`MIDDLEWARE`所在行
65+
#### Django
3066

31-
3.在该行的下面插入`dongtai_agent_python.middlewares.django_middleware.FireMiddleware`
67+
1.Enter the main directory of the app
3268

33-
4.重启app
69+
2.Open the `app/settings.py` file and find the line of `MIDDLEWARE`
3470

71+
3.Insert below the line `dongtai_agent_python.middlewares.django_middleware.FireMiddleware`
3572

73+
4.Restart app
3674

75+
#### Flask
76+
1.Modify the entry file of the project (such as app.py) and add the following content
77+
78+
from dongtai_agent_python.middlewares.flask_middleware import AgentMiddleware
79+
80+
app = Flask(__name__)
81+
app.wsgi_app = AgentMiddleware(app.wsgi_app, app)
82+
83+
if __name__ == '__main__':
84+
app.run()
85+
86+
2.Restart app
87+
88+
89+
Note that the `project.name` in `dongtai_agent_python/config.json` needs to be consistent with the project name created in the iast-web page, The agent will be automatically linked to the project;
90+
If `project.name` is not configured, you can configure the system environment variable `projectName`, restart the project, the same will take effect, The priority of the system environment variable `projectName` is higher than the `project.name` in the configuration file;
3791
Platform: UNKNOWN
3892
Classifier: Environment :: Web Environment
3993
Classifier: Framework :: Django
@@ -44,9 +98,6 @@ Classifier: Operating System :: OS Independent
4498
Classifier: Programming Language :: Python
4599
Classifier: Programming Language :: Python :: 3
46100
Classifier: Programming Language :: Python :: 3 :: Only
47-
Classifier: Programming Language :: Python :: 3.6
48-
Classifier: Programming Language :: Python :: 3.7
49-
Classifier: Programming Language :: Python :: 3.8
50101
Classifier: Topic :: Internet :: WWW/HTTP
51102
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
52103
Requires-Python: >=3.6

dongtai_agent_python.egg-info/SOURCES.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ setup.py
55
dongtai_agent_python/__init__.py
66
dongtai_agent_python/config.json
77
dongtai_agent_python/global_var.py
8-
dongtai_agent_python/policy.json
98
dongtai_agent_python/policy_api.json
10-
dongtai_agent_python/try_test.py
119
dongtai_agent_python.egg-info/PKG-INFO
1210
dongtai_agent_python.egg-info/SOURCES.txt
1311
dongtai_agent_python.egg-info/dependency_links.txt

0 commit comments

Comments
 (0)