Adding a Protection Policy
Function
This API is used to add a protection policy. It specifies a protection policy, including the policy name, rule enabling status, protection action, and detection rule configuration.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
POST /v5/{project_id}/rasp/policy
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
The project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
x-auth-token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
feature_list |
No |
Array of ChkFeatureInfo objects |
Detection feature rules |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
chk_feature_id |
Yes |
Integer |
Detection feature rule ID |
|
protective_action |
Yes |
Integer |
Protection action: 1 (detect) or 2 (detect and block, or block) |
|
enabled |
Yes |
Integer |
Enabled status. 0: disabled; 1: enabled. |
|
feature_configure |
Yes |
String |
Checking feature rule configurations |
Response Parameters
Status code: 200
Request succeeded.
None
Example Requests
Add a policy for application protection.
POST https://{endpoint}/v5/{project_id}/rasp/policy
{
"feature_list" : [ {
"chk_feature_id" : 1,
"protective_action" : 1,
"enabled" : 0,
"feature_configure" : "/hips/cloudsoa-api/rasp/v1/alarmList"
} ]
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot