-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2658 from TencentBlueKing/master
Merge: master->3.8.x
- Loading branch information
Showing
245 changed files
with
7,185 additions
and
2,432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
### Function Description | ||
|
||
High risk script detection | ||
|
||
### Request Parameters | ||
|
||
{{ common_args_desc }} | ||
|
||
#### Interface parameters | ||
|
||
| Fields | Type | Required | Description | | ||
| --------------- | ------ | -------- | ------------------------------------------------------------ | | ||
| script_language | int | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | | ||
| content | string | yes | Script content, requiring Base64 encoding | | ||
|
||
|
||
### Example of request | ||
|
||
```json | ||
{ | ||
"bk_app_code": "esb_test", | ||
"bk_app_secret": "xxx", | ||
"bk_token": "xxx", | ||
"script_language": 1, | ||
"content": "cm0gLXJmIC8=" | ||
} | ||
``` | ||
|
||
### Example of responses | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"result": true, | ||
"data": [ | ||
{ | ||
"line": 1, | ||
"line_content": "rm /tmp", | ||
"match_content": "rm /tmp", | ||
"level": 1, | ||
"description": "The first line of the script does not define a valid script type, for example: #!/bin/bash" | ||
}, | ||
{ | ||
"line": 1, | ||
"line_content": "rm /tmp", | ||
"match_content": "rm", | ||
"level": 3, | ||
"description": "dangerous!!!" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Response Description | ||
|
||
#### response | ||
|
||
| Fields | Type | Description | | ||
| ---------- | ------ | ------------------------------------------------------------ | | ||
| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | | ||
| code | int | Error code. 0 indicates success, >0 indicates failure | | ||
| message | string | Error message | | ||
| data | object | Data returned by request | | ||
| permission | object | Permission information | | ||
|
||
#### data | ||
|
||
| Fields | Type | Description | | ||
| ------------- | ------ | --------------------------------------------------- | | ||
| line | int | Number of rows where the error occurred | | ||
| line_content | string | The content of the line where the script is located | | ||
| match_content | string | Matching Content | | ||
| level | int | Error level: 1- Warning, 2- Error, 3- Fatal | | ||
| description | string | Description | |
79 changes: 79 additions & 0 deletions
79
docs/apidoc/esb/jobv3-confapis/apidocs/en/create_dangerous_rule.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
### Function Description | ||
|
||
Create dangerous rule | ||
|
||
### Request Parameters | ||
|
||
{{ common_args_desc }} | ||
|
||
#### Interface parameters | ||
|
||
| Fields | Type | Required | Description | | ||
| -------------------- | ------ | -------- | ------------------------------------------------------------ | | ||
| expression | string | yes | Expression | | ||
| script_language_list | array | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | | ||
| description | string | yes | Rule description | | ||
| action | int | yes | Processing actions: 1- Scan, 2- Intercept | | ||
|
||
|
||
### Example of request | ||
|
||
```json | ||
{ | ||
"bk_app_code": "esb_test", | ||
"bk_app_secret": "xxx", | ||
"bk_token": "xxx", | ||
"expression": "rm -rf", | ||
"script_language_list": [1], | ||
"description": "drangerous!!!", | ||
"action": 2 | ||
} | ||
``` | ||
|
||
### Example of responses | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"result": true, | ||
"data": { | ||
"id": 1, | ||
"expression": "rm -rf", | ||
"script_language_list": [1], | ||
"description": "drangerous!!!", | ||
"action": 2, | ||
"status": 0, | ||
"creator": "admin", | ||
"create_time": 1695193968000, | ||
"last_modify_user": "admin", | ||
"last_modify_time": 1695193968000 | ||
} | ||
} | ||
``` | ||
|
||
### Response Description | ||
|
||
#### response | ||
|
||
| Fields | Type | Description | | ||
| ---------- | ------ | ------------------------------------------------------------ | | ||
| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | | ||
| code | int | Error code. 0 indicates success, >0 indicates failure | | ||
| message | string | Error message | | ||
| data | object | Data returned by request | | ||
| permission | object | Permission information | | ||
|
||
#### data | ||
|
||
| Fields | Type | Description | | ||
| -------------------- | ------ | ------------------------------------------------------------ | | ||
| id | long | Rule id | | ||
| expression | string | expression | | ||
| script_language_list | array | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | | ||
| description | string | Description | | ||
| action | int | Processing actions: 1- Scan, 2- Intercept | | ||
| status | int | Enabling status: 0- disabled, 1- enabled | | ||
| creator | string | Creator | | ||
| create_time | long | Created time, Unix timestamp | | ||
| last_modify_user | string | Last modify user | | ||
| last_modify_time | long | Last modified time, Unix timestamp | |
50 changes: 50 additions & 0 deletions
50
docs/apidoc/esb/jobv3-confapis/apidocs/en/delete_dangerous_rule.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
### Function Description | ||
|
||
Delete dangerous rule | ||
|
||
### Request Parameters | ||
|
||
{{ common_args_desc }} | ||
|
||
#### Interface parameters | ||
|
||
| Fields | Type | Required | Description | | ||
| ------ | ---- | -------- | ----------- | | ||
| id | long | yes | Rule id | | ||
|
||
|
||
### Example of request | ||
|
||
```json | ||
{ | ||
"bk_app_code": "esb_test", | ||
"bk_app_secret": "xxx", | ||
"bk_token": "xxx", | ||
"id": 1 | ||
} | ||
``` | ||
|
||
### Example of responses | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"result": true | ||
} | ||
``` | ||
|
||
### Response Description | ||
|
||
#### response | ||
|
||
| Fields | Type | Description | | ||
| ---------- | ------ | ------------------------------------------------------------ | | ||
| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | | ||
| code | int | Error code. 0 indicates success, >0 indicates failure | | ||
| message | string | Error message | | ||
| data | object | Data returned by request | | ||
| permission | object | Permission information | | ||
|
||
#### data | ||
|
||
null |
57 changes: 57 additions & 0 deletions
57
docs/apidoc/esb/jobv3-confapis/apidocs/en/disable_dangerous_rule.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
### Function Description | ||
|
||
Disable dangerous rule | ||
|
||
### Request Parameters | ||
|
||
{{ common_args_desc }} | ||
|
||
#### Interface parameters | ||
|
||
| Fields | Type | Required | Description | | ||
| ------ | ---- | -------- | ----------- | | ||
| id | long | yes | Rule id | | ||
|
||
|
||
### Example of request | ||
|
||
```json | ||
{ | ||
"bk_app_code": "esb_test", | ||
"bk_app_secret": "xxx", | ||
"bk_token": "xxx", | ||
"id": 1 | ||
} | ||
``` | ||
|
||
### Example of responses | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"result": true, | ||
"data": { | ||
"id": 1, | ||
"status": 0 | ||
} | ||
} | ||
``` | ||
|
||
### Response Description | ||
|
||
#### response | ||
|
||
| Fields | Type | Description | | ||
| ---------- | ------ | ------------------------------------------------------------ | | ||
| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | | ||
| code | int | Error code. 0 indicates success, >0 indicates failure | | ||
| message | string | Error message | | ||
| data | object | Data returned by request | | ||
| permission | object | Permission information | | ||
|
||
#### data | ||
|
||
| Fields | Type | Description | | ||
| ------ | ---- | ---------------------------------------- | | ||
| id | long | Rule id | | ||
| status | int | Enabling status: 0- disabled, 1- enabled | |
57 changes: 57 additions & 0 deletions
57
docs/apidoc/esb/jobv3-confapis/apidocs/en/enable_dangerous_rule.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
### Function Description | ||
|
||
Enable dangerous rule | ||
|
||
### Request Parameters | ||
|
||
{{ common_args_desc }} | ||
|
||
#### Interface parameters | ||
|
||
| Fields | Type | Required | Description | | ||
| ------ | ---- | -------- | ----------- | | ||
| id | long | yes | Rule id | | ||
|
||
|
||
### Example of request | ||
|
||
```json | ||
{ | ||
"bk_app_code": "esb_test", | ||
"bk_app_secret": "xxx", | ||
"bk_token": "xxx", | ||
"id": 1 | ||
} | ||
``` | ||
|
||
### Example of responses | ||
|
||
```json | ||
{ | ||
"code": 0, | ||
"result": true, | ||
"data": { | ||
"id": 1, | ||
"status": 1 | ||
} | ||
} | ||
``` | ||
|
||
### Response Description | ||
|
||
#### response | ||
|
||
| Fields | Type | Description | | ||
| ---------- | ------ | ------------------------------------------------------------ | | ||
| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | | ||
| code | int | Error code. 0 indicates success, >0 indicates failure | | ||
| message | string | Error message | | ||
| data | object | Data returned by request | | ||
| permission | object | Permission information | | ||
|
||
#### data | ||
|
||
| Fields | Type | Description | | ||
| ------ | ---- | ---------------------------------------- | | ||
| id | long | Rule id | | ||
| status | int | Enabling status: 0- disabled, 1- enabled | |
Oops, something went wrong.