ADC

Dynamic profiling

The learning feature is a pattern filter that observes and learns activities on the back-end server. Based on the observation, the learning engine generates up to 2000 rules or exceptions (relaxations) for each security check. To automate the process and auto deploy the relaxation rules, Citrix ADC appliance uses dynamic profiling.

With dynamic profiling, the appliance records the learnt data for a pre-defined threshold and sends an SNMP alert to the user. If the user does not skip the data within a grace period, the appliance auto deploys it as a relaxation rule. Earlier, the user had to manually deploy the relaxation rules. Currently, dynamic profiling is available only for the follow security checks:

  1. HTML SQL injection
  2. HTML Cross Site scripting
  3. 字段格式
  4. Start URL
  5. Content-type
  6. 字段格式s
  7. CSRF form tagging
  8. Cookie consistency
  9. Deny URL
  10. Buffer Overflow
  11. Credit Card

For example, consider the HTML SQL Injection security check enabled with dynamic profiling. You can use learning for a list of IPs (called the Trusted Learning Clients list) from which the learning feature must generate recommendations. To configure a list of trusted clients, see Learning Trusted Clients topic. If the incoming traffic has violations, it is recorded as a learnt data. If the learned data is recorded in the learning engine, the appliance sends an SNMP alert to the user. If the user does not recognize a false positive and does not skip the learnt data within a grace period, the appliance auto deploys it as a relaxation rule.

Note:After you configure the dynamic profile, you must periodically review the appliance configuration for the auto-deployment of the relaxation rules and save it on the appliance.

Configure dynamic profiling by using the Citrix ADC command interface

Dynamic profiling is available for Start URL, HTML Cross-Site Scripting, Field Format, or HTML SQL Injection security checks. To configure dynamic profiling, you must complete the following steps.

  1. Configure dynamic learning
  2. Configure auto deployment grace period

Configure dynamic learning

As a first step, you must configure dynamic learning on your appliance. At the command prompt, type:

set appfw profile dynamicLearning

Example

set appfw profile test1 dynamicLearning SQLInjection CrossSiteScripting fieldFormat startURL

Configure auto deployment grace period

Once you enable the feature on specific security checks, you must configure the grace period for the auto deployment.

set appfw learningsettings -crossSiteScriptingAutoDeployGracePeriod

set appfw learningsettings fieldFormatAutoDeploymentGracePeriod

set appfw learningsettings SQLInjectionAutoDeploymentGracePeriod

set appfw learningsettings –startURLAutoDeployGracePeriod

Example

set appfw learningsettings test1 –crossSiteScriptingAutoDeployGracePeriod 30

set appfw learningsettings test1 –startURLAutoDeployGracePeriod 7

set appfw learningsettings test1 –fieldFormatAutoDeploymentGracePeriod 10

set appfw learning settings test1 –SQLInjectionAutoDeploymentGracePeriod 12

Note:

Here, the auto deployment grace period is in minutes.

Configuring dynamic profiling by using the Citrix ADC GUI

  1. Navigate toFi安全> Citrix Web应用rewall > Profile.
  2. In the details pane, select a profile and clickEdit.
  3. In theCitrix Web App Profilepage, clickDynamic ProfilingunderAdvanced Settings.

    Dynamic profile setting

  4. In theDynamic Profilingsection, select a security check and clickEdit.

    Dynamic profiling section

  5. In theDynamic Profiling and Learning Settingspage, set the grace period the security check.

    Dynamic profiling section

  6. ClickOKandDone.

Export and import of relaxation rules

When you enable dynamic profiling, the learnt data is auto deployed as relaxation rules. Along with this, the appliance also enables you to export the dynamic profiling based relaxation rules and regular relaxation rules. You can export the rules from staging environment and import it to the production environment.

Note:

When you import rules to the production environment, you must ensure the process is additive and does not override the existing configuration.

How to export and import relaxation rules

