Network Attack Protection on MS-MPC and MS-MIC
Understanding IDS on an MS-MPC
Intrusion Detection Services
Intrusion detection services (IDS) rules on an MS-MPC give you a way to identify and drop traffic that is part of a network attack.
IDS rules provide a more granular level of filtering than firewall filters and policers, which can stop illegal TCP flags and other bad flag combinations, and can enforce general rate limiting (see the Routing Policies, Firewall Filters, and Traffic Policers User Guide). You can use firewall filters and policers along with IDS to reduce the traffic that needs to be processed by an IDS rule.
In an IDS rule, you can specify:
Limits on the sessions that originate from individual sources or that terminate at individual destinations. This protects against network probing and flooding attacks.
Types of suspicious packets to drop.
To protect against header anomaly attacks, a header integrity check is automatically performed if you configure an IDS rule, stateful firewall rule, or a NAT rule and apply it to the service set. You can also explicitly configure a header integrity check for the service set if you do not assign the service set an IDS rule, stateful firewall rule, or a NAT rule.
Benefits
Provides protection against several types of network attacks.
Session Limits
You can use IDS rules to set session limits for traffic from an individual source or to an individual destination. This protects against network probing and flooding attacks. Traffic that exceeds the session limits is dropped. You can specify session limits either for traffic with a particular IP protocol, such as ICMP, or for traffic in general.
You decide whether the limits apply to individual addresses or to an aggregation of traffic from individual subnets of a particular prefix length. For example, if you aggregate limits for IPv4 subnets with a prefix length of 24, traffic from 192.0.2.2 and 192.0.2.3 is counted against the limits for the 192.0.2.0/24 subnet.
Some common network probing and flooding attacks that session limits protect against include:
Session limits for traffic from a source or to a destination include:
maximum number of concurrent sessions
maximum number of packets per second
maximum number of connections per second
IDS also installs a dynamic filter on the PFEs of line cards for suspicious activity when the following conditions occur:
Either the packets per second or the number of connections per second for an individual source or destination address (not for a subnet) exceeds four times the session limit in the IDS rule. This session limit is the general source or destination limit for the IDS rule, not the limit specified for a particular protocol.
The services card CPU utilization percentage exceeds a configured value (default value is 90 percent).
The dynamic filter drops the suspicious traffic at the PFE, and the traffic is not sent to the MS-MPC to be processed by the IDS rule. When the packet or connection rate no longer exceeds four times the limit in the IDS rule, the dynamic filter is removed.
Suspicious Packet Patterns
You can use IDS rules to identify and drop traffic with a suspicious packet pattern. This protects against attackers that craft unusual packets to launch denial-of-service attacks.
Suspicious packet patterns and attacks that you can specify in an IDS rule are:
Header Anomaly Attacks
To protect against header anomaly attacks, a header integrity check is automatically performed if you configure an IDS rule, a stateful firewall rule, or a NAT rule and apply it to the service set. You can also explicitly configure a header integrity check for the service set if you do not assign the service set an IDS rule, stateful firewall rule, or a NAT rule.
The header integrity check provides protection against the following header anomaly attacks:
Configuring Protection Against Network Attacks on an MS-MPC
This topic includes the following tasks, which describe how to protect against network attacks when using an MS-MPC:
Configuring Protection Against Network Probing, Network Flooding, and Suspicious Pattern Attacks
You configure protection against network probing attacks, network flooding attacks, and suspicious pattern attacks by configuring an intrusion detection service (IDS) rule, and then applying that rule to a service set that is on an MS-MPC. Only the first term of an IDS rule is used, and only the first IDS input rule and the first IDS output rule for a service set are used.
Configuring protection against network probing, network flooding, and suspicious pattern attacks includes:
Configuring IDS Rule Name and Direction
For each IDS rule, you must configure a name and the direction of traffic to which it is applied.
To configure the IDS rule name and direction:
- Specify a name for the IDS rule.[edit services ids]user@host# set rule rule-name
- Specify whether the IDS rule is applied to input traffic,
output traffic, or both.[edit services ids rule rule-name]user@host# set match-direction (input | input-output |output)
Configuring Session Limits for Subnets
If you want to apply session limits to an aggregation of all attacks to or from individual destination or source subnets rather than for individual addresses, configure aggregation.
To configure subnet aggregation:
- If you want to apply session limits to an aggregation
of all attacks from within an individual IPv4 subnet, specify the
subnet prefix length. The range is from 1 through 32.[edit services ids rule rule-name term term-name then]user@host# set aggregation source-prefix prefix-value
For example, the following statement configures an IPv4 prefix length of 24, and attacks from 10.1.1.2 and 10.1.1.3 are counted as attacks from the 10.1.1/24 subnet.
[edit services ids rule rule1 term term1 then]user@host# set aggregation source-prefix 24However, if a single host on a subnet generates a large number of network probing or flooding attacks, the flows for the entire subnet might be stopped.
- If you want to apply session limits to an aggregation
of all attacks from within an individual IPv6 subnet, specify the
subnet prefix length. The range is from 1 through 128.[edit services ids rule rule-name term term-name then]user@host# set aggregation source-prefix-ipv6 prefix-value
For example, the following statement configures an IPv6 prefix length of 64, and attacks from 2001:db8:1234:72a2::2 and 2001:db8:1234:72a2::3 are counted as attacks from the 2001:db8:1234:72a2::/64 subnet.
[edit services ids rule rule1 term term1 then]user@host# set aggregation source-prefix-ipv6 64However, if a single host on a subnet generates a large number of network probing or flooding attacks, the flows for the entire subnet might be stopped.
- If you want to apply session limits to an aggregation
of all attacks to an individual IPv4 subnet, specify the subnet prefix
length. The range is from 1 through 32.[edit services ids rule rule-name term term-name then]user@host# set aggregation destination-prefix prefix-value
For example, the following statement configures an IPv4 prefix length of 24, and attacks to 10.1.1.2 and 10.1.1.3 are counted as attacks to the 10.1.1/24 subnet.
[edit services ids rule rule1 term term1 then]user@host# set aggregation destination-prefix 24 - If you want to apply session limits to an aggregation
of all attacks to an individual IPv6 subnet, specify the subnet prefix
length. The range is from 1 through 128.[edit services ids rule rule-name term term-name then]user@host# set aggregation destination-prefix-ipv6 prefix-value
For example, the following statement configures an IPv6 prefix length of 64, and attacks to 2001:db8:1234:72a2::2 and 2001:db8:1234:72a2::3 are counted as attacks to the 2001:db8:1234:72a2::/64 subnet.
[edit services ids rule rule1 term term1 then]user@host# set aggregation destination-prefix-ipv6 64
Configuring Session Limits Independent of the Protocol
If you want to configure session limits for traffic to an individual destination or from an individual source independent of the protocol, then perform one or more of the following tasks:
- To configure session limits for source IP addresses or
subnets independent of a protocol:
Configure the maximum number of concurrent sessions allowed from an individual source IP address or subnet.
[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source maximum numberConfigure the maximum number of packets per second allowed from an individual source IP address or subnet.
[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source packets numberConfigure the maximum number of connections per second allowed from an individual source IP address or subnet.
[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source rate number
- To configure session limits for destination IP addresses
or subnets independent of a protocol:
Configure the maximum number of concurrent sessions allowed for an individual destination IP address or subnet.
[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination maximum numberConfigure the maximum number of packets per second allowed for an individual destination IP address or subnet.
[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination packets numberConfigure the maximum number of connections per second allowed for an individual destination IP address or subnet.
[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination rate number
Configuring ICMP Address Sweep Protection
To configure protection against ICMP address sweeps, configure any combination of the maximum allowed ICMP concurrent sessions, packets per second, and connections per second for a source:
- Configure the maximum number of concurrent ICMP sessions
allowed from an individual source IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol icmp maximum number
- Configure the maximum number of ICMP packets per second
allowed from an individual source IP address or subnet. [edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol icmp packets number
- Configure the maximum number of ICMP connections per second
allowed from an individual source IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol icmp rate number
Configuring TCP Port Scanner Protection
To configure protection against TCP port scanner attacks, configure any combination of the maximum allowed TCP concurrent sessions and connections per second for a source or destination:
- Configure the maximum number of concurrent TCP sessions
allowed from an individual source IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol tcp maximum number
- Configure the maximum number of TCP connections per second
allowed for an individual source IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol tcp rate number
- Configure the maximum number of TCP sessions allowed for
an individual destination IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol tcp maximum number
- Configure the maximum number of TCP connections per second
allowed for an individual destination IP address or subnet. [edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol tcp rate number
Configuring ICMP Flooding Protection
To configure protection against ICMP flooding attacks, configure any combination of the maximum allowed ICMP concurrent sessions, packets per second, and number of connections per second for a destination:
- Configure the maximum number of concurrent ICMP sessions
allowed for an individual destination IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol icmp maximum number
- Configure the maximum number of ICMP packets per second
allowed for an individual destination IP address or subnet. [edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol icmp packets number
- Configure the maximum number of ICMP connections per second
allowed for an individual destination IP address or subnet for ICMP.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol icmp rate number
Configuring UDP Flooding Protection
To configure protection against UDP flooding attacks, configure any combination of the maximum allowed UDP concurrent sessions, packets per second, and connections per second for a destination:
- Configure the maximum number of concurrent UDP sessions
allowed for an individual destination IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol udp maximum number
- Configure the maximum number of UDP packets per second
allowed for an individual destination IPaddress or subnet. [edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol udp packets number
- Configure the maximum number of UDP connections per second
allowed for an individual destination IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol udp rate number
Configuring TCP SYN Flooding Protection
To configure protection against TCP SYN flooding attacks, configure any combination of the maximum allowed TCP concurrent sessions, packets per second, and connections per second for a source or destination. You can also configure the closing of unestablished TCP connections after a timeout:
- Configure the maximum number of concurrent TCP sessions
allowed from an individual source IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol tcp maximum number
- Configure the maximum number of TCP packets per second
allowed from an individual source IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol tcp packets number
- Configure the maximum number of TCP connections per second
allowed from an individual source IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-source by-protocol tcp rate number
- Configure the maximum number of concurrent TCP sessions
allowed for an individual destination IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol tcp maximum number
- Configure the maximum number of TCP connections per second
allowed for an individual destination IP address or subnet.[edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol tcp rate number
- Configure the maximum number of TCP packets per second
allowed for an individual destination IP address or subnet. [edit services ids rule rule-name term term-name then]user@host# set session-limit by-destination by-protocol tcp packets number
- Configure the closing of unestablished TCP connections
and the delivery of a TCP RST to the end host to clear the TCP states
on it when the open-timeout value at the [edit interfaces interface-name service-options] hierarchy level
expires.[edit services ids rule rule-name term term-name then]user@host# set tcp-syn-defense
Configuring ICMP Fragmentation Protection
To protect against ICMP fragmentation attacks:
Configure the identification and dropping of ICMP packets that are IP fragments.
[edit services ids rule rule-name term term-name then]user@host# set icmp-fragment-check
Configuring ICMP Large Packet Protection
To protect against ICMP large packet attacks:
Configure the identification and dropping of ICMP packets that are larger than 1024 bytes.
[edit services ids rule rule-name term term-name then]user@host# set icmp-large-packet-check
Configuring IP Bad Options Protection
To protect against bad IPv4 options or IPv6 extension header attacks:
- Configure the type of IPv4 options that the packet can
include. If the packet includes an option that is not configured,
then the packet is blocked. If the packet includes a configured option
whose length is an illegal value, then the packet is dropped. Specifying any allows all options.[edit services ids rule rule-name term term-name then]user@host# set allow-ip-options [ip-options]
The IPv4 options supported are any, loose-source-route, route-record, security, stream-id, strict-source-route, and timestamp.
If you do not include the allow-ip-options statement in the IDS rule, packets with any type of IPv4 option are blocked.
- Configure the type of IPv6 extension headers that the
packet can include. If the packet includes an extension header that
is not configured, then the packet is blocked. If the packet includes
configured extension headers that are incorrect, then the packet is
dropped. Specifying any allows all extension headers.[edit services ids rule rule-name term term-name then]user@host# set allow-ipv6-extension-header extension-header
The IPv6 extension headers supported are any, ah, dstopts, esp, fragment, hop-by-hop, mobility, and routing.
If you do not include the allow-ipv6-extension-header statement in the IDS rule, packets with any type of extension header are dropped.
Configuring Land Attack Protection
To protect against land attacks:
Configure the identification and dropping of SYN packets that have the same source and destination IP address or the same source and destination IP address and port.
[edit services ids rule rule-name term term-name then]user@host# set land-attack-check (ip-only | ip-port)To specify that the packets have the same source and destination IP address, use the ip-only option; to specify that the packets have the same source and destination IP address and port, use the ip-port option.
Configuring TCP SYN Fragment Protection
To protect against TCP SYN fragment attacks:
Configure the identification and dropping of TCP SYN packets that are IP fragments:
[edit services ids rule rule-name term term-name then]user@host# set tcp-syn-fragment-check
Configuring WinNuke Protection
To protect against WinNuke attacks:
Configure the identification and dropping of TCP segments that are destined for port 139 and have the urgent (URG) flag set.
[edit services ids rule rule-name term term-name then]user@host# set tcp-winnuke-check
Configuring the Service Set
To apply the IDS rule actions to a service set:
- Assign the IDS rule to a service set that is on an MS-MPC.[edit services]user@host# set service-set service-set-name ids-rules rule-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 rule processes by configuring
a stateful firewall rule (see Configuring Stateful Firewall Rules). 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
Configuring Protection Against Header Anomaly Attacks
Protect against header anomaly attacks by using either of the following methods to enable a header integrity check, which drops any packets with header anomalies:
- Configure a stateful firewall rule, a NAT rule, or an IDS rule and apply it to the service set that is on an MS-MPC. A header integrity check is automatically enabled.
- Configure a header integrity check for the service set
that is on an MS-MPC.[edit services]user@host# set service-set service-set-name service-set-options header-integrity-check enable-all
Configuring Logging of Network Attack Protection Packet Drops on an MS-MPC
To configure the logging of packet drops resulting from header integrity, suspicious packet pattern, and session limit checks performed by an MS-MPC:
- Configure the logging of packet drops resulting from header
integrity failures and suspicious packet patterns.[edit services set service-set service-set-name syslog host hostname class]user@host# set packet-logs
- Configure the logging of packet drops resulting from session
limit violations.[edit services set service-set service-set-name syslog host hostname class]user@host# set ids-log