This article applies to NetScaler Gateway 14.1, Citrix Gateway 13.x, Citrix Gateway 12.1, and NetScaler Gateway 12.0.
Navigation
💡 = Recently Updated
Change Log
- 2024 Aug 3 – Delivery Group Access Policy page redesigned in CVAD 2407
- 2023 Aug 15 – added link to CTX572334 Eliminate Advanced Endpoint Analysis scans on Mobile devices/iOS
- 2020 Sep 8 – nFactor EPA – added info from CTX278960 AAA GROUP expressions in Gateway Vserver (CVPN, Full VPN and ICA Proxy) use-cases
- 2020 Jun 28 – added nFactor EPA section describing how to do SmartAccess using nFactor EPA.
- 2020 Apr 20 – renamed NetScaler Gateway to Citrix Gateway
- 2018 Nov 24 – EPA Libraries – updated for Windows version 4.3.344.0
- 2018 Oct 10 – EPA Libraries – updated for Mac version 4.3.244.0
- 2018 Sep 28 – EPA Libraries – updated for versions 4.3.204.0 and 4.3.57.0
- 2018 June 4 – new EPA Libraries section to upgrade EPA libraries
SmartAccess / SmartControl
SmartAccess and SmartControl let you change ICA connection behavior (e.g. disable client device mappings, hide icons) based on how users connect to Citrix Gateway. Decisions are based on Citrix Gateway Virtual Server name, Session Policy name, and Endpoint Analysis scan success or failure.
SmartAccess vs SmartControl:
- SmartAccess lets you control visibility of published icons, while SmartControl does not.
- SmartControl is configured exclusively on Citrix Gateway, while SmartAccess requires configuration on both Citrix Gateway, and inside Citrix Studio.
- SmartControl requires Citrix ADC Premium Edition licensing, while SmartAccess is available in all Citrix ADC Editions.
- Both features require Citrix Gateway Universal licenses for every concurrent connection.
Prerequisites
Both SmartAccess and SmartControl have the same prerequisites. You can configure SmartAccess in Citrix Virtual Apps and Desktops (CVAD) at any time, but it won’t work, until you do the following:
- Citrix ADC appliance license: See Feature Licensing in the Gateway Tweaks post. In summary:
- SmartAccess is available in all editions of Citrix ADC appliances.
- SmartControl is available only in Citrix ADC Premium Edition.
- Citrix Gateway Universal Licenses – On the Citrix ADC, go to System > Licenses, and make sure you have Citrix Gateway Universal Licenses allocated to the appliance.
- Most Citrix ADC Editions (except Citrix Gateway Enterprise VPX) come with built-in Gateway Universal licenses: Citrix ADC Standard Edition = 500 licenses, Citrix ADC Advanced Edition = 1,000 licenses, and Citrix ADC Premium Edition = unlimited licenses.
- Additional Citrix Gateway Universal licenses can be acquired through other means. See Feature Licensing in the Gateway Tweaks post for details.
- The Universal licenses are allocated to the hostname of the appliance (click the gear icon to change it), not the MAC address. In a High Availability pair, if each node has a different hostname, then you can allocate the licenses to one hostname, then reallocate to the other hostname. See Feature Licensing in the Gateway Tweaks post for details.
- Citrix Gateway must have ICA Only unchecked.
- On the Citrix ADC, go to Citrix Gateway > Virtual Servers, and edit your Gateway Virtual Server.
- In the Basic Settings section, click the pencil icon.
- Click More.
- Uncheck the box next to ICA Only, and click OK. This tells Citrix Gateway to start using Universal licenses and enables the SmartAccess and SmartControl features.
- On the Citrix ADC, go to Citrix Gateway > Virtual Servers, and edit your Gateway Virtual Server.
- Enable Trust XML on the Citrix Virtual Apps and Desktops (CVAD) Site/Farm:
- On a CVAD Controller, run PowerShell as Administrator.
- Run asnp citrix.* to load the snapins.
- Run Set-BrokerSite -TrustRequestsSentToTheXmlServicePort $true to enable Trust XML.
- Configure Callback URL in StoreFront:
- In StoreFront Console, right-click the Stores node, and click Manage Citrix Gateways.
- Edit a Gateway.
- On the Authentication Settings page, make sure a Callback URL is configured. The Callback URL must resolve to a Citrix Gateway VIP on the same appliance that authenticated the user. The Callback Gateway’s certificate must match the FQDN entered here. If you are configuring Single FQDN for internal and external, then the Callback FQDN must be different than the Single FQDN.
- In StoreFront Console, right-click the Stores node, and click Manage Citrix Gateways.
Once the prerequisites are in place, do the following as detailed below:
- Optionally, configure Endpoint Analysis.
- Configure either SmartControl or SmartAccess.
Endpoint Analysis
Endpoint Analysis (EPA) scans are completely optional. You can configure SmartControl and SmartAccess without implementing any Endpoint Analysis.
Endpoint Analysis is supported on Windows and Mac devices. Other devices, like iOS and Android, do not support Endpoint Analysis. If you want to allow mobile device connectivity, then make sure you have an access mechanism (e.g. ICA Proxy) that works if the Endpoint Analysis scan fails.
Citrix ADC 12.1 and newer support two methods of doing EPA: nFactor EPA, or Classic EPA. Classic EPA will no longer be supported in ADC 13.1 and newer so you should eventually switch to nFactor EPA.
Workspace app on Windows supports EPA when configured using nFactor EPA. Workspace app does not support Classic EPA.
nFactor EPA
EPA can be one of the factors of an nFactor flow. EPA can be performed before authentication, or after authentication.
EPA doesn’t work on iOS/Android. To skip those platforms, see CTX572334 Eliminate Advanced Endpoint Analysis scans on Mobile devices/iOS.
- Create an nFactor EPA Action.
- The easiest way to find EPA is to use the Search box on the top of the left menu. Or, navigate to Security > AAA > Policies > Authentication > Advanced Policies > EPA.
- The EPA Editor link on the right-side of the Expression box lets you configure EPA Expressions. See OPSWAT EPA Expressions below for more details on how to configure an Opswat expression.
- For SmartAccess based on the results of the EPA scan, configure the Default Group field with a new group name (doesn’t exist in Active Directory). You’ll later use the Group name in a Session Policy and use the Session Policy name in your Citrix Policy Access Filters or Delivery Group Access Control. Default Group probably only works if the EPA Factor is performed after authentication.
- The easiest way to find EPA is to use the Search box on the top of the left menu. Or, navigate to Security > AAA > Policies > Authentication > Advanced Policies > EPA.
- After creating an EPA Action, create an Advanced Authentication Policy of type EPA and select the EPA Action you created earlier.
- The expression is either true, or an expression that defines who needs EPA scanning. If you are configuring post-authentication EPA, then you can use group membership (e.g. AAA.User.Is_Member_Of()) expressions.
- The expression is either true, or an expression that defines who needs EPA scanning. If you are configuring post-authentication EPA, then you can use group membership (e.g. AAA.User.Is_Member_Of()) expressions.
- Create a Policy Label for the EPA Factor. Login Schema should be LSCHEMA_INT.
- Bind the EPA Policy to your Policy Label.
- If you don’t bind any other policies, then if EPA fails, then the user shown the Access Denied page. If you want authentication to continue even with a failed EPA scan, then bind another policy to the Policy Label.
- Create an Advanced Authentication Policy named similar to NoAuth and change Action Type to NO_AUTHN. Expression = true. Bind the NoAuth policy to the Policy Label.
- The final Policy Label should have an EPA Factor with Goto = NEXT and the second policy as NoAuth.
- Bind the EPA Policy to your Policy Label.
- In earlier factors that authenticate the user, when binding an authentication policy, click in the Select Next Factor field and select your EPA Policy Label.
- In the earlier authentication factor, edit the Login Schema Profile, click More, and check the box next to Enable Single Sign On Credentials. EPA as later factor overrides the password collected in earlier factors causing Single Sign-on to StoreFront to fail and this checkbox fixes that problem.
- In the earlier authentication factor, edit the Login Schema Profile, click More, and check the box next to Enable Single Sign On Credentials. EPA as later factor overrides the password collected in earlier factors causing Single Sign-on to StoreFront to fail and this checkbox fixes that problem.
- Create a Citrix Gateway Session Policy that is applied when the EPA factor succeeds.
- Go to Citrix Gateway > Policies > Session.
- On the tab named Session Profiles, click Add.
- Name it FullAccess or similar and click Create. The Session Profile does not need any settings.
- Switch to the tab named Session Policies and click Add.
- Select the Profile you just created.
- If you are doing Advanced Policies, then the Expression is AAA.USER.IS_MEMBER_OF(“GroupName”) where “GroupName” is the name of the Default Group you specified when you created the EPA Action. Click Create. If you are doing Classic Policies, then the expression is ns_true.
- If your session policy is Advanced syntax, then bind the Session Policy to your Gateway vServer.
- Go to Citrix Gateway > Virtual Servers and edit an existing vServer.
- Scroll all the way down to the Policies section and click the Session Policies line.
- Add Binding and select the Session Policy you will use for SmartAccess. Priority doesn’t matter.
- Go to Citrix Gateway > Virtual Servers and edit an existing vServer.
- For both Advanced Session Policies and Classic Session Policies, create a AAA Group that matches the Default Group you specified in the EPA Action. CTX278960 says this is also required for IS_MEMBER_OF expressions.
- If you are doing Classic Session Policies, then create bind the Session Policy to the AAA Group. If you are doing Advanced Session Policies bound directly to the Gateway Virtual Server, then you don’t need to bind anything to the AAA Group.
- You can now use the Session Policy in your SmartAccess configuration. See the SmartAccess section below for more details.
Classic EPA Policies
There are two methods of Classic Endpoint Analysis: pre-authentication and post-authentication. For pre-authentication, configure an Endpoint Analysis expression in a Preauthentication Policy. For post-authentication, configure the Endpoint Analysis expression on one or more Session Policies.
- With a Preauthentication Policy, if the Endpoint Analysis scan fails, then users can’t login.
- With a Postauthentication Policy, Endpoint Analysis doesn’t run until after the user logs in. Typically, you create multiple Session Policies. One or more Session Policies have Endpoint Analysis expressions. Leave one policy without an Endpoint Analysis expression so there’s a fallback in case the client device doesn’t support Endpoint Analysis (e.g. mobile devices). The name of the Session Policy is then used later in Citrix Policies and Citrix Delivery Groups.
- Inside the Session Profile is a field for Client Security expression, which supports an EPA expression. This field is for VPN only, and does not affect SmartAccess.
Preauthentication Policies and Profiles are configured at Citrix Gateway > Policies > Preauthentication.
- On the right, switch to the Preauthentication Profiles tab, and create a Preauthentication Profile to allow access.
- Switch to the Preauthentication Policies tab, and create a Preauthentication Policy with an EPA expression. Select the Request Action that allows access.
- The right side of the Expression box has links to create EPA expressions, as detailed below.
Classic Post-authentication Policies and Profiles are configured at Citrix Gateway > Policies > Session.
- When creating a Session Policy, the right side of the Expression box has links to create EPA expressions, as detailed below.
- Classic Syntax vs Default Syntax – EPA expressions can only be added to Classic Syntax Policies. If you click Switch to Default Syntax, then the OPSWAT EPA Editor disappears. Use nFactor EPA instead.
- If you edit a Session Profile, on the Security tab…
- Under Advanced Settings, you will see a Client Security Check String box that lets you enter an EPA Expression. This field applies only to VPN and does not affect SmartAccess. Also, this field does not function if your Session Policy is Advanced instead of Classic.
EPA Expressions
Citrix ADC has two Endpoint Analysis engines: the original Client Security engine, and the newer OPSWAT EPA engine.
OPSWAT EPA Expressions
To configure OPSWAT EPA expressions:
- When creating an nFactor EPA Action, click the EPA Editor link.
- When creating a Classic Preauthentication Policy, or Session Policy, click the OPSWAT EPA Editor link.
- When creating a Classic Preauthentication Policy, or Session Policy, click the OPSWAT EPA Editor link.
- Use the drop-down menus to select the scan criteria.
- You will see some fields with a plus icon that lets you configure more details for the scan.
- Note: the text in these policy expressions is case sensitive.
- Note: the text in these policy expressions is case sensitive.
- Then click Done.
Additional OPSWAT EPA Info
See the following links for more Advanced EPA information:
- Advanced Endpoint Analysis Policy Expression Reference at Citrix Docs
- Advanced Endpoint Analysis Scans at Citrix Docs
- Citrix CTX220961 Pre authentication scan on Netscaler gateway for domain check
- Citrix CTX204764 Expression for EPA scan through NetScaler Gateway to check a generic antivirus and a generic firewall
CLIENT.APPLICATION('ANTIVIR_0_RTP_==_TRUE[COMMENT: Generic Antivirus Product Scan]') EXISTS && CLIENT.APPLICATION('FIREWALL_0_ENABLED_==_TRUE[COMMENT: Generic Firewall Product Scan]') EXISTS
- Citrix Blog Post Patch Management Endpoint Analysis on NetScaler Gateway
- Citrix CTX207623 Windows and macOS Supported Applications by OPSWAT Version 3 for NetScaler EPA Scans contains a list of applications supported by OPSWAT Windows and MAC EPA Scan
- Citrix CTX219296 How to configure EPA Expression to validate if the “Windows update” date is within specific time period.
- Note: Automatic Updates must be enabled for this scan to work. See Citrix CTX219293 NetScaler Gateway EPA Scan Fails When Checking for “Windows Update” on Client Machine
- Note: Automatic Updates must be enabled for this scan to work. See Citrix CTX219293 NetScaler Gateway EPA Scan Fails When Checking for “Windows Update” on Client Machine
- Citrix CTX228922 Configure EPA Scan for Windows Update – Critical or Automatic – shouldn’t have missing patch
- Citrix CTX205267 How Do I Configure EPA for Registry Check?
- CTX221121 Create EPA Scans to Detect Receiver on Clients. Clients without Workspace app or Receiver installed are sent to the a page with a link to the Workspace app Download page, and Clients with Workspace app or Receiver are allowed through to their ICA applications
CLIENT.SYSTEM('REG-NON-NUM_HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Citrix\\Install\\ICA Client\\InstallFolder') EXISTS
Original Client Security Expressions
To configure the original Client Security expressions:
- When creating a Classic Preauthentication Policy or Classic Session Policy, click the Expression Editor link.
- Change the Expression Type to Client Security.
- Use the Component drop-down to select a component.
- A common configuration is to check for domain membership as detailed at Citrix CTX128040 How to Configure a Registry-Based Scan Expression to Look for Domain Membership.
- Citrix CTX128039 How to Configure a Registry-Based EPA Scan Expression on NetScaler to Look for the Active Device or Computer Name of an Explicit Workstation
Once the Classic Preauthentication and/or Classic Session Policies are created, bind them to your Citrix Gateway Virtual Server:
- Edit a Citrix Gateway Virtual Server.
- Scroll down to the Policies section, and click the plus icon.
- Select either Preauthentication or Session, and select the policy you already created. Then click Bind.
- Session Policies with EPA Expressions are typically higher in the list (lower priority number) than non-EPA Session Policies.
EPA Libraries
In NetScaler 12.0 build 57 and newer, the EPA Libraries are updated out-of-band.
- Download the latest EPA libraries.
- In the Citrix ADC menu, click the Citrix Gateway node.
- On the right, in the left column, click Upgrade EPA Libraries.
- Click Choose File
- Browse to one of the .tgz library files, and click Open.
- Click Upgrade.
- Click OK when prompted that EPA Library upgraded successfully.
- Click Upgrade EPA Libraries again.
- Click Choose File.
- Browse to the other .tgz EPA library file, and click Open.
- Click Upgrade.
- Click OK when prompted that upgraded successfully.
- To see the versions, click Upgrade EPA Libraries.
EPA Plug-in
The EPA plug-in is automatically deployed when the user connects to Citrix Gateway – either before the logon page, or after the logon page.
To pre-deploy EPA plug-in, see CTX124649 How to Deploy NetScaler Gateway Plug-in and Endpoint Analysis Installer Packages for Windows by Using Active Directory Group Policy. This article describes how to extract the plug-in .msi file, and deploy using Group Policy.
EPA and Portal Themes
The webpages displayed to the user when downloading the EPA plug-in and running the EPA plug-in can be customized by editing a Portal Theme.
Look in the Advanced Settings column on the right for the three EPA pages. Citrix CTX222812 How to Customize Custom Error Messages for NetScaler Gateway EPA Scans.
EPA Troubleshooting
From Citrix CTX209148 Understanding/Configuring EPA Verbose Logging Feature:
- Go to Citrix Gateway > Global Settings.
- On the right, click Change Global Settings.
- On the Security tab, click Advanced Settings.
- Scroll down, check the box next to Enable Client Security Logging, and click OK.
- When the scan fails, the user is presented with a Case ID.
- You can then grep
/var/log/ns.log
for the Case ID. Or search your syslog.
For client-side logging, on the client machine, go to HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Secure Access Client.
- Make a DWORD value named “EnableEPALogging“, and set the value to 1.
- After attempting the scan again, you’ll find the file %localappdata%\Citrix\AGEE\epaHelper_epa_plugin.txt with details for each scan expression.
NetscalerAssasin EPA OPSWAT Packet flow and Troubleshooting shows a Wireshark trace of an EPA scan.
SmartAccess
Links:
- CTX138110 How to Configure the SmartAccess feature on Access Gateway Enterprise Edition Appliance
- CTX227055 Smart Access Guide for NetScaler Gateway, StoreFront and XenDesktop contains packet traces of the StoreFront Callback URL and XML Broker communication.
Make sure the prerequisites are completed. This includes:
- ICA Only unchecked on Citrix Gateway Virtual Server
- Gateway Universal licenses installed
- Callback URL configured at StoreFront
- Trust XML enabled on Delivery Controllers
SmartAccess is configured in two places:
- Delivery Group > Access Policy page in Web Studio in CVAD 2407 and newer has been redesigned. There are built-in Access Policies that you can edit. And you can add Access Policies. They support both inclusions and exclusions. See Citrix Docs for details.
- CVAD 2402 and older looks like the screenshot below.
- CVAD 2402 and older looks like the screenshot below.
- Citrix Policy (user settings only) > filters > Access control in Web Studio looks like the screenshot below.
- Group Policy looks like the screenshot below.
- Group Policy looks like the screenshot below.
In any case, you enter the name of a matching Gateway Virtual Server, and the name of a matching Session Policy (or Preauthentication Policy).
- Set AG farm name or Site or Farm name to the name of the Citrix Gateway Virtual Server.
- Set Access condition or Filter to the name of the Citrix Gateway Session Policy (or Preauthentication Policy).
- You can use * as a wildcard in either field.
- The matching Citrix Gateway Session Policy typically has an EPA Factor in an nFactor flow that puts the user in a AAA Group that has a group-specific Session Policy bound to the AAA group. That way the Session Policy only applies to connections that match the EPA Expression.
Icon visibility – Access Control at the Delivery Group controls visibility of icons published from that Delivery Group.
- Access Control on a Delivery Group is Allow only. Icons are hidden from non-matching connections.
- You can uncheck Connections through Citrix Gateway to hide the published icons from all Citrix Gateway connections.
- It’s not possible to hide individual published applications. You can hide all applications from a single Delivery Group, or none of them. If you need more granularity, then you’ll have to split the applications onto different Delivery Groups.
- App Groups do not have an Access Control option. It’s Delivery Groups only.
Citrix Policy Settings – Access Control filter on a Citrix Policy determines if the Policy settings apply or not.
- Access Control filter applies to User Settings only. It’s not configurable for Computer Settings.
- You typically configure the Unfiltered Citrix Policy to block all client device mappings. Then you configure a higher priority Citrix Policy with Access Control filter to re-enable client device mappings for endpoint machines that match the Session Policy and EPA Expression.
When connected to a session, Director shows SmartAccess Filters on the Session Details page. Notice the Farm Name (Gateway Virtual Server name) and Filter Name (Session Policy name)
SmartControl
The SmartControl feature lets you configure some of the SmartAccess functionality directly on the appliance. See Configuring SmartControl at Citrix Docs for detailed instructions.
- Note: SmartControl requires Citrix ADC Premium Edition. If you don’t have Premium Edition, you can instead configure SmartAccess.
- SmartControl cannot hide published icons. If you need that functionality, configure SmartAccess, either as a replacement for SmartControl, or as an addition to SmartControl.
To configure SmartControl:
- Make sure the Prerequisites are completed. This includes: ICA Only unchecked and Gateway Universal licenses installed. Callback URL and Trust XML are not needed.
- If you are using a Preauthentication Policy to run an Endpoint Analysis scan:
- Edit the Preauthentication Profile.
- Configure the Default EPA Group with a new group name. You’ll use this group name later.
- Edit the Preauthentication Profile.
- If you are instead using a Session Policy to run the post-authentication Endpoint Analysis scan:
- Edit the Session Profile
- On the Security tab, use the Smartgroup field to define a new group name for users that pass the scan. You’ll use this group name later.
- On the left, expand Citrix Gateway, expand Policies, and click ICA.
- On the right, switch to the Access Profiles tab, and click Add.
- Configure the restrictions as desired, and click Create.
- Configure the restrictions as desired, and click Create.
- Switch to the ICA Action tab, and click Add.
- Give the ICA Action a name.
- Select the ICA Access Profile.
- Click Create.
- Switch to the ICA Policies tab, and click Add.
- In the Create ICA Policy page, do the following:
- Give the ICA Policy a name.
- Select the previously created ICA Action.
- Enter an expression. You can use HTTP.REQ.USER.IS_MEMBER_OF(“MyGroup”).NOT where MyGroup is the name of the SmartGroup you configured in the session profile or preauth scan.
- Click Create when done.
- Edit your Gateway Virtual Server.
- Scroll down to the Policies section, and click the plus icon.
- Change the Choose Type drop-down to ICA, and click Continue.
- Select the SmartControl policy you created earlier, and click Bind.
- Scroll down to the Policies section, and click the plus icon.