To export and import the relaxation rules, you must complete the following steps:

  1. You must first export the dynamic profiling-based data. For this, the export option is available for the relaxation rules in the WAF profile. When you select this option, you export the dynamic profiling relaxation rules and regular relaxation rules. You can use the export option to download the configuration as a compressed bundle on the appliance.
  2. Once you have exported the data from the staging environment, you must import it to another Citrix ADC appliance. For this, you must use the import option available in the relaxation rules of the WAF profile. When you select this option, the appliance imports the specified relaxation rules bundled and restores it to the WAF profile of the selected appliance.

Note:

If you are going to import relaxation rules in a WAF profile, there are two types of action: Augment – This action ensures import is additive, thus not overriding any existing configuration. Overwrite – This action overwrites the existing configuration with configuration present in the compressed export bundle.”

Import archived relaxation rules file by using CLI

To import the relaxation rules, you must import the archive into the Citrix ADC appliance and then run the restore command to extract the configuration. The following set of CLI commands can be used for exporting, importing, and managing the configurations.

To import the archived file from the specific location and restore, at the command prompt, type:

import appfw archive [-comment ]

Where, “src”: Indicates the source of the tar archive file in the form,://[:][/]“name”: Indicates name of archive. “comment”: Comments associated with this archive.

restore appfw profile [-relaxationRules] [-importProfileName ] [-matchUrlString ] [-replaceUrlString ] [-overwrite] [-augment]

Where,archivename: Indicates source for tar archive. This is a mandatory argument. “relaxationRules”: Option to import all appfw relaxation rules.

importProfileName:指示配置文件名创建或更新到屁股ociate the relaxation rules during restore operation. “matchUrlString”: Indicates action URL string to match in archived relaxation rules.

replaceUrlString: Indicates string to replace in action URL while restoring relaxation rules.

overwrite: Existing rules action to purge existing relaxation rules and replace during import.

augment: Existing rules action to augment relaxation rules during import.

Example:import appfw archive local: dutA_test_pr.tgz demorestore appfw profile dutA_test_pr

Export the archived file to the selected appliance by using the CLI

If you use CLI to export the appfw relaxation rules, you must archive the configuration and then export it. To archive and export the archived file, at the command prompt, type:

<名称> <档案归档appfw概要文件name> [-comment ]

Where,archive name: Indicates source for tar archive. This is a mandatory argument.name: Indicates the appfw profile name containing the relaxation rules to export

export appfw archive

Where, Name. Name of tar archive. This is a mandatory argument. Maximum Length: 31 Target. Path to the file to be exported. This is a mandatory argument. Maximum Length: 2047

Example:> archive appfw profile test_pr archived_test_pr

> export appfw archive archived_test_pr local:dutA_test_pr

To export relaxation rules by using Citrix ADC GUI

Follow the steps given below to export relaxation rules:

  1. Navigate toSecurity>Citrix Web App Firewall.
  2. In the details page, clickCitrix Web App Firewall Profileslink underConfiguration Summarysection.
  3. In theCitrix Web App Firewall Profilepage, click theRelaxation Ruleslink underAdvanced Settingssection.
  4. In theRelaxation Rulessection, clickExport All Relaxation Rules. The action applies to all security checks and on the ones which dynamic learning is enabled on that profile.

    Export-relaxation-rules

To import relaxation rules by using Citrix ADC GUI

Complete the steps to import relaxation rules:

  1. Navigate toSecurity>Citrix Web App Firewall.
  2. In the details page, click theCitrix Web App Firewall Profileslink underConfiguration Summarysection.
  3. In theCitrix Web App Firewall Profilepage, click theRelaxation Ruleslink underAdvanced Settingssection.
  4. In theRelaxation Rulessection, clickImport All Relaxation Rules.
  5. In theConfigure Citrix Web App Firewall Profilepage, set the following parameters:
    1. Local file. Name of the compressed archived file containing the relaxation rules.
    2. Profile Name. Name of the profile to which the relaxation rules are bound.
    3. Matching URL String. Portion of the URL that matches.
    4. Replace URL String. Portion of the URL that replaces the URL string.
    5. Existing Rule Action. Select if the rule must overwrite existing rules or augment the existing rules.
  6. ClickOK.

    Import relaxation rules

Dynamic profiling