Rules
Managing rules
ThreatX rules can specify firewall behavior required for your business’s individual needs, such as restricting certain resources to company IP addresses or limiting the number of failed login attempts to an application developed in-house.
A ThreatX rule is a set of Boolean conditions that, when true, implement the rule’s defined action and risk level. ThreatX rules can watch, temporarily block, permanently block, interrogate, or tarpit suspicious traffic. The action is implemented by the sensor.
You can add, modify, and delete rules, and view’s rule’s activity to determine its effectiveness.
To access rules in the ThreatX user interface, navigate to menu:Settings[Rules*. You can also manage custom rules using the ThreatX API api.threatx.com/tx_api/v2/rules endpoint.
Rules can be complex. Creating or modifying a rule could have unintended consequences. You can request the ThreatX SOC group to create rules or modify any rule in the ThreatX platform to meet the specific needs and behavior of your environment. |
Rule Activity
The Rule Activity page, shown as Rule Details, provides data about the threats that matched the rule. This page is accessible from other pages by clicking a rule name in the Rules column.
You can use the data to determine the effectiveness of the rule and if a change is needed. For example:
-
Does a threat match too many rules?
-
Does the rule catch the expected threats?
Metrics
The Rule ID tile provides the ID of the rule, description and the following data:
Rule details
To view a rule’s details, navigate to
then click Edit Rule Details for a specific rule.- Description
-
Text that describes the intended behavior or logic a rule match is intended to indicate. This information is displayed in the ThreatX user interface when your custom rule is matched.
- Tag Name
-
Text that identifies a rule when a description is long
- Classification
-
Describes the kind of attack or behavior it is meant to detect. See Rule Classifications table.
- State
-
Assumed objective. Maps the intent to a stage on ThreatX Web Application Kill Chain. Rule States table.
- Risk
-
Assigned risk level (0 to 100) at which the entity triggers a rule. The higher the rule’s risk, the fewer hits it takes to block a given entity. The biggest factor in determining entity risk is the total risk assigned by rules they trigger, which you can see in Risk Assignment table.
- Action
-
Action for the sensor to perform. See the Rule Actions table.
- Visual
-
Tab that displays the rule in a graphical format.
- JSON tab
-
Tab that displays the rule in a JSON format.
- Beta
-
If selected, the platform does not process matches to rhe rule.
Classification | Description |
---|---|
|
Unknown attack type. |
|
SQL injection attack. Attempt to exploit input form or un-sanitized input vector to the SQL backend. |
|
Cross Site Scripting. Attempt to execute unauthorized code in the user’s context. |
|
Remote File Inclusion. Attempt to have the application server evaluate or include unauthorized 3rd party content or code. |
|
Attempted unauthorized takeover or co-opting an existing authenticated session. |
|
Directory traversal. Attempt to have the application server evaluate or include unexpected and potentially sensitive content |
|
Attempt to evade detection of malicious commands or code with various encoding tricks. |
|
Indications of known malicious software. |
|
Information disclosure. Attempt to inappropriately disclose sensitive information about a server, application, or other. |
|
Indications of an attempt to upload or execute executable code in a malicious context. |
|
Attempted word list or online brute-force to gain access to known application accounts. |
|
Attempted use of known default, weak, or compromised passwords to gain unauthorized access. |
|
Attempted discovery or unauthorized use of compromised user credentials username and password. |
|
Abuse user-generated content such as response forms, comments, and reviews for unauthorized promotional purposes. |
|
Operating System detection. Attempt to fingerprint server operating system for use in targeting future attacks. |
|
Enumerate site pages or content for abusive or malicious purposes. |
|
Enumerate content-management-system plugins, software components, and more for use in targeting future attacks. |
|
Attempt to collect authorized users for future malicious purposes. |
|
Attempt to exhaust server CPU and memory resources to negatively impact legitimate services. |
|
Attempt to exhaust server bandwidth resources to negatively impact legitimate services. |
|
High request volume. Suspicious or maliciously high volume of requests, bandwidth used, or other volume with the intent to negatively impact legitimate service. |
|
Elevated error rate. Indication that an offending entity might be performing malicious actions as evidenced by an increase in HTTP errors returned by the server. |
|
Attempt to exploit a known vulnerability in the application. |
|
Cross Site Request Forgery. Attempt to abuse a user or user-agent context to perform unauthorized actions on behalf of logged-in user. |
|
Attempt to gain unauthorized access or gain permissions otherwise not expected or permitted for a given user. |
|
Indicators of malicious code intended to aid in unauthorized access to a web application or server. |
|
Known malicious or undesirable web bots, spiders, scrapers, or other entities. |
|
Attempt to trigger server-side execution of unauthorized commands through a web form or application. |
|
Cryptocurrency mining. Attempt to use server resources for unauthorized cryptocurrency related activities. |
|
Hacker toolkit. Indicators of known security or hacker toolkit attempting access to the web application. |
|
Indicators of known botnet or infected hosts attempting access to the web application. |
|
Abuse of custom business logic or application workflow to commit various fraudulent or unauthorized activity. |
|
Local File Inclusion. Attempt to have the application server evaluate or include local, potentially sensitive, content. |
|
Attempt to introduce known malicious code for execution in user or user-agent context. |
|
Attempt to fingerprint application technology and frameworks for future malicious use. |
|
Indicators of programmatic or automated access attempts for the web application. |
|
Custom rules to enforce business logic which might not fit in another rule category. |
State | Description |
---|---|
|
Basic data collection |
|
Scanning for content and known vulnerabilities |
|
Find possible weak points |
|
Gain unauthorized access |
|
Disrupt application availability |
|
Exploit application weaknesses |
|
Consolidate position on a compromised server |
Range | Description |
---|---|
|
Best used to track interesting, but not notably suspicious requests. Rules with this risk level never result in a block unless combined with a higher risk rule. |
|
Should be used for most rules. Multiple matches are required before blocking an entity. This reduces the likelihood of blocking a benign entity (which sent a few odd-looking requests). |
|
Indicates a known vulnerability or probable malicious threat. A request triggering a risk 91+ rule quickly increases the entity’s risk score and results in a block. |
Action | Description |
---|---|
|
Begin or continue tracking a risk score for the offending entity, based on the risk assigned to this rule and other factors. This is the default and recommended action for most custom rules. |
|
Immediately block the request and track a risk score for the offending entity. Blocking rules are best used to stop known malicious behavior, “virtually patch” known vulnerabilities, etc. |
|
Limit the speed at which the offending entity receives responses and tracks a risk score for the entity. Tarpit actions are best used to discourage scanning or scraping behavior without immediately blocking the traffic. |
|
Challenge an offending entity with a cookie and attempt to fingerprint the user-agent. Interrogation allows a custom rule to explicitly invoke anti-bot mitigations for an entity. |
Rule format
A rule must define at least one criteria: a boolean expressions that consist of an attribute and a supplied value.
Some criteria have an operator to determine how the value is compared. However, if there is no operator available, the criteria can still be met if that attribute value is equal to the checked value.
Criteria are contained within a group: a boolean expression derived from comparing the results of all those criteria. The group can have multiple nested levels to support complex conditions.
Rule Evaluation Operators
or |
Rule is matched if any of the criteria are true. |
and |
Rule is matched if all the criteria are true. |
not |
Rule is matched if none of the criteria are true. |
A true state is also known as a match.
|
When a rule is matched, a classification
, state
, and risk level
is assigned to the threat.
The sensor also then performs the configured action
.
The following figure shows the Visual tab with the Group Type operator set to and, and one criteria entry with Header as the attribute.
The Header
attribute has two required variables: direction
and field
The direction determines that headers in requests only are checked, and that the header name is User-Agent
.
For this entry to be true, the header name must contain Bad-Guy
.
Additional Operators
Some criteria attributes have additional operators available:
contain(s) |
Expression is true if the value includes the provided value. |
equal(s) |
Expression is true if the value is equal to the provided value. |
Starts with |
Expression is true if the value begins with the provided value. |
Regex |
Expression is true if the value equals the provided regular expression. |
Group |
Allows you to add a group within the criteria. |
Types of Criteria
Attributes | Description | Example |
---|---|---|
|
Checks if the entity’s IP address matches at least one of the provided list of IPv4 addresses or CIDR networks. |
127.0.0.1/24, 127.0.1.1, 127.54.3.64/26 |
|
Uses Internet geolocation to check if the entity’s IP address resolves to at least one of the provided countries. The criteria take a comma-separated list of two-letter country codes (ISO alpha2). |
PR,RU,UA |
Attributes | Description | Example |
---|---|---|
|
Checks if the Host header sent in a HTTP request matches the provided name. |
|
|
Checks if the “path” portion of URI sent in HTTP request matches the provided path. |
|
|
Checks if the “URL query” or form-encoded POST data sent in HTTP request matches the provided argument. |
|
|
Checks if a specific “URL query” or form-encoded POST data key + value pair sent in HTTP request matches the provided argument. Requires an argument name. |
|
|
Checks if the HTTP method used in the request matches the selected method. |
|
|
Checks if a specific HTTP header value matches the provided header. The direction must be Request and the field must contain the header name. |
|
Attributes | Description | Example |
---|---|---|
|
Check the HTTP response code/status code returned by the application. |
|
|
Check if a specific HTTP header value matches. The direction must be Response and the field must contain the header name. |
|
Rule matching
For a rule to be matched, the condition set by the operator of the group must be true. For example, some of the criteria are matched while others are not. If the group operator is set to or, the rule is matched since at least one criterion is matched. If the operator is and, the rule would not be matched.