Configuring Network Attack Protection With IDS Screens for Next Gen Services
Configuring the IDS Screen Name, Direction, and Alarm Option
Configure the IDS screen name, traffic direction, and optional alarm.
- Specify a name for the IDS screen.[edit services screen]user@host# set ids-option screen-name
- Specify whether the IDS screen is applied to input traffic,
output traffic, or both.[edit services screen ids-option screen-name]user@host# set match-direction (input | input-output |output)
- If you want the IDS screen to log an alarm when packets
exceed the session limit, rather than drop packets, configure alarm-without-drop.[edit services screen ids-option screen-name]user@host# set alarm-without-drop
Configuring Session Limits in the IDS Screen
You can use IDS screens to set session limits for traffic from individual addresses or subnets and to individual addresses or subnets. This protects against network probing and flooding attacks. Table 1 shows the session limit options that protect against some common network probing and flooding attacks.
Table 1: IDS Screen Options for Network Attacks Type
Network Attack Type | [edit services screen ids-options screen-name limit-sessions] Options to Set |
---|---|
ICMP Address Sweep | by-source by-protocol icmp { maximum-sessions number; packet-rate number; session-rate number; } |
ICMP Flood | by-destination by-protocol icmp { maximum-sessions number; packet-rate number; session-rate number; } |
TCP Port Scan | (by-destination | by-source) by-protocol tcp { maximum-sessions number; packet-rate number; } |
TCP SYN Flood | (by-destination | by-source) by-protocol tcp { maximum-sessions number; packet-rate number; session-rate number; } |
UDP Flood | by-destination by-protocol udp { maximum-sessions number; packet-rate number; session-rate number; } |
To configure the session limits in an IDS screen:
- If you want to apply session limits to an aggregation
of all sessions to individual destination subnets or from individual
source subnets rather than individual addresses, configure aggregation.
- To apply session limits to an aggregation of all sessions
from within an individual IPv4 subnet, specify the subnet prefix length.
The range is from 1 through 32.[edit services screen ids-option screen-name aggregations]user@host# set source-prefix-mask prefix-value
For example, the following statement configures an IPv4 prefix length of 24, and sessions from 192.0.2.2 and 192.0.2.3 are counted as sessions from the 192.0.2.0/24/24 subnet.
[edit services screen ids-option screen1 aggregations]user@host# set source-prefix-mask 24 - To apply session limits to an aggregation of all sessions
from within an individual IPv6 subnet, specify the subnet prefix length.
The range is from 1 through 128.[edit services screen ids-option screen-name aggregations]user@host# set source-prefix-ipv6-mask prefix-value
For example, the following statement configures an IPv6 prefix length of 64, and sessions from 2001:db8:1234:72a2::2 and 2001:db8:1234:72a2::3 are counted as sessions from the 2001:db8:1234:72a2::/64 subnet.
[edit services screen ids-option screen1 aggregations]user@host# set source-prefix-ipv6-mask 64 - To apply session limits to an aggregation of all sessions
to an individual IPv4 subnet, specify the subnet prefix length. The
range is from 1 through 32.[edit services screen ids-option screen-name aggregations]user@host# set destination-prefix-mask prefix-value
- To apply session limits to an aggregation of all sessions
to an individual IPv6 subnet, specify the subnet prefix length. The
range is from 1 through 128.[edit services screen ids-option screen-name aggregations]user@host# set destination-prefix-ipv6-mask prefix-value
- To apply session limits to an aggregation of all sessions
from within an individual IPv4 subnet, specify the subnet prefix length.
The range is from 1 through 32.
- If you want to apply session limits from a source for
a particular IP protocol:
- Configure the maximum number of concurrent sessions allowed
from an individual source IP address or subnet for a particular IP
protocol.[edit services screen ids-option screen-name limit-session by-source ]user@host# set by-protocol (icmp | tcp | udp) maximum-sessions number
- Configure the maximum number of packets per second allowed
from an individual source IP address or subnet for a particular protocol.[edit services screen ids-option screen-name limit-session by-source ]user@host# set by-protocol (icmp | tcp | udp) packet-rate number
- Configure the maximum number of connections per second
allowed from an individual source IP address or subnet for a particular
protocol.[edit services screen ids-option screen-name limit-session by-source ]user@host# set by-protocol (icmp | tcp | udp) session-rate number
- Configure the maximum number of concurrent sessions allowed
from an individual source IP address or subnet for a particular IP
protocol.
- If you want to apply session limits to a destination for
a particular IP protocol:
- Configure the maximum number of concurrent sessions allowed
to an individual destination IP address or subnet for a particular
IP protocol.[edit services screen ids-option screen-name limit-session by-destination]user@host# set by-protocol (icmp | tcp | udp) maximum-sessions number
- Configure the maximum number of packets per second allowed
to an individual destination IP address or subnet for a particular
protocol.[edit services screen ids-option screen-name limit-session by-destination ]user@host# set by-protocol (icmp | tcp | udp) packet-rate number
- Configure the maximum number of connections per second
allowed to an individual destination IP address or subnet for a particular
protocol.[edit services screen ids-option screen-name limit-session by-destination ]user@host# set by-protocol (icmp | tcp | udp) session-rate number
- Configure the maximum number of concurrent sessions allowed
to an individual destination IP address or subnet for a particular
IP protocol.
- If you want to apply session limits from a source regardless
of the IP protocol:
- Configure the maximum number of concurrent sessions allowed
from an individual source IP address or subnet.[edit services screen ids-option screen-name limit-session by-source ]user@host# set maximum-sessions number
- Configure the maximum number of packets per second allowed
from an individual source IP address or subnet [edit services screen ids-option screen-name limit-session by-source ]user@host# set packets-rate number
- Configure the maximum number of connections per second
allowed from an individual source IP address or subnet.[edit services screen ids-option screen-name limit-session by-source ]user@host# set session-rate number
- Configure the maximum number of concurrent sessions allowed
from an individual source IP address or subnet.
- If you want to apply session limits to a destination regardless
of the IP protocol:
- Configure the maximum number of concurrent sessions allowed
to an individual destination IP address or subnet.[edit services screen ids-option screen-name limit-session by-destination ]user@host# set maximum-sessions number
- Configure the maximum number of packets per second allowed
to an individual destination IP address or subnet [edit services screen ids-option screen-name limit-session by-destination ]user@host# set packets-rate number
- Configure the maximum number of connections per second
allowed to an individual destination IP address or subnet.[edit services screen ids-option screen-name limit-session by-destination]user@host# set session-rate number
- Configure the maximum number of concurrent sessions allowed
to an individual destination IP address or subnet.
- Specify the services card CPU utilization percentage that
triggers the installation of a dynamic filter on the PFEs of the line
cards for suspicious traffic. The default value is 90.[edit services screen]user@host# set cpu-throttle percentage percent
In addition to the CPU utilization percentage threshold, the packet rate or connection rate for an individual source or destination address must exceed four times the session limit in the IDS screen before the dynamic filter is installed. Dynamic filters are not created from IDS screens that use subnet aggregation.
The dynamic filter drops the suspicious traffic at the PFE, without the traffic being processed by the IDS screen. When the packet or connection rate no longer exceeds four times the limit in the IDS screen, the dynamic filter is removed.
Configuring Suspicious Packet Pattern Detection in the IDS Screen
You can use IDS screens to identify and drop suspicious packets. This protects against attackers that craft unusual packets to launch denial-of-service attacks.
To configure suspicious pattern detection:
- To protect against ICMP fragmentation attacks, identify
and drop ICMP packets that are IP fragments.[edit services screen ids-option screen-name icmp]user@host# set fragment
- To identify and drop malformed ICMPv6 packets, configure icmpv6-malformed.[edit services screen ids-option screen-name icmp]user@host# set icmpv6-malformed
- To protect against ICMP large packet attacks, identify
and drop ICMP packets that are larger than 1024 bytes.[edit services screen ids-option screen-name icmp]user@host# set large
- To protect against ping of death attacks, identify and
drop oversized and irregular ICMP packets.[edit services screen ids-option screen-name icmp]user@host# set ping-death
- To protect against bad option attacks, identify and drop
packets with incorrectly formatted IPv4 options or IPv6 extension
headers.[edit services screen ids-option screen-name ip]user@host# set bad-option
- To identify and drop fragmented IP packets, configure block-frag.[edit services screen ids-option screen-name ip]user@host# set block-frag
- To drop IPv6 packets with particular extension header
values, specify the values.[edit services screen ids-option screen-name ip]user@host# set ipv6-extension-header header
The following header values can be configured:
ah-header—Authentication Header extension headeresp-header—Encapsulating Security Payload extension headerfragment-header—Fragment Header extension headerhop-by-hop-header—Hop-by-Hop option with the specified option:CALIPSO-option—Common Architecture Label IPv6 Security Optionjumbo-payload-option—IPv6 jumbo payload optionquick-start-option—IPv6 quick start optionrouter-alert-option—IPv6 router alert optionRPL-option—Routing Protocol for Low-Power and Lossy Networks optionSFM-DPD-option—Simplified Muliticast Forwarding IPv6 Duplicate Packet Detection optionuser-defined-option-type type-low to type-high—A range of header typesRange: 1 through 255.
mobility-header—Mobility Header extension header.routing-header—Routing Header extension header. - To drop IPv4 packets with particular IPv4 option values,
specify the values.[edit services screen ids-option screen-name ip]user@host# set option
The following IPv4 option values can be configured:
loose-source-route-option— IP option of 3 (Loose Source Routing)record-route-option— IP option of 7 (Record Route)security-option— IP option of 2 (Security)source-route-option—IP option of 3 (Loose Source Routing) or the IP option of 9 (Strict Source Routing)stream-option—IP option of 8 (Stream ID)strict-source-route-option—IP option of 9 (Strict Source Routing)timestamp-option—IP option of 4 (Internet timestamp) - To protect against IP teardrop attacks, identify and drop
fragmented IP packets that overlap.[edit services screen ids-option screen-name ip]user@host# set tear-drop
- To protect against IP unknown protocol attacks, identify
and drop IP frames with protocol numbers greater than 137 for IPv4
and 139 for IPv6.[edit services screen ids-option screen-name ip]user@host# set unknown-protocol
- To protect against TCP FIN No ACK Attacks, identify and
drop any packet with the FIN flag set and without the ACK flag set.[edit services screen ids-option screen-name tcp]user@host# set fin-no-ack
- To protect against land attacks, identify and drop SYN
packets that have the same source and destination address or port.[edit services screen ids-option screen-name tcp]user@host# set land
- To protect against TCP SYN ACK ACK attacks, configure
the maximum number of connections from an IP address that can be opened
without being completed.[edit services screen ids-option screen-name tcp]user@host# set syn-ack-ack-proxy number
- To protect against TCP SYN FIN attacks, identify and drop
packets that have both the SYN and FIN flags set.[edit services screen ids-option screen-name tcp]user@host# set syn-fin
- To protect against SYN fragment attacks, identify and
drop SYN packet fragments.[edit services screen ids-option screen-name tcp]user@host# set syn-frag
- To protect against TCP no flag attacks, identify and drop
TCP packets that have no flag fields set.[edit services screen ids-option screen-name tcp]user@host# set tcp-no-flag
- To protect against TCP WinNuke attacks, identify and drop
TCP segments that are destined for port 139 and have the urgent (URG)
flag set.[edit services screen ids-option screen-name tcp]user@host# set winnuke
Configuring the Service Set for IDS
Configure a service set to apply the IDS screen.
- Assign the IDS screen to a service set.[edit services]user@host# set service-set service-set-name ids-option screen-name
If the service set is associated with an AMS interface, then the session limits you configure are applicable to each member interface.
- Limit the packets that the IDS screen processes by configuring
a stateful firewall rule . The stateful firewall rule can identify
either the traffic that should undergo IDS processing or the traffic
that should skip IDS processing:
To allow IDS processing on the traffic that matches the stateful firewall rule, include accept at the [edit services stateful-firewall rule rule-name term term-name then] hierarchy level.
To skip IDS processing on the traffic that matches the stateful firewall rule, include accept skip-ids at the [edit services stateful-firewall rule rule-name term term-name then] hierarchy level.
- Assign the stateful firewall rule to the service set.[edit services]user@host# set service-set service-set-name stateful-firewall-rules rule-name
- To protect against header anomaly attacks, configure a
header integrity check for the service set.[edit services]user@host# set service-set service-set-name service-set-options header-integrity-check enable-all