Describe a firewall rule
Describe a firewall rule including policy-level overrides.
PolicyFirewallRuleDetailsApi.describeFirewallRuleOnPolicy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.describe_firewall_rule_on_policy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.describeFirewallRuleOnPolicy([param1, param2, ...])
path Parameters
successful operation
Not authorized to view the policy.
The policy or firewall rule does not exist.
- Java
- Python
- JavaScript
import com.trendmicro.deepsecurity.ApiClient; import com.trendmicro.deepsecurity.Configuration; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.ApiException; import com.trendmicro.deepsecurity.api.PolicyFirewallRuleDetailsApi; import com.trendmicro.deepsecurity.model.FirewallRule; public class DescribeFirewallRuleOnPolicyExample { public static void main(String[] args) { // Setup ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("YOUR HOST"); // Authentication ApiKeyAuth Legacy API Key = (ApiKeyAuth) defaultClient.getAuthentication("Legacy API Key"); Legacy API Key.setApiKey("YOUR API KEY"); try { defaultClient.trustAllCertificates(false); } catch (Exception e) { System.err.println("An exception occurred when calling ApiClient.trustAllCertificates"); e.printStackTrace(); } ApiKeyAuth Trend Micro Cloud One API Key = (ApiKeyAuth) defaultClient.getAuthentication("Trend Micro Cloud One API Key"); Trend Micro Cloud One API Key.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 PolicyFirewallRuleDetailsApi instance = new PolicyFirewallRuleDetailsApi(); Integer policyID = 1; Integer firewallRuleID = 1; Boolean overrides = false; String apiVersion = "YOUR VERSION"; try { // Please replace the parameter values with yours FirewallRule result = instance.describeFirewallRuleOnPolicy(policyID, firewallRuleID, overrides, apiVersion); System.out.println(result); } catch (ApiException e) { System.err.println("An exception occurred when calling PolicyFirewallRuleDetailsApi.describeFirewallRuleOnPolicy"); e.printStackTrace(); } } }
- 200
{- "name": "string",
- "description": "string",
- "action": "log-only",
- "priority": "0",
- "direction": "incoming",
- "frameType": "any",
- "frameNumber": 0,
- "frameNot": true,
- "protocol": "any",
- "protocolNumber": 0,
- "protocolNot": true,
- "sourceIPType": "any",
- "sourceIPValue": "string",
- "sourceIPMask": "string",
- "sourceIPRangeFrom": "string",
- "sourceIPRangeTo": "string",
- "sourceIPMultiple": [
- "string"
], - "sourceIPListID": 0,
- "sourceIPNot": true,
- "sourceMACType": "any",
- "sourceMACValue": "string",
- "sourceMACMultiple": [
- "string"
], - "sourceMACListID": 0,
- "sourceMACNot": true,
- "sourcePortType": "any",
- "sourcePortMultiple": [
- "string"
], - "sourcePortListID": 0,
- "sourcePortNot": true,
- "destinationIPType": "any",
- "destinationIPValue": "string",
- "destinationIPMask": "string",
- "destinationIPRangeFrom": "string",
- "destinationIPRangeTo": "string",
- "destinationIPMultiple": [
- "string"
], - "destinationIPListID": 0,
- "destinationIPNot": true,
- "destinationMACType": "any",
- "destinationMACValue": "string",
- "destinationMACMultiple": [
- "string"
], - "destinationMACListID": 0,
- "destinationMACNot": true,
- "destinationPortType": "any",
- "destinationPortMultiple": [
- "string"
], - "destinationPortListID": 0,
- "destinationPortNot": true,
- "anyFlags": true,
- "logDisabled": true,
- "includePacketData": true,
- "alertEnabled": true,
- "scheduleID": 0,
- "contextID": 0,
- "tcpflags": [
- "fin"
], - "ID": 0,
- "TCPNot": true,
- "ICMPType": 0,
- "ICMPCode": 0,
- "ICMPNot": true
}
Modify a firewall rule
Modify a firewall rule assigned to a policy. Any unset elements will be left unchanged.
PolicyFirewallRuleDetailsApi.modifyFirewallRuleOnPolicy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.modify_firewall_rule_on_policy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.modifyFirewallRuleOnPolicy([param1, param2, ...])
path Parameters
header Parameters
Request Body schema: application/json
The settings of the firewall rule to modify.
successful operation
Not authorized to modify the policy or the requested modification is not permitted.
The policy or firewall rule does not exist.
- Payload
- Java
- Python
- JavaScript
{- "name": "string",
- "description": "string",
- "action": "log-only",
- "priority": "0",
- "direction": "incoming",
- "frameType": "any",
- "frameNumber": 0,
- "frameNot": true,
- "protocol": "any",
- "protocolNumber": 0,
- "protocolNot": true,
- "sourceIPType": "any",
- "sourceIPValue": "string",
- "sourceIPMask": "string",
- "sourceIPRangeFrom": "string",
- "sourceIPRangeTo": "string",
- "sourceIPMultiple": [
- "string"
], - "sourceIPListID": 0,
- "sourceIPNot": true,
- "sourceMACType": "any",
- "sourceMACValue": "string",
- "sourceMACMultiple": [
- "string"
], - "sourceMACListID": 0,
- "sourceMACNot": true,
- "sourcePortType": "any",
- "sourcePortMultiple": [
- "string"
], - "sourcePortListID": 0,
- "sourcePortNot": true,
- "destinationIPType": "any",
- "destinationIPValue": "string",
- "destinationIPMask": "string",
- "destinationIPRangeFrom": "string",
- "destinationIPRangeTo": "string",
- "destinationIPMultiple": [
- "string"
], - "destinationIPListID": 0,
- "destinationIPNot": true,
- "destinationMACType": "any",
- "destinationMACValue": "string",
- "destinationMACMultiple": [
- "string"
], - "destinationMACListID": 0,
- "destinationMACNot": true,
- "destinationPortType": "any",
- "destinationPortMultiple": [
- "string"
], - "destinationPortListID": 0,
- "destinationPortNot": true,
- "anyFlags": true,
- "logDisabled": true,
- "includePacketData": true,
- "alertEnabled": true,
- "scheduleID": 0,
- "contextID": 0,
- "tcpflags": [
- "fin"
], - "TCPNot": true,
- "ICMPType": 0,
- "ICMPCode": 0,
- "ICMPNot": true
}
- 200
{- "name": "string",
- "description": "string",
- "action": "log-only",
- "priority": "0",
- "direction": "incoming",
- "frameType": "any",
- "frameNumber": 0,
- "frameNot": true,
- "protocol": "any",
- "protocolNumber": 0,
- "protocolNot": true,
- "sourceIPType": "any",
- "sourceIPValue": "string",
- "sourceIPMask": "string",
- "sourceIPRangeFrom": "string",
- "sourceIPRangeTo": "string",
- "sourceIPMultiple": [
- "string"
], - "sourceIPListID": 0,
- "sourceIPNot": true,
- "sourceMACType": "any",
- "sourceMACValue": "string",
- "sourceMACMultiple": [
- "string"
], - "sourceMACListID": 0,
- "sourceMACNot": true,
- "sourcePortType": "any",
- "sourcePortMultiple": [
- "string"
], - "sourcePortListID": 0,
- "sourcePortNot": true,
- "destinationIPType": "any",
- "destinationIPValue": "string",
- "destinationIPMask": "string",
- "destinationIPRangeFrom": "string",
- "destinationIPRangeTo": "string",
- "destinationIPMultiple": [
- "string"
], - "destinationIPListID": 0,
- "destinationIPNot": true,
- "destinationMACType": "any",
- "destinationMACValue": "string",
- "destinationMACMultiple": [
- "string"
], - "destinationMACListID": 0,
- "destinationMACNot": true,
- "destinationPortType": "any",
- "destinationPortMultiple": [
- "string"
], - "destinationPortListID": 0,
- "destinationPortNot": true,
- "anyFlags": true,
- "logDisabled": true,
- "includePacketData": true,
- "alertEnabled": true,
- "scheduleID": 0,
- "contextID": 0,
- "tcpflags": [
- "fin"
], - "ID": 0,
- "TCPNot": true,
- "ICMPType": 0,
- "ICMPCode": 0,
- "ICMPNot": true
}
Reset firewall rule overrides
Remove all overrides for a firewall rule from a policy.
PolicyFirewallRuleDetailsApi.resetFirewallRuleOnPolicy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.reset_firewall_rule_on_policy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.resetFirewallRuleOnPolicy([param1, param2, ...])
path Parameters
successful operation
Not authorized to modify the policy.
The policy does not exist.
- Java
- Python
- JavaScript
import com.trendmicro.deepsecurity.ApiClient; import com.trendmicro.deepsecurity.Configuration; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.ApiException; import com.trendmicro.deepsecurity.api.PolicyFirewallRuleDetailsApi; import com.trendmicro.deepsecurity.model.FirewallRule; public class ResetFirewallRuleOnPolicyExample { public static void main(String[] args) { // Setup ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("YOUR HOST"); // Authentication ApiKeyAuth Legacy API Key = (ApiKeyAuth) defaultClient.getAuthentication("Legacy API Key"); Legacy API Key.setApiKey("YOUR API KEY"); try { defaultClient.trustAllCertificates(false); } catch (Exception e) { System.err.println("An exception occurred when calling ApiClient.trustAllCertificates"); e.printStackTrace(); } ApiKeyAuth Trend Micro Cloud One API Key = (ApiKeyAuth) defaultClient.getAuthentication("Trend Micro Cloud One API Key"); Trend Micro Cloud One API Key.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 PolicyFirewallRuleDetailsApi instance = new PolicyFirewallRuleDetailsApi(); Integer policyID = 1; Integer firewallRuleID = 1; Boolean overrides = false; String apiVersion = "YOUR VERSION"; try { // Please replace the parameter values with yours FirewallRule result = instance.resetFirewallRuleOnPolicy(policyID, firewallRuleID, overrides, apiVersion); System.out.println(result); } catch (ApiException e) { System.err.println("An exception occurred when calling PolicyFirewallRuleDetailsApi.resetFirewallRuleOnPolicy"); e.printStackTrace(); } } }
- 200
{- "name": "string",
- "description": "string",
- "action": "log-only",
- "priority": "0",
- "direction": "incoming",
- "frameType": "any",
- "frameNumber": 0,
- "frameNot": true,
- "protocol": "any",
- "protocolNumber": 0,
- "protocolNot": true,
- "sourceIPType": "any",
- "sourceIPValue": "string",
- "sourceIPMask": "string",
- "sourceIPRangeFrom": "string",
- "sourceIPRangeTo": "string",
- "sourceIPMultiple": [
- "string"
], - "sourceIPListID": 0,
- "sourceIPNot": true,
- "sourceMACType": "any",
- "sourceMACValue": "string",
- "sourceMACMultiple": [
- "string"
], - "sourceMACListID": 0,
- "sourceMACNot": true,
- "sourcePortType": "any",
- "sourcePortMultiple": [
- "string"
], - "sourcePortListID": 0,
- "sourcePortNot": true,
- "destinationIPType": "any",
- "destinationIPValue": "string",
- "destinationIPMask": "string",
- "destinationIPRangeFrom": "string",
- "destinationIPRangeTo": "string",
- "destinationIPMultiple": [
- "string"
], - "destinationIPListID": 0,
- "destinationIPNot": true,
- "destinationMACType": "any",
- "destinationMACValue": "string",
- "destinationMACMultiple": [
- "string"
], - "destinationMACListID": 0,
- "destinationMACNot": true,
- "destinationPortType": "any",
- "destinationPortMultiple": [
- "string"
], - "destinationPortListID": 0,
- "destinationPortNot": true,
- "anyFlags": true,
- "logDisabled": true,
- "includePacketData": true,
- "alertEnabled": true,
- "scheduleID": 0,
- "contextID": 0,
- "tcpflags": [
- "fin"
], - "ID": 0,
- "TCPNot": true,
- "ICMPType": 0,
- "ICMPCode": 0,
- "ICMPNot": true
}
List firewall rules
Lists all firewall rules assigned to a policy.
PolicyFirewallRuleDetailsApi.listFirewallRulesOnPolicy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.list_firewall_rules_on_policy([param1, param2, ...])
PolicyFirewallRuleDetailsApi.listFirewallRulesOnPolicy([param1, param2, ...])
successful operation
Not authorized to view the policy.
The policy does not exist.
- Java
- Python
- JavaScript
import com.trendmicro.deepsecurity.ApiClient; import com.trendmicro.deepsecurity.Configuration; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.ApiException; import com.trendmicro.deepsecurity.api.PolicyFirewallRuleDetailsApi; import com.trendmicro.deepsecurity.model.FirewallRules; public class ListFirewallRulesOnPolicyExample { public static void main(String[] args) { // Setup ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("YOUR HOST"); // Authentication ApiKeyAuth Legacy API Key = (ApiKeyAuth) defaultClient.getAuthentication("Legacy API Key"); Legacy API Key.setApiKey("YOUR API KEY"); try { defaultClient.trustAllCertificates(false); } catch (Exception e) { System.err.println("An exception occurred when calling ApiClient.trustAllCertificates"); e.printStackTrace(); } ApiKeyAuth Trend Micro Cloud One API Key = (ApiKeyAuth) defaultClient.getAuthentication("Trend Micro Cloud One API Key"); Trend Micro Cloud One API Key.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 PolicyFirewallRuleDetailsApi instance = new PolicyFirewallRuleDetailsApi(); Integer policyID = 1; Boolean overrides = false; String apiVersion = "YOUR VERSION"; try { // Please replace the parameter values with yours FirewallRules result = instance.listFirewallRulesOnPolicy(policyID, overrides, apiVersion); System.out.println(result); } catch (ApiException e) { System.err.println("An exception occurred when calling PolicyFirewallRuleDetailsApi.listFirewallRulesOnPolicy"); e.printStackTrace(); } } }
- 200
{- "firewallRules": [
- {
- "name": "string",
- "description": "string",
- "action": "log-only",
- "priority": "0",
- "direction": "incoming",
- "frameType": "any",
- "frameNumber": 0,
- "frameNot": true,
- "protocol": "any",
- "protocolNumber": 0,
- "protocolNot": true,
- "sourceIPType": "any",
- "sourceIPValue": "string",
- "sourceIPMask": "string",
- "sourceIPRangeFrom": "string",
- "sourceIPRangeTo": "string",
- "sourceIPMultiple": [
- "string"
], - "sourceIPListID": 0,
- "sourceIPNot": true,
- "sourceMACType": "any",
- "sourceMACValue": "string",
- "sourceMACMultiple": [
- "string"
], - "sourceMACListID": 0,
- "sourceMACNot": true,
- "sourcePortType": "any",
- "sourcePortMultiple": [
- "string"
], - "sourcePortListID": 0,
- "sourcePortNot": true,
- "destinationIPType": "any",
- "destinationIPValue": "string",
- "destinationIPMask": "string",
- "destinationIPRangeFrom": "string",
- "destinationIPRangeTo": "string",
- "destinationIPMultiple": [
- "string"
], - "destinationIPListID": 0,
- "destinationIPNot": true,
- "destinationMACType": "any",
- "destinationMACValue": "string",
- "destinationMACMultiple": [
- "string"
], - "destinationMACListID": 0,
- "destinationMACNot": true,
- "destinationPortType": "any",
- "destinationPortMultiple": [
- "string"
], - "destinationPortListID": 0,
- "destinationPortNot": true,
- "anyFlags": true,
- "logDisabled": true,
- "includePacketData": true,
- "alertEnabled": true,
- "scheduleID": 0,
- "contextID": 0,
- "tcpflags": [
- "fin"
], - "ID": 0,
- "TCPNot": true,
- "ICMPType": 0,
- "ICMPCode": 0,
- "ICMPNot": true
}
]
}