Rule ID
SV-289121r1318132_rule
Version
V1R1
Mobile code is defined as software modules obtained from remote systems, transferred across a network, and then downloaded and executed on a local system without explicit installation or execution by the recipient. Examples of mobile code include JavaScript, VBScript, Java applets, ActiveX controls, Flash animations, Shockwave videos, and macros embedded within Microsoft Office documents. Mobile code can be exploited to attack a host. It can be sent as an email attachment or embedded in other file formats not traditionally associated with executable code. While the NetScaler Gateway cannot replace the network IDS or the anti-virus and host-based IDS (HIDS) protection installed on the network's endpoints, vendor or locally created sensor rules can be implemented, which provide preemptive defense against both known and zero-day vulnerabilities. Many of the protections may provide defenses before vulnerabilities are discovered and rules or blacklist updates are distributed by anti-virus or malicious code solution vendors. To monitor for and detect known prohibited mobile code or approved mobile code that violates permitted usage requirements, the NetScaler Gateway must implement policy filters, rules, signatures, and anomaly analysis. Satisfies: SRG-NET-000228-ALG-000108, SRG-NET-000288-ALG-000109
Verify the NetScaler Gateway implements Web App Firewall (WAF) protections against Cross-Site Scripting (XSS) and malicious mobile code execution. Method 1: GUI Verification 1. Log in to the NetScaler GUI. 2. Navigate to System >> Settings >> Configure Advanced Features. 3. Verify that "Web App Firewall" is checked (enabled). 4. Navigate to Security >> Citrix Web App Firewall >> Profiles. 5. Select the AppFw Profile bound to the active Gateway Virtual Server and select "Edit". 6. In Advanced Settings menu on the right, select "Security Checks". 7. In the main panel, verify that "Cross-Site Scripting (XSS)" has "Block" enabled. Method 2: CLI Verification 1. Log in to the NetScaler CLI. 2. Run the following command to verify the WAF feature is enabled: show ns feature 3. Verify the output shows "AppFw" as "ON". 4. Run the following command to identify the active WAF policy and profile: show appfw global 5. Run the following command to view the profile settings (replace "<profile_name>" with the active profile): show appfw profile <profile_name> 6. Verify the output displays the following parameter: crossSiteScriptingAction: block If the Web App Firewall feature is not enabled, or if Cross-Site Scripting (XSS) protection is not set to block, this is a finding.
Configure the NetScaler Gateway WAF to protect against XSS and malicious mobile code execution. Method 1: GUI Configuration 1. Log in to the NetScaler GUI. 2. Navigate to System >> Settings >> Configure Advanced Features, check the box for "Web App Firewall", and select "OK". 3. Navigate to Security >> Citrix Web App Firewall >> Profiles. 4. Select "Add" to create a new profile (or select an existing profile and select "Edit"). 5. In the "Advanced Settings" menu on the right, select "Security Checks". 6. In the main panel, locate "Cross-Site Scripting (XSS)" and check the box in the "Block" column. Select "OK". 7. Navigate to Security >> Citrix Web App Firewall >> Policies >> Firewall. Select "Add". 8. Name the policy, select the profile configured in Step 6 as the action, enter "true" as the expression, and select "Create". 9. Navigate to Security >> Citrix Web App Firewall >> Policies >> Firewall. 10. Select "Policy Manager". 11. Select "Default Global" from the Bind Point drop-down menu and select "Continue". 12. Select "Add Binding", select the policy created in Step 8, assign a unique priority, and select "Bind". 13. Save the running configuration. Method 2: CLI Configuration 1. Log in to the NetScaler CLI. 2. Run the following command to enable the Application Firewall feature: enable ns feature AppFw 3. Run the following command to create or update an Application Firewall profile with the required XSS inspection features: add appfw profile <profile_name> -crossSiteScriptingAction block log stats 4. Run the following command to create an AppFw policy linking to the profile: add appfw policy <policy_name> true <profile_name> 5. Run the following command to bind the AppFw policy globally: bind appfw global <policy_name> <priority_number> -type REQ_DEFAULT 6. Run the following command to save the configuration: save ns config