Difference between revisions of "Intrusion Prevention"

From UntangleWiki
Jump to: navigation, search
Line 28: Line 28:
 
----
 
----
  
 +
== About Intrusion Prevention ==
 +
 +
Intrusion Prevention is an [http://en.wikipedia.org/wiki/Intrusion_detection_systems Intrusion Detection system] that detects malicious activity on your network.
 +
 +
To detect malicious activity, Intrusion Prevention uses ''signatures'', a method that draws upon a database of known attack patterns.
 +
If a network [http://en.wikipedia.org/wiki/Session_%28computer_science%29 session] matches a signature, its enabled ''action'' directs Intrusion Prevention to
 +
''Log'' (records the incident but '''does not stop''' the activity) or ''Block'' (records the incident and '''does stop''' the activity).
 +
 +
There is tremendous diversity between networks and it is possible for a signature to correctly identify malicious activity on one network and incorrectly match legitimate traffic on another.
 +
Logging all matching signatures can make it difficult to effectively monitor Intrusion Prevention and blocking can disrupt legitimate traffic causing cause your network to appear to be broken. 
 +
Therefore it is perfectly legitimate for there to be many signatures set as ''disabled'' or not active in Intrusion Prevention.
 +
In fact, it is advised that you use to the ''Recommended'' actions as specified by the signature database providers.
 +
 +
The database contains over 26,000 signatures making it difficult to manage signatures directly.
 +
''Rules'' are used to configure groups of signatures on matching various attributes.
 +
A condition can match an attribute such as classtype. For all signatures that match, they are configured in Intrusion Prevention according to the rule action.
 +
Any signature not matched by a rule is Disabled.
 +
A default set of rules based on system memory are enabled by default.
 +
 +
The signature database is automatically updated several times a week.  New and updated rules will be configured as determined by rules.
 +
 +
All detected activity for enabled signatures is recorded to the Intrusion Prevention ''All Events'' log.  You should review this log on a daily basis.
 +
 +
''Note:'' Intrusion Prevention installs but is off by default.
 +
 +
''Note:'' Intrusion Prevention can be memory intensive and requires at least 2GB of RAM.  The amount used is a combination of the number of enabled signatures and the amount of traffic that goes through your system.
 +
 +
== Settings ==
 +
 +
=== Status ===
 +
 +
The Status tab shows the following information:
 +
 +
* Memory Usage.  The amount of system memory the IPS engine is using compared to your installed system memory.
 +
 +
* Metrics.  The number of blocked, logged, and scanned sessions.
  
== About Intrusion Prevention ==
+
* Overview.  Signatures and Signature Updates.
 +
** Signatures.  Total number of signatures available and the number set for Log, Block, Disabled.
 +
** Updates.  The last time the signature database was updated and the last time a check was performed.  Database updates do not occur on each check.
  
Intrusion Prevention is an [http://en.wikipedia.org/wiki/Intrusion_detection_systems Intrusion Detection system] that detects malicious activity on your network. To detect malicious activity, Intrusion Prevention uses signature detection, a method that draws upon a database of known attack patterns. If Intrusion Prevention detects malicious activity, the [http://en.wikipedia.org/wiki/Session_%28computer_science%29 session] for that activity is terminated.
+
{{ServiceAppScreenshot|intrusion-prevention|status}}
  
''Note:'' Intrusion Prevention installs but is off by default. When you enable Intrusion Prevention for the first time, you will be presented with a setup wizard. It is highly recommended to complete the wizard and use the recommended configuration. Using a custom configuration and enabling too many signatures may negatively impact your network.
 
  
''Note:'' Intrusion Prevention requires at least 2 gigabytes of RAM.
+
=== Rules ===
  
== Setup Wizard ==
+
Rules allow you to control which signatures are enabled (and their actions) or disabled.
 +
Signatures are processed in rule order.
 +
Any signature not matched by a rule is disabled.
  
Intrusion Prevention includes a setup wizard to help optimize the The wizard is designed to help you correctly configure the appropriate amount of rules for your network by selecting rule identifiers: classtypes and categories. The more that you select, the more rules will be enabled.  
+
The [[Rules|Rules documentation]] describes how rules generally work and how they are configured. The major difference for Intrusion Prevention is the Conditions List.
  
Again, too many enabled rules may negatively impact your network, so it is highly suggested to use the recommended settings.  
+
At the bottom of the tab a stats bar indicates how many signatures are affected by the currently defined rules.
  
==== Step 1 - Classtypes ====
+
When adding or editing a rule, the bottom of the edit window will show how many signatures are affected by the conditions as you build the rule.
  
Classtypes are a generalized grouping for rules, such as attempts to gain user access or web application attacks. The recommended settings will enable all classtypes with a medium or higher threat level. It is highly suggested to use the recommended setting.
+
{{AppScreenshot|intrusion-prevention|rules}}
  
To enable low level classtypes or disable the recommended classtypes you can choose the '''Custom''' radio option. You will see a list of all classtypes and have the ability to enable or disable to meet your needs.
+
==== Rule Conditions ====
  
==== Step 2 - Categories ====
+
Conditions define which signatures will match the rule. If and only if all of the conditions match, the rule is considered a match.
  
Categories are a different rule grouping that can span multiple classtypes, such as VOIP access or operating systems. The recommended setting is to enable the preprocessor_portscan which is always included. It is highly suggested to use the recommended setting.
+
The following conditions are specific to Intrusion Prevention rules:
  
To other categories choose the '''Select by name''' radio option. You will see a list of all categories and have the ability to enable or disable additional categories.  
+
{| border="1" cellpadding="2" font="sans-serif" style="border-collapse: collapse;"
 +
|+
 +
! style="text-align: left" | Name
 +
! style="text-align: left" | Syntax
 +
! style="text-align: left" | Function
 +
|-
 +
| Signature identifier
 +
| Numeric
 +
| Matches if value matches the exact or partial signature identifier.
 +
|-
 +
| Group identifier
 +
| Numeric
 +
| Matches if value matches the exact or partial group identifier.
 +
|-
 +
| Category
 +
| Checkbox
 +
| Matches if value is in one of the checked categories.
 +
|-
 +
| Classtype
 +
| Checkbox
 +
| Matches if value is in one of the checked classtypes.
 +
|-
 +
| Message
 +
| Text
 +
| Matches if value matches the exact or partial signature subject message.
 +
|-
 +
| Protocol
 +
| Checkbox
 +
| Matches if value is in one of the checked protocols.
 +
|-
 +
| Source Address
 +
| Text
 +
| Matches if value matches the exact or partial source address.
 +
|-
 +
| Source Port
 +
| Text
 +
| Matches if value matches the exact or partial source port.
 +
|-
 +
| Destination Address
 +
| Text
 +
| Matches if value matches the exact or partial destination address.
 +
|-
 +
| Destination Port
 +
| Text
 +
| Matches if value matches the exact or partial destination port.
 +
|-
 +
| Signature
 +
| Text
 +
| Matches if value matches the exact or any part of the entire signature.
 +
|-
 +
| Custom
 +
| Boolean
 +
| Matches if value is a custom signature.
 +
|-
 +
| Recommended Action
 +
| Select
 +
| Matches if value is a signature's recommended action.
 +
|-
 +
| System Memory
 +
| Numeric
 +
| Matches if system memory matches this value.
 +
|}
  
 +
==== Rule Actions ====
  
After Step 2 the Intrusion Prevention setup wizard is complete. Based on your selections and the amount of memory in your system, the appropriate Intrusion Prevention rules will automatically be enabled.
+
When all conditions are met, signatures will be configured into Intrusion Prevention as follows:
  
Note: You can always re-run the setup wizard at any time using the '''Run Intrusion Detection/Prevention Setup Wizard''' button on the Status tab. This is useful to reset back to the recommended settings if you find problems with network performance.
+
{| border="1" cellpadding="2" font="sans-serif" style="border-collapse: collapse;"
 +
|+
 +
! style="text-align: left" | Action
 +
! style="text-align: left" | Function
 +
|-
 +
| Recommended
 +
| Each signature will use their specific Recommended Action.  If that Recommended Action is disabled, it will not be enabled at all.
 +
|-
 +
| Enable Log
 +
| Each signature will be enabled to log.
 +
|-
 +
| Enable Block if Recommended is Log
 +
| Only if the signature's Recommended Action is Log will the signature be configured for Block.  Use this for "wide" condition matches like classtype.
 +
|-
 +
| Enable Block
 +
| Each signature will be enabled to block.  Use this for "narrow" matches like sid and gid.
 +
|-
 +
| Disable
 +
| Each signature will be disabled and not used by Intrusion Prevention.
 +
|}
  
  
== Settings ==  
+
=== Signatures ===
  
=== Status ===
+
The Signature tab shows the entire database of signatures, both the defaults set provided as well as any custom signatures you may add.
  
The Status tab simply shows you information about Intrusion Prevention's definitions - there is nothing to configure.
+
{{AppScreenshot|intrusion-prevention|signatures}}
  
Click the '''Run Intrusion Detection/Prevention Setup Wizard''' to re-run the setup wizard.
+
==== Navigation ====
  
{{ServiceAppScreenshot|intrusion-prevention|status}}
+
By default, signatures are grouped by classtype and you can expand the groups to view the individual signatures. 
  
 +
To better find specific signatures, you can use the Filter to select signature fields and the match you're looking for.  The grid view will change to show those signatures matching the filter.
  
=== Rules ===
+
If your filter returned one or more matches, you can create a rule from the filter by clicking Create Rule. 
  
Intrusion Prevention provides a list of [[#Learning More About Signature ID Rules|rules (signatures)]] that you can have Untangle '''Log''' or '''Block''' when traffic matches them. The rules are grouped by classtype and can be searched using the search field at the bottom of the page.  
+
Mousing over grid cell will show appropriate information related to that cell.  For example, if you mouse over the Rule Action cell, you'll see which rule is affecting this signature.
  
In most cases, you do not need to change the default settings configured in the setup wizard. You should only need to disable a rule if that rule blocks traffic from a unique software application that you must use. Simply uncheck '''Block''' (and '''Log''' if you wish) and the the traffic will no longer be blocked.
+
==== Custom Signatures ====
  
The rules are automatically updated using the latest Snort signatures.  
+
You may create and maintain your own signatures, but most use the default database.
  
*SID: The signature ID of the rule.
+
If you wish to add custom signatures you can do so either by clicking Add.
*Classtype: Snort classtype (grouping) of the rule.
 
*Category: Snort category (grouping) for the rule.
 
*Msg: Name of the signature.
 
*Reference: Links to reference information on the attack the signature will detect (if available).
 
*Log/Block: Enable these to log or block traffic matching the signature.
 
*Edit: Edit the rule. This is not recommended and should only be attempted by advanced users with a strong understanding of Snort rules. Invalid or poorly written rules will negatively impact network performance.
 
*Delete: Delete the rule from the system.  
 
  
Using the Add button, you can also add your own signatures to the system. This should only be attempted by advanced users with a strong knowledge of Snort signature creation. Adding invalid or poorly written rules will negatively impact network performance.
+
Alternatively, if you wish to create a new custom signature on an existing signature, you can click Copy then edit that copy.
  
{{AppScreenshot|intrusion-prevention|rules}}
+
'''NOTE:''' Don't be tempted to copy a signature to change its Recommended Action.  Create a Rule instead!
  
  
 
=== Variables ===
 
=== Variables ===
  
This tab provides administrators access to Snort variables. These variables are used in rules to specify criteria for the source and destination of a packet.  
+
This tab provides administrators access to Suricata variables. These variables are used in rules to specify criteria for the source and destination of a packet.  
  
Snorts most important variable is $HOME_NET. $HOME_NET defines the network or networks you are trying to protect - it is computer automatically based on your network configuration - it includes all local networks (including aliases).
+
Suricata's most important variable is $HOME_NET. $HOME_NET defines the network or networks you are trying to protect - it is computer automatically based on your network configuration - it includes all local networks (including aliases).  Under nearly every circumstance you will want to leave these values as-is.
  
Using the Add button, custom variables can be added. Adding variables may be used by users adding their own rules.This should only be attempted by advanced users with a strong knowledge of Snort signature creation.
+
Using the Add button, custom variables can be added. Adding variables may be used by users adding their own rules.This should only be attempted by advanced users with a strong knowledge of Suricata signature creation.
  
 
{{AppScreenshot|intrusion-prevention|variables}}
 
{{AppScreenshot|intrusion-prevention|variables}}
Line 107: Line 221:
 
== Updates ==
 
== Updates ==
  
Rules are automatically updated every night.  Any rule modifications the administrator has made will remain even if the rule's behavior is updated. New rules are added with the recommended Log action. Deleted rules are not removed unless they are not enabled (neither Log or Block). 
+
The signature database is checked automatically every night.  Updates are typically released 2-3 times week.
 +
 
 +
The signature database does not affect custom signatures.
 +
 
 +
New signatures will be integrated into Intrusion Prevention according to defined rules.
  
 
== Reports ==  
 
== Reports ==  
  
 
{{:Intrusion Prevention Reports}}
 
{{:Intrusion Prevention Reports}}
 +
== All Events ==
  
 +
The All Events report shows all enabled signature matches found by Intrusion Prevention.
 +
 +
If there are signatures that are currently set to an action of Log and you determine the signature should in fact be Block, you can click the Block button on the far right.
 +
The Block button is disabled for any signature that is already blocked. 
 +
 +
{{Screenshot|reports_cat_intrusion-prevention_rep_all-events}}
  
 
== Related Topics ==
 
== Related Topics ==
Line 118: Line 243:
 
[http://en.wikipedia.org/wiki/Intrusion_prevention_system Intrusion Prevention Systems]
 
[http://en.wikipedia.org/wiki/Intrusion_prevention_system Intrusion Prevention Systems]
  
[http://manual.snort.org/node36.html Snort - Writing Good Snort Rules]
+
[https://suricata.readthedocs.io/en/suricata-3.2.1/rules/index.html Suricata - Writing Suricata Signatures]
 
 
[http://manual.snort.org/node27.html Snort - Writing Snort Rules]
 
  
 
== Intrusion Prevention FAQs ==
 
== Intrusion Prevention FAQs ==
  
 
{{:Intrusion Prevention FAQs}}
 
{{:Intrusion Prevention FAQs}}

Revision as of 20:56, 13 November 2018

IntrusionPrevention.png     Intrusion Prevention
Other Links:
Intrusion Prevention Description Page
Intrusion Prevention Demo
Intrusion Prevention Forums
Intrusion Prevention Reports
Intrusion Prevention FAQs



About Intrusion Prevention

Intrusion Prevention is an Intrusion Detection system that detects malicious activity on your network.

To detect malicious activity, Intrusion Prevention uses signatures, a method that draws upon a database of known attack patterns. If a network session matches a signature, its enabled action directs Intrusion Prevention to Log (records the incident but does not stop the activity) or Block (records the incident and does stop the activity).

There is tremendous diversity between networks and it is possible for a signature to correctly identify malicious activity on one network and incorrectly match legitimate traffic on another. Logging all matching signatures can make it difficult to effectively monitor Intrusion Prevention and blocking can disrupt legitimate traffic causing cause your network to appear to be broken. Therefore it is perfectly legitimate for there to be many signatures set as disabled or not active in Intrusion Prevention. In fact, it is advised that you use to the Recommended actions as specified by the signature database providers.

The database contains over 26,000 signatures making it difficult to manage signatures directly. Rules are used to configure groups of signatures on matching various attributes. A condition can match an attribute such as classtype. For all signatures that match, they are configured in Intrusion Prevention according to the rule action. Any signature not matched by a rule is Disabled. A default set of rules based on system memory are enabled by default.

The signature database is automatically updated several times a week. New and updated rules will be configured as determined by rules.

All detected activity for enabled signatures is recorded to the Intrusion Prevention All Events log. You should review this log on a daily basis.

Note: Intrusion Prevention installs but is off by default.

Note: Intrusion Prevention can be memory intensive and requires at least 2GB of RAM. The amount used is a combination of the number of enabled signatures and the amount of traffic that goes through your system.

Settings

Status

The Status tab shows the following information:

  • Memory Usage. The amount of system memory the IPS engine is using compared to your installed system memory.
  • Metrics. The number of blocked, logged, and scanned sessions.
  • Overview. Signatures and Signature Updates.
    • Signatures. Total number of signatures available and the number set for Log, Block, Disabled.
    • Updates. The last time the signature database was updated and the last time a check was performed. Database updates do not occur on each check.


Rules

Rules allow you to control which signatures are enabled (and their actions) or disabled. Signatures are processed in rule order. Any signature not matched by a rule is disabled.

The Rules documentation describes how rules generally work and how they are configured. The major difference for Intrusion Prevention is the Conditions List.

At the bottom of the tab a stats bar indicates how many signatures are affected by the currently defined rules.

When adding or editing a rule, the bottom of the edit window will show how many signatures are affected by the conditions as you build the rule.

Rule Conditions

Conditions define which signatures will match the rule. If and only if all of the conditions match, the rule is considered a match.

The following conditions are specific to Intrusion Prevention rules:

Name Syntax Function
Signature identifier Numeric Matches if value matches the exact or partial signature identifier.
Group identifier Numeric Matches if value matches the exact or partial group identifier.
Category Checkbox Matches if value is in one of the checked categories.
Classtype Checkbox Matches if value is in one of the checked classtypes.
Message Text Matches if value matches the exact or partial signature subject message.
Protocol Checkbox Matches if value is in one of the checked protocols.
Source Address Text Matches if value matches the exact or partial source address.
Source Port Text Matches if value matches the exact or partial source port.
Destination Address Text Matches if value matches the exact or partial destination address.
Destination Port Text Matches if value matches the exact or partial destination port.
Signature Text Matches if value matches the exact or any part of the entire signature.
Custom Boolean Matches if value is a custom signature.
Recommended Action Select Matches if value is a signature's recommended action.
System Memory Numeric Matches if system memory matches this value.

Rule Actions

When all conditions are met, signatures will be configured into Intrusion Prevention as follows:

Action Function
Recommended Each signature will use their specific Recommended Action. If that Recommended Action is disabled, it will not be enabled at all.
Enable Log Each signature will be enabled to log.
Enable Block if Recommended is Log Only if the signature's Recommended Action is Log will the signature be configured for Block. Use this for "wide" condition matches like classtype.
Enable Block Each signature will be enabled to block. Use this for "narrow" matches like sid and gid.
Disable Each signature will be disabled and not used by Intrusion Prevention.


Signatures

The Signature tab shows the entire database of signatures, both the defaults set provided as well as any custom signatures you may add.

Navigation

By default, signatures are grouped by classtype and you can expand the groups to view the individual signatures.

To better find specific signatures, you can use the Filter to select signature fields and the match you're looking for. The grid view will change to show those signatures matching the filter.

If your filter returned one or more matches, you can create a rule from the filter by clicking Create Rule.

Mousing over grid cell will show appropriate information related to that cell. For example, if you mouse over the Rule Action cell, you'll see which rule is affecting this signature.

Custom Signatures

You may create and maintain your own signatures, but most use the default database.

If you wish to add custom signatures you can do so either by clicking Add.

Alternatively, if you wish to create a new custom signature on an existing signature, you can click Copy then edit that copy.

NOTE: Don't be tempted to copy a signature to change its Recommended Action. Create a Rule instead!


Variables

This tab provides administrators access to Suricata variables. These variables are used in rules to specify criteria for the source and destination of a packet.

Suricata's most important variable is $HOME_NET. $HOME_NET defines the network or networks you are trying to protect - it is computer automatically based on your network configuration - it includes all local networks (including aliases). Under nearly every circumstance you will want to leave these values as-is.

Using the Add button, custom variables can be added. Adding variables may be used by users adding their own rules.This should only be attempted by advanced users with a strong knowledge of Suricata signature creation.


Updates

The signature database is checked automatically every night. Updates are typically released 2-3 times week.

The signature database does not affect custom signatures.

New signatures will be integrated into Intrusion Prevention according to defined rules.

Reports

The Reports tab provides a view of all reports and events for all traffic handled by Intrusion Prevention.

Reports

This applications reports can be accessed via the Reports tab at the top or the Reports tab within the settings. All pre-defined reports will be listed along with any custom reports that have been created.

Reports can be searched and further defined using the time selectors and the Conditions window at the bottom of the page. The data used in the report can be obtained on the Current Data window on the right.

Pre-defined report queries:

Report Entry Description
Intrusion Prevention Summary A summary of intrusion detection and prevention actions.
Intrusion Detection (all) The amount of detected and blocked intrusions over time.
Intrusion Detection (logged) The amount of detected intrusions over time.
Intrusion Detection (blocked) The amount of blocked intrusions over time.
Top Rules (all) The number of intrusions detevted by rule.
Top Rules (logged) The number of intrusions logged by rule.
Top Rules (blocked) The number of intrusions blocked by rule.
Top Signatures (all) The number of intrusions detected by signature.
Top Signatures (logged) The number of intrusions logged by signature.
Top Signatures (blocked) The number of intrusions blocked by signature.
Top Classtypes (all) The number of intrusions detected by classtype.
Top Classtypes (logged) The number of intrusions logged by classtype.
Top Classtypes (blocked) The number of intrusions blocked by classtype.
Top Categories (all) The number of intrusions detected by category.
Top Categories (logged) The number of intrusions logged by category.
Top Categories (blocked) The number of intrusions blocked by category.
Top Source IP Addresses (all) The number of intrusions detected by source IP address.
Top Source IP Addresses (logged) The number of intrusions logged by source IP address.
Top Source IP Addresses (blocked) The number of intrusions blocked by source IP address.
Top Source Ports (all) The number of intrusions detected by source port.
Top Source Ports (logged) The number of intrusions logged by source port.
Top Source Ports (blocked) The number of intrusions blocked by source port.
Top Destination IP Addresses (all) The number of intrusions detected by destination IP address.
Top Destination IP Addresses (logged) The number of intrusions logged by destination IP address.
Top Destination IP Addresses (blocked) The number of intrusions blocked by destination IP address.
Top Destination Ports (all) The number of intrusions detected by destination port.
Top Destination Ports (logged) The number of intrusions logged by destination port.
Top Destination Ports (blocked) The number of intrusions blocked by destination port.
Top Protocols (all) The number of intrusions detected by protocol.
Top Protocols (logged) The number of intrusions logged by protocol.
Top Protocols (blocked) The number of intrusions blocked by protocol.
All Events All sessions scanned by Intrusion Prevention.
Logged Events All sessions matching Intrusion Prevention signatures and logged.
Blocked Events All sessions matching Intrusion Prevention signatures and blocked.


The tables queried to render these reports:


All Events

The All Events report shows all enabled signature matches found by Intrusion Prevention.

If there are signatures that are currently set to an action of Log and you determine the signature should in fact be Block, you can click the Block button on the far right. The Block button is disabled for any signature that is already blocked.

Related Topics

Intrusion Prevention Systems

Suricata - Writing Suricata Signatures

Intrusion Prevention FAQs

Is Intrusion Prevention based on an open source project?

Yes, Intrusion Prevention is based on Suricata.

Why is there no reference information for a specific signature?

If there is no information link available for a specific signautre, you can try searching the signature ID at Suricata Rules for more info.

Why aren't most of Intrusion Prevention's signatures blocked by default?

Because many signatures can block legitimate traffic in addition to malicious exploits we don't enable blocking by default.

You're free to change the action of any rule to block signatures as you see fit for your network.

Can Intrusion Prevention rules be configured differently within different policies?

No. Intrusion Prevention applies to all traffic flowing through Untangle so different configurations are not possible.

What is the difference between rule block actions?

Enable Block if Recommended is Log will only enable a signature to Block if its Recommended Action is Log.

Enable Block will unconditionally set all matching signatures to Block.

The difference is that a signature's Recommended Action (almost always either Log or Disabled) is carefully considered by the signature provider. A rule set to Enable Block if Recommended is Log will likely set that smaller and "safer" set of signatures to Block whereas Enable Block will likely set a larger set of signatures with more potential to disrupt legitimate traffic on your network.

How can I exclude network processing for signatures?

Create a variable with the network you wish to exclude in standard CIDR format such as 192.168.1.0/24. If you have multiple networks to exclude, create a comma-separated list surrounded by square brackets such as [192.168.25.1.0/24,10.10.0.0/24].

Next, create a rule to match the signatures you wish to exclude. For Action select Whitelist and then specify the variable you created to either Source or Destination networks.

NOTE: Unlike other Rule actions, the Whitelist action doesn't enable logging/blocking for rules. Signatures affected by Whitelist rules will still be processed by the first matching non-Whitelist Rule.

How do I extend the HOME_NET variable?

IPS attempts to determine the appropriate HOME_NET based on your network configuration but if a network doesn't appear to be in the list (mouse over the variable), you can either replace the HOME_NET variable value entirely or append to the existing using by leaving the default value and adding a comma separated list of additional CIDR formatted networks such as default,10.10.10.10/32,192.168.2.0/24.