Bot Detection 编辑
The Citrix ADC bot management system uses six different techniques to detect the incoming bot traffic. The techniques are used as detection rules to detect the bot type. The techniques are bot allow list, bot block list, IP reputation, device fingerprinting, rate limiting, bot trap, TPS, and CAPTCHA.
Note:
Bot management supports a maximum of 32 configuration entities for block list, allow list, and rate limiting techniques.
Bot white list. A customized list of IP addresses (IPv4 and IPv6), subnets (IPv4 and IPv6), and policy expressions that can be bypassed as an allowed list.
Bot black list. A customized list of IP addresses (IPv4 and IPv6), subnets (IPv4 and IPv6), and policy expressions that have to be blocked from accessing your web applications.
IP reputation. This rule detects if the incoming bot traffic is from a malicious IP address.
Device fingerprint. This rule detects if the incoming bot traffic has the device fingerprint ID in the incoming request header and browser attributes of an incoming client bot traffic.
Limitation:
- Java Script must be enabled in the client browser.
- Does not work for XML responses.
Bot log expression. The detection technique enables you to capture additional information as log messages. The data can be the name of the user who requested the URL, the source IP address, and the source port from which the user sent the request or data generated from an expression.
Rate limit. This rule rate limits multiple requests coming from the same client.
Bot trap. Detects and blocks automated bots by advertising a trap URL in the client response. The URL appears invisible and not accessible if the client is a human user. The detection technique is effective in blocking attacks from automated bots.
TPS. Detects incoming traffic as bots if the maximum number of requests and percentage increase in requests exceeds the configured time interval.
CAPTCHA. This rule uses a CAPTCHA for mitigating bot attacks. A CAPTCHA is a challenge-response validation to determine if the incoming traffic is from a human user or an automated bot. The validation helps block automated bots that cause security violations to web applications. You can configure CAPTCHA as a bot action in IP reputation and device fingerprint detection techniques.
Now, let us see how you can configure each technique to detect and manage your bot traffic.
How to upgrade your appliance to Citrix ADC CLI-based bot management configuration
If you are upgrading your appliance from an older version (Citrix ADC release 13.0 build 58.32 or earlier), you must first manually convert the existing bot management configuration to the Citrix ADC CLI based bot management configuration only once. Complete the following steps to manually convert your bot management configuration.
After upgrading to the latest version connect to the upgrade tool “upgrade_bot_config.py” by using the following command
At the command prompt, type:
shell "/var/python/bin/python /netscaler/upgrade_bot_config.py > /var/bot_upgrade_commands.txt"
Run the configuration using the following command.
At the command prompt, type:
batch -f /var/bot_upgrade_commands.txt
Save the upgraded configuration.
save ns config
Configure Citrix ADC CLI-based bot management
The bot management configuration enables you to bind one or more bot detection techniques to a specific bot profile. You begin the process by enabling the bot management feature on your appliance. Once you enable, you import the bot signature file into the appliance. After import, you must create a bot profile. You then create a bot policy with the bot profile bound to it for evaluating the incoming traffic as bot and bind the policy globally or to a virtual server.
Note:
If you are upgrading your appliance from an older version, you must first manually convert the existing bot management configuration. For more information, see How to upgrade to Citrix ADC CLI-based bot management configuration section.
You must complete the following steps to configure Citrix ADC-based bot management:
- Enable bot management
- Import bot signature
- Add bot profile
- Bind bot profile
- Add bot policy
- Bind bot policy
- Configure bot settings
Enable bot management
Before you can begin, ensure that the Bot Management feature is enabled on the appliance. If you have a new Citrix ADC or VPX, you must enable the feature before you configure it. If you are upgrading a Citrix ADC appliance from an earlier version to the current version, you must need to enable the feature before you configure it. At the command prompt, type:
enable ns feature Bot
Import bot signature
You can import the default signature bot file and bind it to the bot profile. At the command prompt, type:
import bot signature [<src>] <name> [-comment <string>] [-overwrite]
Where, src. Local path to and name of, or URL (protocol, host, path, and file name) for, the file in which to store the imported signature file. Note: The import fails if the object to be imported is on an HTTPS server that requires client certificate authentication for access. Maximum Length: 2047 name. Name to assign to the bot signature file object on the Citrix ADC. This is a mandatory argument. Maximum Length: 31 comment. Any comments to preserve information about the signature file object. Maximum Length: 255. Overwrite. Overwrites the existing file. Note: Use the overwrite
option to update the content in the signature file. Alternately, use the update bot signature <name>
command to update the signature file on the Citrix ADC appliance
Example
import bot signature http://www.example.com/signature.json signaturefile -comment commentsforbot –overwrite
Note:
You can use the overwrite option to update the content in the signature file. Also, you can use the
update bot signature <name>
command to update the signature file in the Citrix ADC appliance.
Add bot profile
A bot profile is a collection of profile settings to configure bot management on the appliance. You can configure the settings to perform bot detection.
At the command prompt, type:
add bot profile <name> [-signature <string>] [-errorURL <string>] [-trapURL <string>] [-comment <string>] [-whiteList ( ON | OFF )] [-blackList ( ON | OFF )] [-rateLimit ( ON | OFF )] [-deviceFingerprint ( ON | OFF )] [-deviceFingerprintAction ( none | log | drop | redirect | reset | mitigation )] [-ipReputation ( ON | OFF )] [-trap ( ON | OFF )] [-trapAction ( none | log | drop | redirect | reset )] [-tps ( ON | OFF )]
Example:
add bot profile profile1 -signature signature -errorURL http://www.example.com/error.html -trapURL /trap.html -whitelist ON -blacklist ON -ratelimit ON -deviceFingerprint ON -deviceFingerprintAction drop -ipReputation ON -trap ON
Bind bot profile
After you create a bot profile, you must bind the bot detection mechanism to the profile.
At the command prompt, type:
bind bot profile <name> ((-blackList [-type ( IPv4 | SUBNET | IPv6 | IPv6_SUBNET | Expression )] [-enabled ( ON | OFF )] [-value <string>] [-action ( log | drop | reset )] [-logMessage <string>] [-comment <string>]) | (-whiteList ( IPv4 | SUBNET | IPv6 | IPv6_SUBNET | Expression )] [-enabled ( ON | OFF )] [-value <string>] [-log ( ON | OFF )] [-logMessage <string>] [-comment <string>])) | (-rateLimit [-type ( session |SOURCE_IP | url )] [-enabled ( ON | OFF )] [-url <string>] [-cookieName <string>] [-rate <positive_integer>] [-timeslice <positive_integer>] [-action ( none | log | drop | redirect | reset )] [-logMessage <string>] [-comment <string>]) | (-ipReputation [-category <ipReputationCategory>] [-enabled ( ON | OFF )] [-action ( none | log | drop | redirect | reset | mitigation )] [-logMessage <string>] [-comment <string>]) | (-captchaResource [-url <string>] [-enabled ( ON | OFF )] [-waitTime <positive_integer>] [-gracePeriod <positive_integer>] [-mutePeriod <positive_integer>] [-requestLengthLimit <positive_integer>] [-retryAttempts <positive_integer>] [-action ( none | log | drop | redirect | reset )] [-logMessage <string>] [-comment <string>]) | (-tps [-type ( SOURCE_IP | GeoLocation | REQUEST_URL | Host )] [-threshold <positive_integer>] [-percentage <positive_integer>] [-action ( none | log | drop | redirect | reset | mitigation )] [-logMessage <string>] [-comment <string>])
Example:
The following example is for binding the IP reputation detection technique to a specific bot profile.
bind bot profile profile5 -ipReputation -category BOTNET -enabled ON -action drop -logMessage message
Add bot policy
You must add the bot policy for evaluating bot traffic.
At the command prompt, type:
add bot policy <name> -rule <expression> -profileName <string> [-undefAction <string>] [-comment <string>] [-logAction <string>]
Where,
Name. Name for the bot policy. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the bot policy is added.
Rule. Expression that the policy uses to determine whether to apply the bot profile on the specified request. This is a mandatory argument. Maximum Length: 1499
profileName. Name of the bot profile to apply if the request matches this bot policy. This is a mandatory argument. Maximum Length: 127
undefAction. Action to perform if the result of policy evaluation is undefined (UNDEF). An UNDEF event indicates an internal error condition. Maximum Length: 127
Comment. Any type of information about this bot policy. Maximum Length: 255
logAction. Name of the log action to use for requests that match this policy. Maximum Length: 127
Example:
add bot policy pol1 –rule "HTTP.REQ.HEADER(\"header\").CONTAINS(\"custom\")" - profileName profile1 -undefAction drop –comment commentforbotpolicy –logAction log1
Bind bot policy global
At the command prompt, type:
bind bot global -policyName <string> -priority <positive_integer> [-gotoPriorityExpression <expression>][-type ( REQ_OVERRIDE | REQ_DEFAULT )] [-invoke (-labelType ( vserver | policylabel ) -labelName <string>) ]
Example:
bind bot global –policyName pol1 –priority 100 –gotoPriorityExpression NEXT -type REQ_OVERRIDE
Bind bot policy to a virtual server
At the command prompt, type:
bind lb vserver <name>@ ((<serviceName>@ [-weight <positive_integer>] ) | <serviceGroupName>@ | (-policyName <string>@ [-priority <positive_integer>] [-gotoPriorityExpression <expression>] [-type ( REQUEST | RESPONSE )] [-invoke (<labelType> <labelName>) ] ) | -analyticsProfile <string>@)
Example:
bind lb vserver lb-server1 –policyName pol1 –priority 100 –gotoPriorityExpression NEXT -type REQ_OVERRIDE
Configure bot settings
You can customize the default settings if necessary. At the command prompt, type:
set bot settings [-defaultProfile <string>] [-javaScriptName <string>] [-sessionTimeout <positive_integer>] [-sessionCookieName <string>] [-dfpRequestLimit <positive_integer>] [-signatureAutoUpdate ( ON | OFF )] [-signatureUrl <URL>] [-proxyServer <ip_addr|ipv6_addr|*>] [-proxyPort <port|*>]
<!--NeedCopy-->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论