Policy Intrusion Prevention Rule Assignments & Recommendations

List Intrusion Prevention Rule IDs

get/policies/{policyID}/intrusionprevention/assignments

Lists all intrustion prevention rule IDs assigned to a policy.

Related SDK Methods:
Java

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.listIntrusionPreventionRuleIDsOnPolicy([param1, param2, ...])

Python

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.list_intrusion_prevention_rule_ids_on_policy([param1, param2, ...])

JavaScript

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.listIntrusionPreventionRuleIDsOnPolicy([param1, param2, ...])

Request
path Parameters
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Responses
200

successful operation

403

Not authorized to view the policy.

Request samples
import com.trendmicro.deepsecurity.ApiClient;
import com.trendmicro.deepsecurity.Configuration;
import com.trendmicro.deepsecurity.auth.ApiKeyAuth;
import com.trendmicro.deepsecurity.ApiException;
import com.trendmicro.deepsecurity.api.PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi;
import com.trendmicro.deepsecurity.model.IntrusionPreventionAssignments;


public class ListIntrusionPreventionRuleIDsOnPolicyExample {
	
	public static void main(String[] args) {
		// Setup
		ApiClient defaultClient = Configuration.getDefaultApiClient();
		defaultClient.setBasePath("YOUR HOST");

		// Authentication
		ApiKeyAuth DefaultAuthentication = (ApiKeyAuth) defaultClient.getAuthentication("DefaultAuthentication");
		DefaultAuthentication.setApiKey("YOUR API KEY");
		try {
			defaultClient.trustAllCertificates(false);
		} catch (Exception e) {
			System.err.println("An exception occurred when calling ApiClient.trustAllCertificates");
			e.printStackTrace();
		}
		
		// Initialization
		// Set Any Required Values
		PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi instance = new PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi();
		Integer policyID = 1;
		Boolean overrides = false;
		String apiVersion = "YOUR VERSION";
		try {
			// Please replace the parameter values with yours
			IntrusionPreventionAssignments result = instance.listIntrusionPreventionRuleIDsOnPolicy(policyID, overrides, apiVersion);
			System.out.println(result);
		} catch (ApiException e) {
			System.err.println("An exception occurred when calling PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.listIntrusionPreventionRuleIDsOnPolicy");
			e.printStackTrace();
		}
	}
}

Response samples
application/json
{
  • "assignedRuleIDs": [
    ],
  • "assignedApplicationTypeIDs": [
    ],
  • "recommendationScanStatus": "none",
  • "lastRecommendationScanDate": 0,
  • "recommendedToAssignRuleIDs": [
    ],
  • "recommendedToUnassignRuleIDs": [
    ]
}

Add Intrusion Prevention Rule IDs

post/policies/{policyID}/intrusionprevention/assignments

Assign intrustion prevention rule IDs to a policy.

Related SDK Methods:
Java

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.addIntrusionPreventionRuleIDsToPolicy([param1, param2, ...])

Python

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.add_intrusion_prevention_rule_ids_to_policy([param1, param2, ...])

JavaScript

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.addIntrusionPreventionRuleIDsToPolicy([param1, param2, ...])

Request
path Parameters
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Request Body schema: application/json

The ID numbers of the intrustion prevention rules to add.

ruleIDs
Array of integers <int32>
Responses
200

successful operation

403

Not authorized to modify the policy or the requested modification is not permitted.

404

The policy does not exist.

Request samples
application/json
{
  • "ruleIDs": [
    ]
}
Response samples
application/json
{
  • "assignedRuleIDs": [
    ],
  • "assignedApplicationTypeIDs": [
    ],
  • "recommendationScanStatus": "none",
  • "lastRecommendationScanDate": 0,
  • "recommendedToAssignRuleIDs": [
    ],
  • "recommendedToUnassignRuleIDs": [
    ]
}

Set Intrusion Prevention Rule IDs

put/policies/{policyID}/intrusionprevention/assignments

Set intrustion prevention rule IDs assigned to a policy.

Related SDK Methods:
Java

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.setIntrusionPreventionRuleIDsOnPolicy([param1, param2, ...])

