Skip to content

Commit 4083785

Browse files
authored
Merge pull request #119 from lostsnow/feature/release-1.4.0
release 1.4.0
2 parents e924a16 + 0ee2a83 commit 4083785

9 files changed

Lines changed: 60 additions & 29 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Changelog
22

3+
## [1.4.0](https://github.com/HXSecurity/DongTai-agent-python/releases/tag/v1.4.0) - 2022-06-06
4+
5+
* CHANGES
6+
* Change SCA package name format and signature [#118](https://github.com/HXSecurity/DongTai-agent-python/pull/118)
7+
8+
## [1.3.2](https://github.com/HXSecurity/DongTai-agent-python/releases/tag/v1.3.2) - 2022-03-09
9+
10+
* FEATURES
11+
* Add str/bytes/bytearray concat hook [#106](https://github.com/HXSecurity/DongTai-agent-python/pull/106)
12+
313
## [1.3.1](https://github.com/HXSecurity/DongTai-agent-python/releases/tag/v1.3.1) - 2022-02-23
14+
415
* FEATURES
516
* Add crypto bad cipher detection [#107](https://github.com/HXSecurity/DongTai-agent-python/pull/107)
617
* Add regular expression DOS attack detection [#111](https://github.com/HXSecurity/DongTai-agent-python/pull/111)
@@ -12,7 +23,7 @@
1223
* ENHANCEMENTS
1324
* performance optimization [#116](https://github.com/HXSecurity/DongTai-agent-python/pull/116)
1425
* code cleanup [#110](https://github.com/HXSecurity/DongTai-agent-python/pull/110)
15-
* Build
26+
* BUILD
1627
* When the github action runs, it automatically triggers openapi to pull the latest agent package [#113](https://github.com/HXSecurity/DongTai-agent-python/pull/113)
1728

1829
## [1.3.0](https://github.com/HXSecurity/DongTai-agent-python/releases/tag/v1.3.0) - 2022-01-07

CHANGELOG_CN.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# 升级日志
22

3+
## [1.4.0](https://github.com/HXSecurity/DongTai-agent-python/releases/tag/v1.4.0) - 2022-06-06
4+
5+
* 变更
6+
* 更改组件包的名称格式和签名 [#118](https://github.com/HXSecurity/DongTai-agent-python/pull/118)
7+
8+
## [1.3.2](https://github.com/HXSecurity/DongTai-agent-python/releases/tag/v1.3.2) - 2022-03-09
9+
10+
* 功能
11+
* 增加 str/bytes/bytearray 拼接(+) hook [#106](https://github.com/HXSecurity/DongTai-agent-python/pull/106)
12+
313
## [1.3.1](https://github.com/HXSecurity/DongTai-agent-python/releases/tag/v1.3.1) - 2022-02-23
14+
415
* 功能
516
* 增加弱加密算法漏洞检测 [#107](https://github.com/HXSecurity/DongTai-agent-python/pull/107)
617
* 增加正则表达式DOS攻击检测 [#111](https://github.com/HXSecurity/DongTai-agent-python/pull/111)

README.ZH_CN.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@
77

88
## 项目介绍
99

10-
DongTai-agent-python 是 **洞态IAST** 针对 Python 应用开发的数据采集端。在添加 iast-agent 代理的 Python 应用中,通过改写类字节码的方式采集所需数据,然后将数据发送至
11-
DongTai-openapi 服务,再由云端引擎处理数据判断是否存在安全漏洞。
10+
DongTai-agent-python 是 **洞态IAST** 针对 Python 应用开发的数据采集端。Python 应用中,通过改写方法和函数的方式采集所需数据,然后将数据发送至
11+
DongTai OpenAPI 服务,再由云端引擎处理数据判断是否存在安全漏洞。
1212

1313
DongTai-agent-python
1414

15-
- `dongtai_agent_python/config.json`用于配置DongTai-openapi服务地址、Token、项目名称。
16-
- `dongtai_agent_python/cli`控制agent版本的热更新。
17-
- `dongtai_agent_python/middleware/`用于接入不同的python框架,目前支持Django、Flask,均以中间件方式引入。
18-
- `dongtai_agent_python/assess/`根据云端策略hook python 底层方法。
19-
- `dongtai_agent_python/report/`将agent采集数据上报至DongTai-openapi服务。
15+
- `dongtai_agent_python/api/` 将 agent 采集的数据上报至 DongTai OpenAPI 服务。
16+
- `dongtai_agent_python/assess/` 根据云端策略 hook python 方法。
17+
- `dongtai_agent_python/assess_ext/` 根据云端策略 hook cpython 底层方法。
18+
- `dongtai_agent_python/cli/` 控制 agent 版本的热更新。
19+
- `dongtai_agent_python/context/` 请求上下文和上下文跟踪。
20+
- `dongtai_agent_python/middleware/` 用于接入不同的 python 框架,目前支持 Django、Flask, 均以中间件方式引入。
21+
- `dongtai_agent_python/policy/` 策略规则及污点数据处理。
22+
- `dongtai_agent_python/setting/` Agent 配置.
23+
- `dongtai_agent_python/config.json` 用于配置 DongTai OpenAPI 服务地址、Token、项目名称等。
2024

2125
## 应用场景
2226

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,28 @@
77

88
## Project Introduction
99

10-
Dongtai-agent-python is DongTai Iast's data acquisition tool for Python applications. In a Python application with the
11-
iast agent added, the required data is collected by rewriting class bytecode, and then the data is sent to
12-
dongtai-OpenAPI service, and then the cloud engine processes the data to determine whether there are security holes.
10+
DongTai-agent-python is DongTai IAST's data acquisition tool for Python applications. In a Python application, the required data is collected through patching methods and functions, sent to the DongTai OpenAPI service, and then the cloud engine processes the data to determine if there are security vulnerabilities.
1311

1412
DongTai-agent-python
1513

16-
- `dongtai_agent_python/config.json` For configuration DongTai-openapi Url、Token、Web-ProjectName。
17-
- `dongtai_agent_python/cli` Control the hot update of the agent version。
14+
- `dongtai_agent_python/api/` Report the collected data to the DongTai OpenAPI service.
15+
- `dongtai_agent_python/assess/` Hook python methods according to the cloud strategy.
16+
- `dongtai_agent_python/assess_ext/` Hook cpython underlying methods according to cloud strategy.
17+
- `dongtai_agent_python/cli/` Control the hot update of the agent version.
18+
- `dongtai_agent_python/context/` Request context and context tracker.
1819
- `dongtai_agent_python/middleware/` Used to access different python frameworks, currently supports Django and Flask,
19-
both of which are introduced in the form of middleware。
20-
- `dongtai_agent_python/assess/` Hook the underlying method of python according to the cloud strategy。
21-
- `dongtai_agent_python/report/` Report the collected data of the agent to the DongTai-openapi service。
20+
both of which are introduced in the form of middleware.
21+
- `dongtai_agent_python/policy/` Strategy rules and tainted data processing.
22+
- `dongtai_agent_python/setting/` Agent configuration.
23+
- `dongtai_agent_python/config.json` For configuration DongTai OpenAPI Url, Token, Project Name.
2224

2325
## Application Scenarios
2426

2527
- DevOps
2628
- Security test the application before it goes online
2729
- Third-party Component Management
2830
- Code audit
29-
- 0 Day digging
31+
- 0day digging
3032

3133
## Requirements
3234

@@ -50,7 +52,7 @@ DongTai-agent-python
5052

5153
## Quick Start
5254

53-
Please refer to the [Quick Start](https://doc.dongtai.io/en/02_start/index.html).
55+
Please refer to the [Quick Start](https://doc.dongtai.io/).
5456

5557
## Quick Development
5658

@@ -60,12 +62,11 @@ Please refer to the [Quick Start](https://doc.dongtai.io/en/02_start/index.html)
6062
```
6163
2. Write code to your needs.
6264
3. Modify the configuration file `dongtai_agent_python/config.json`
65+
* iast.server.token: "3d6bb430bc3e0b20dcc2d00000000000000a"
66+
* iast.server.url: "https://iast-test.huoxian.cn/openapi"
67+
* project.name: "DemoProjectName"
6368
64-
* iast.server.token: "3d6bb430bc3e0b20dcc2d00000000000000a"
65-
* iast.server.url: "https://iast-test.huoxian.cn/openapi"
66-
* project.name: "DemoProjectName"
67-
68-
> URL and token from the hole state IAST-web page (eg: https://iast-test.huoxian.cn/deploy) > python-agent deployment page,Obtained from the shell command of downloading agent,Replace the url domain name and token respectively
69+
> URL and token from the hole state IAST-web page (eg: https://iast-test.huoxian.cn/deploy) > python-agent deployment page,Obtained from the shell command of downloading agent,Replace the url domain name and token respectively
6970
7071
4. The project is packaged and executed in the root directory of the agent project
7172
```shell

dongtai_agent_python/api/openapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, setting):
3636
}
3737

3838
agent_prefix = platform.system() + ' ' + platform.release() + '-' + socket.gethostname()
39-
self.agent_version = self.config.get('engine', {}).get('version', 'v1.0.0')
39+
self.agent_version = self.setting.version
4040
self.agent_name = agent_prefix + '-' + self.agent_version + '-' + self.setting.engine_name
4141

4242
self.system_info = SystemInfo()

dongtai_agent_python/middlewares/base_middleware.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ def __init__(self, container):
1919
if BaseMiddleware.loaded:
2020
return
2121

22-
logger.info("python agent init")
2322
start_time = time.time()
2423
scope.enter_scope(scope.SCOPE_AGENT)
2524

25+
self.init_setting()
26+
logger.info("python agent init, version: " + self.setting.version)
27+
28+
self.setting.set_container(container)
29+
2630
# middleware id
2731
self.id = id(self)
28-
self.setting = None
2932
self.executor = ThreadPoolExecutor()
30-
self.init_setting()
31-
self.setting.set_container(container)
3233

3334
self.openapi = OpenAPI(self.setting)
3435

dongtai_agent_python/setting/setting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22

3+
from dongtai_agent_python import version
34
from .config import Config
45
from dongtai_agent_python.utils import Singleton
56

@@ -11,6 +12,7 @@ def init(self):
1112
if Setting.loaded:
1213
return
1314

15+
self.version = version.__version__
1416
self.paused = False
1517
self.manual_paused = False
1618
self.agent_id = 0

dongtai_agent_python/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '1.4.0'

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = dongtai_agent_python
3-
version = 1.3.0
3+
version = attr: dongtai_agent_python.version.__version__
44
description = DongTai IAST Agent for Python
55
long_description = file: README.md
66
url = https://dongtai.io

0 commit comments

Comments
 (0)