Example: Enabling IDP in a Security Policy (CLI)

For transit traffic to pass through Intrusion Detection and Prevention (IDP) inspection, you configure a security policy and enable IDP application services on all traffic that you want to inspect. Security policies contain rules defining the types of traffic permitted on the network and the way that the traffic is treated inside the network. Enabling IDP in a security policy directs traffic that matches the specified criteria to be checked against the IDP rulebases.

To allow transit traffic to pass through without IDP inspection, specify a permit action for the rule without enabling the IDP application services. Traffic matching the conditions in this rule passes through the device without IDP inspection.

Before you begin:

  1. Configure network interfaces. See the JUNOS Software Interfaces Configuration Guide for Security Devices.
  2. Create security zones. See Example: Creating Security Zones.
  3. Configure applications. See Example: Configuring IDP Applications and Services (CLI).

In this example, you configure two policies—idp-app-policy-1 and idp-app-policy-2. You configure these policies to enable IDP services on all traffic flowing in both directions on the device. Policy idp-app-policy-1 directs all traffic flowing from previously configured zones Zone1 to Zone2 to be checked against IDP rulebases. The policy idp-app-policy-2 directs all traffic flowing from Zone2 to Zone1 to be checked against IDP rulebases.

Note: The action set in the security policy action must be permit. You cannot enable IDP for traffic that the device denies or rejects.

To enable IDP in a security policy:

  1. Create a security policy. The following statement creates a policy idp-app-policy-1 for traffic traversing from Zone1 to Zone2:
    user@host# set security policies from-zone Zone1 to-zone Zone2 policy idp-app-policy-1
  2. Specify the match conditions for the traffic flowing in one direction. The following statement specifies that traffic from any source address, to any destination address and with any application type, matches the criteria for this policy:
    user@host# set security policies from-zone Zone1 to-zone Zone2 policy idp-app-policy-1 match source-address any destination-address any application any
  3. Specify the action to be taken on traffic that matches the specified conditions. The following statement permits all traffic matching the specified criteria and directs it to be checked against IDP rulebases:
    user@host# set security policies from-zone Zone1 to-zone Zone2 policy idp-app-policy-1 then permit application-services idp
  4. Create another security policy for traffic in the other direction. The following statement creates another policy idp-app-policy-2 for traffic from Zone2 to Zone1:
    user@host# set security policies from-zone Zone2 to-zone Zone1 policy idp-app-policy-2
  5. Specify the match conditions for the traffic flowing in the other direction. The following statement specifies that traffic from any source, to any destination with any application type, matches the criteria for this policy:
    user@host# set security policies from-zone Zone2 to-zone Zone1 policy idp-app-policy-2 match source-address any destination-address any application any
  6. Specify the action to be taken on traffic that matches the conditions specified in the policy. The following statement permits all traffic matching the specified criteria and directs it to be checked against IDP rulebases:
    user@host# set security policies from-zone Zone2 to-zone Zone1 policy idp-app-policy-2 then permit application-services idp
  7. If you are finished configuring the device, commit the configuration.
  8. You can verify the configuration by using the show security policies command. For more information, see the JUNOS Software CLI Reference.

Related Topics