Python

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.set_intrusion_prevention_rule_ids_on_policy([param1, param2, ...])

JavaScript

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.setIntrusionPreventionRuleIDsOnPolicy([param1, param2, ...])

Request
path Parameters
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Request Body schema: application/json

The ID numbers of the intrustion prevention rules to set.

ruleIDs
Array of integers <int32>
Responses
200

successful operation

403

Not authorized to modify the policy or the requested modification is not permitted.

404

The policy does not exist.

Request samples
application/json
{
  • "ruleIDs": [
    ]
}
Response samples
application/json
{
  • "assignedRuleIDs": [
    ],
  • "assignedApplicationTypeIDs": [
    ],
  • "recommendationScanStatus": "none",
  • "lastRecommendationScanDate": 0,
  • "recommendedToAssignRuleIDs": [
    ],
  • "recommendedToUnassignRuleIDs": [
    ]
}

Remove an Intrusion Prevention Rule ID

delete/policies/{policyID}/intrusionprevention/assignments/{intrusionPreventionRuleID}

Unassign an intrustion prevention rule ID from a policy.

Related SDK Methods:
Java

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.removeIntrusionPreventionRuleIDFromPolicy([param1, param2, ...])

Python

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.remove_intrusion_prevention_rule_id_from_policy([param1, param2, ...])

JavaScript

PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.removeIntrusionPreventionRuleIDFromPolicy([param1, param2, ...])

Request
path Parameters
intrusionPreventionRuleID
required
integer <int32> \d+

The ID number of the intrustion prevention rule to delete.

Example: 1
policyID
required
integer <int32> \d+

The ID number of the policy.

Example: 1
query Parameters
overrides
boolean

Return only rule IDs assigned directly to the current policy.

header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Responses
200

successful operation

403

Not authorized to modify the policy or the requested modification is not permitted.

404

The policy does not exist.

Request samples
import com.trendmicro.deepsecurity.ApiClient;
import com.trendmicro.deepsecurity.Configuration;
import com.trendmicro.deepsecurity.auth.ApiKeyAuth;
import com.trendmicro.deepsecurity.ApiException;
import com.trendmicro.deepsecurity.api.PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi;
import com.trendmicro.deepsecurity.model.IntrusionPreventionAssignments;


public class RemoveIntrusionPreventionRuleIDFromPolicyExample {
	
	public static void main(String[] args) {
		// Setup
		ApiClient defaultClient = Configuration.getDefaultApiClient();
		defaultClient.setBasePath("YOUR HOST");

		// Authentication
		ApiKeyAuth DefaultAuthentication = (ApiKeyAuth) defaultClient.getAuthentication("DefaultAuthentication");
		DefaultAuthentication.setApiKey("YOUR API KEY");
		try {
			defaultClient.trustAllCertificates(false);
		} catch (Exception e) {
			System.err.println("An exception occurred when calling ApiClient.trustAllCertificates");
			e.printStackTrace();
		}
		
		// Initialization
		// Set Any Required Values
		PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi instance = new PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi();
		Integer policyID = 1;
		Integer intrusionPreventionRuleID = 1;
		Boolean overrides = false;
		String apiVersion = "YOUR VERSION";
		try {
			// Please replace the parameter values with yours
			IntrusionPreventionAssignments result = instance.removeIntrusionPreventionRuleIDFromPolicy(policyID, intrusionPreventionRuleID, overrides, apiVersion);
			System.out.println(result);
		} catch (ApiException e) {
			System.err.println("An exception occurred when calling PolicyIntrusionPreventionRuleAssignmentsRecommendationsApi.removeIntrusionPreventionRuleIDFromPolicy");
			e.printStackTrace();
		}
	}
}

Response samples
application/json
{
  • "assignedRuleIDs": [
    ],
  • "assignedApplicationTypeIDs": [
    ],
  • "recommendationScanStatus": "none",
  • "lastRecommendationScanDate": 0,
  • "recommendedToAssignRuleIDs": [
    ],
  • "recommendedToUnassignRuleIDs": [
    ]
}