Virtualization, technology, and random rantings with a focus on Citrix and VMware.

Category: XenApp Page 4 of 7

Change That Deprecated HTTP.REQ.USER

Get rid of it! In the How To Create The Wow nFactor part one (https://xenapplepie.com/2022/03/13/how-to-create-the-wow-nfactor/), there is a section where you get a popup after configuring your LDAPS authentication. This outlines resolving that by logging into your handy, dandy Netscaler ADC with the power of SSH or putty. I’ll also link from that location the changes listed here to resolve that. This example will use putty as getting in the door. After that point of connection, the commands are the same from an SSH session.

Open up Putty and enter the host name / IP.

Login with your nsroot privilege.

Enter “shell” to drop to the Linux shell.

At the prompt, enter “cd /nsconfig/loginschema/LoginSchema.”

Press “Enter.”

Enter “ls” to list folder contents. You are looking for the PrefilUserFromExpr.xml file.

Enter “cp PrefilUserFromExpr.xml /nsconfig/loginschema/PrefilUserFromExpraaa.xml.” You can change the file name to whatever you wish. I just used this name for the example. This copies the xml file that is the template for the xml file you are going to modify.

Press “Enter.”

Type “cd..” to go up a folder level.

Type “ls” to list folder contents. This is to confirm the file copied correctly.

Type “vi PrefilFromUserExpraaa.xml.” This will open the file in vi editor so that you can make changes to the file.

Press “Enter.”

Use your arrow keys to navigate to the ${http.req.user.name}.

Highlight the first “h.”

Press the “Del” key to delete the text until you have just “{}.”

Press the “i” key to “Insert” and enter “AAA.USER.NAME” in the area so that it looks like ${AAA.USER.NAME}.

Press the “Esc” key and enter “:w!” This will write the file.

Press the “Esc” key and enter “:q” This will quit the vi session.

Type “exit” and press “Enter.” This exits the shell session.

Type “exit” and press “Enter.” This will exit your putty session.

Now you will need to go back to the section for the LDAP schema in your nFactor flow and edit. You will choose the LDAPS_Auth_Test Login Schema.

Click “Edit.”

Click the pencil icon.

Click on the “PrefilFromUserExpraaa.xml.”

Click “Select.” If you do not do this part, you won’t see the change reflected. You will see the ${AAA.USER.NAME} in the “User name” field.

Click “OK.”

Click “Done.”

You have completed the change to the custom XML file to move from the deprecated setting!

What’s New In 2203!? Check It Out!

https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/whats-new.html

CVAD 2203!!! It Is Here!!

https://www.citrix.com/downloads/citrix-virtual-apps-and-desktops/product-software/citrix-virtual-apps-and-desktops-2203.html

Get on over and get it downloaded!

How To Create The Wow nFactor Part 2!

nFactor Flow

This is part 2 of the nFactor setup that outlines how to setup the AAA-TM server and the Authentication Profile that you need in order to implement the nFactor flow you created in part 1. Link to Part 1 below.

Part 1: https://xenapplepie.com/2022/03/13/how-to-create-the-wow-nfactor/

This section outlines setting up the AAA-TM server to replace basic authentication on Citrix Gateway. If you want to make this accessible to things other than just Citrix Gateway, you will need an IP address, a certificate, and a DNS entry to point to said IP address. If you want to ONLY use it for Citrix Gateway, there is an option under the configuration for IP Address Type to select “Non Addressable.” In this example, an IP address will be used.

Login to you Citrix ADC and navigate to Security > AAA – Application Traffic > Authentication Virtual Servers. Select “Add.”

You can do two different assignments with this setting. Under “IP Address Type,” you can select “Non Addressable” if you only wish to use for Citrix Gateway.

Enter “Name.”

Select “IP Address Type” as “IP Address.”

Enter IP address.

Click “OK.”

Click on “No Server Certificate.”

Select the certificate you wish to bind to the AAA-TM server.

Click “Select.”

Select “Bind.”

Select “Bind.”

Select “Continue.”

Click “nFactor Flow.”

Click “Add Binding.”

Select the nFactor flow you created previously and click “Select.”

Enter “true” for the “Expression.”

Click “Bind.”

In the upper-right, select “Portal Themes.”

Select “Add.”

Here you can change the look of the theme. Accepting the defaults, click “OK.”

Click “Done.”

Click “OK.”

Click “Done.”

This completes the setup of the AAA-TM vserver. The next step is to create the Authentication Profile that will be used on Citrix Gateway to utilize the AAA-TM vserver.

Navigate to Security > AAA – Application Traffic > Authentication Profile.

Select “Add.”

Enter “Name” for the profile.

In the drop down for “Authentication Virtual Server,” select the AAA-TM server you created.

Click “Select.”

Click “Create.”

All the pieces have been created, now to apply to Citrix Gateway vserver.

Navigate to Citrix Gateway > Citrix Gateway Virtual Servers.

Select the one you you wish to edit and select “Edit.”

In the upper-right, select “Authentication Profile.”

Select the authentication profile you created earlier and select “OK.”

If you have any policies under “Basic Authentication,” you will need to click the pencil icon and unbind all the policies you have bound there.

Click “OK.”

Click “Done” at the bottom.

Citrix Gateway vserver is now using the Advanced Authentication with nFactor!

Keep It On The Level, The MinimumFunctionalLevel

Sometimes, over time, you upgrade and upgrade. But maybe you forgot to upgrade your functional levels for your Machine Catalogs and Delivery Groups. If you don’t have the right functional level, you may be missing out on features. (Link to functional levels: https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/install-configure/machine-catalogs-create.html#vda-versions-and-functional-levels)

So here is a quick way to upgrade the functional level. This is done for “L7_20” level. As newer levels come out, you can change the value.

# This will upgrade functional levels on Delivery Groups and Machine Catalogs. This will need to be ran on either a Delivery Controller or somewhere you have the Citrix Powershell SDK installed.
asnp Citrix*
$adminAddress = "deliverycontroller-FQDN:80"
$brokerCatalog = Get-BrokerCatalog -AdminAddress $adminAddress |Where MinimumFunctionalLevel -lt "L7_20"|Select Name, MinimumFunctionalLevel
$brokerDesktopGroup = Get-BrokerDesktopGroup -AdminAddress $adminAddress |Where MinimumFunctionalLevel -lt "L7_20"| Select Name, MinimumFunctionalLevel
foreach($brokerCat in $brokerCatalog) {
    Get-BrokerCatalog -AdminAddress $adminAddress -name $brokerCat.name | Set-BrokerCatalog -MinimumFunctionalLevel L7_20
    }
foreach($brokerDesk in $brokerDesktopGroup) {
    Get-BrokerDesktopGroup -AdminAddress $adminAddress -name $brokerDesk.name | Set-BrokerDesktopGroup -MinimumFunctionalLevel L7_20
    }
# Check Machine Catalogs after upgrading functional levels
Get-BrokerCatalog -AdminAddress $adminAddress |Where MinimumFunctionalLevel -lt "L7_20"| Select Name, MinimumFunctionalLevel
# Check Delivery Groups after upgrading functional levels
Get-BrokerDesktopGroup -AdminAddress $adminAddress |Where MinimumFunctionalLevel -lt "L7_20" | Select Name, MinimumFunctionalLevel

Firmware Upgrade Complete! Responder, Where’d You Go?!

Recently we had upgraded firmware on a Citrix ADC from 13.0-83.27 to 13.0-85.15. This was to try and correct an issue with the HTML interface not updating the custom settings on the Login Schemas for nFactor configuration. It would create the custom XML file for use, but it wouldn’t reflect any changes to it. I checked the permissions on the XML file and they would show root had read / write. You could still copy the XML file down via tools like WinSCP, make the edit, and copy back to the ADC.

Below you can see what happened. You would navigate to AppExpert > Responder and you would see the proper number of policies showing.

After you click on the the # Responder Policies, you see below.

It shows that there are no policies there. You can click on “Statistics” and you see this below.

It appears that it reset the counters as well. You can putty into the ADC and do a “show run” and you see that they are still there.

You can see that the policies are there. They do appear to work, but they just don’t show on the HTML GUI.

So a downgrade of version will be in order to see if that resolves the issue and Citrix is still looking at the issue to find a resolution.

UPDATE: Looks like a firmware revision reversion took care of the display issue with the showing of Responder policies.

How To Create The Wow nFactor!

nFactor Flow

This will end up being my first foray into a multi-part series. I will post the links to the other relevant walk throughs as I complete them.

Part 2 of the configuration: https://xenapplepie.com/2022/03/22/how-to-create-the-wow-nfactor-part-2/

This configuration covers setting up EULA as a first factor in an nFactor flow to do one side of an MFA configuration. This will setup a group extraction that looks for an assigned Universal group that is designated to trigger directing traffic to an MFA provider. The reason for using a Universal group would be in an instance where you have a forest with multiple subdomains that have a two-way transitive trust. This allows you to manage group membership from one domain as the Universal group will be replicated to all the domain controllers. This example is to check membership of the Universal group and perform cascading LDAP for the users that are NOT members of that Universal group.

So I was trying to move to advanced authentication in a test environment. While I was doing that, I thought to myself that since my end goal with that test, would be to prep to move to MFA. That led to me thinking how I would want to implement that. Then…… I ran into a very interesting thing when you move from using basic authentication to an authentication profile with AAA-TM, that the EULA option goes bye bye. There isn’t even an option to select. So I went looking how to resolve that. One option was to follow a guide that I found to edit some xml files, but that meant that I would have to manually copy these to keep them in sync between the Citrix ADCs. I didn’t like that idea but did see the option to use EULA as a first factor in nFactor. Hmm… I was already thinking in that mode to setup nFactor since it would be needed to go down the MFA road. So that is the decision I decided to work on and get testing. I also found some interesting tidbits that I’ll point out in the configuration.

Update: Changed LDAPS policy settings to fix “Anonymous” issue.

Update: Added link to article to create custom XML file to change ${http.req.user.name} to ${AAA.USER.NAME}

So here we go!

You will need to have either Advanced or Premium license to have access to this feature. You will also need to have configured an Authentication Virtual Server which I will link soon.

Login to you Citrix ADC.

Navigate to Security > AAA – Application Traffic > nFactor Visualizer > nFactor Flows.

Select Add.

Select the “+” in the center of the square.

Select “Create Factor.”

Enter “Factor Name.”

Click “Create.”

Select “Add Schema.”

Enter “Name” for schema.

In the “Authentication Schema” box, select the “Edit” pencil.

Click on the “LoginSchema.” This will bring up a list to choose from.

Scroll down and select “Eula.xml.”

Click the “Edit” button if you want to edit the EULA message.

After you change the EULA message below and click “Save,” click the “Select” button. This is VERY important or it won’t select it.

After you have configured the message, click “Save.”

Click “Create” button.

Click “OK.”

Click on “Add Policy.”

Click the “Add” button.

Name the policy and select “Action” as “NO_AUTHN.”

For the “Expression,” enter “HHTP.REQ.URL.CONTAINS(“/nf/auth/doAuthentication.do”)

Click “OK.”

Click “+” sign beside “NO_Authn_Pol” (whatever you name the Authentication Policy).

Select “Create Factor.” This factor will do the group extraction to test group access.

Name “Factor Name.” (Grp_Ext_Test in this example)

Select “Add Schema.”

Select “Only_User_Name.” This will have the user enter their user name to be evaluated.

Click “OK.”

Click “Add Policy.”

Click “Add.”

Enter “Name” for policy (test-ldap-grpexpt-pol in this example).

Select “Action Type” as “LDAP.”

For the “Expression” enter “true.”

Click “Add” on “Action.”

Select the root of the forest (domain if you only have 1 domain) for the “Server Name.” (The DC that you are trying to access will need to have the Global Catalog available for this to work correctly)

For the “Port,” choose either 3268 for unsecure LDAP or 3269 for secure LDAP (This will require that you upload the root certificate for the organization to utilize).

Make sure the UNCHECK the box for Authentication. This is just going to do a lookup if the user is part of the MFA group.

Enter your “Base DN” as where the users will be or the root of the forest / domain.

Enter “Administrator Bind DN” which is the account that will authenticate to the domain.

Enter and confirm “Administrator Password.”

Click “Test Network connectivity” to make sure that it is working correctly.

Complete “Server Logon Name Attribute” as “sAMAccountName.” The samaccountnames need to be unique in the forest or you will have issues with this global catalog lookup.

For “Group Attribute” select “memberOf.”

For “Sub Attribute Name” select “cn.”

Click the “+” sign beside “test-ldap-grpext-pol.”

Select “Create decision block” and enter “Decision block Name.” (Grp_Eval_Test in this example)

Click “Create.”

Click “Add Policy.”

Click “Add.” (NonMFA_Test in this example)

Select “Action Type” as “N0_AUTHN.”

Select “Action” as “NO_AUTHN.”

In the “Expression” enter “AAA.USER.IS_MEMBEROF(“UniversalGroup”).NOT.” (UniversalGroup is the group name of the MFA testing group)

Click on the “+” sign beside “NonMFA_Test.”

Select “Create Factor.”

Enter “Factor Name.” (LDAPS_Auth_Test in this example)

Click “Create.”

For the “Authentication Schema” click the pencil icon.

This allows you to take what was entered just after click on “Continue” for the EULA and populating that in the User Name / Password dialogue to prevent users from having to enter it twice.

Under the “Login Schema Files” select “PrefilUserFromExpr.xml. (Note that User Name contains $(http.req.user.name).

Click “Select.”

Click “Create.”

This error will pop up and you have to click “OK.” It will still work. This is the link to the remediation of this: https://xenapplepie.com/2022/04/06/change-that-deprecated-http-req-user/

Click “OK.”

Click “Add Policy.”

Enter “Name.” (test-auth-pol in this example)

Under “Action Type” select “LDAP.”

For “Action” select existing LDAP/LDAPS server.

For “Expression” enter “true.”

You can click the “+” sign on the bottom of the box to add additional LDAP/LDAPS policies. This is what you would normally see under the Basic Authentication on the Citrix Gateway.

Once you have completed this, you will need to go the appropriate Citrix Gateway vServer and change the authentication. Next step to adding nFactor and using Advanced Authentication: https://xenapplepie.com/2022/03/22/how-to-create-the-wow-nfactor-part-2/

EULA Evolves, Form Of nFactor!

Preview of what is coming this weekend…..

nFactor Overview

How about a way to convert basic authentication on Citrix Gateway on-prem to advanced authentication with nFactor.

1912 LTSR CU5 Released!

It has been released! Ghostbusters summoned to get rid of those ghost sessions!

https://www.citrix.com/downloads/citrix-virtual-apps-and-desktops/product-software/citrix-virtual-apps-and-desktops-1912ltsr-cu5.html

Under My SSL Thumbprint

Wouldn’t you know it!? A vCenter certificate got changed out and now your hypervisor connector is showing it no worky. Come to find out you missed the email memo that the certificate was getting changed. Or you might’ve been busy and didn’t think too much of it. Well, now you have to get it fixed! What if there was a way to get that information quickly and easily so that you just had to do some copy / paste magic to resolve it? Well…. There is! This handy dandy little script will get those pesky thumbprints and kick them out as a csv so you can use them to update your connector in the XenDesktop database.

# A script to check SSL thumbprints on your Citrix hypervisor connections. This will get all of the thumbprints of your connectors and will get the SSL thumbprints of your vCenters if you happen to have more than one.
# This is for running on in-premise Citrix farm (7.x) on a Delivery Controller with 10.1.0 VMware.PowerCLI module and the Citrix SDK installed with VMware ESXi 7.0U1 or later. This also is ran in ISE. Get-SSLThumbprint function is from https://gist.github.com/lamw/988e4599c0f88d9fc25c9f2af8b72c92
# with the return $SSL_THUMBPRINT -replace '(..(?!$))','$1' changed from ending in '$1:' The instructions for changing the SSL thumbprint can be found at https://support.citrix.com/article/CTX224551. 

asnp Citrix*

Function Get-SSLThumbprint {
    param(
    [Parameter(
        Position=0,
        Mandatory=$true,
        ValueFromPipeline=$true,
        ValueFromPipelineByPropertyName=$true)
    ]
    [Alias('FullName')]
    [String]$URL
    )

add-type @"
        using System.Net;
        using System.Security.Cryptography.X509Certificates;
            public class IDontCarePolicy : ICertificatePolicy {
            public IDontCarePolicy() {}
            public bool CheckValidationResult(
                ServicePoint sPoint, X509Certificate cert,
                WebRequest wRequest, int certProb) {
                return true;
            }
        }
"@
    [System.Net.ServicePointManager]::CertificatePolicy = new-object IDontCarePolicy

    # Need to connect using simple GET operation for this to work
    Invoke-RestMethod -Uri $URL -Method Get | Out-Null

    $ENDPOINT_REQUEST = [System.Net.Webrequest]::Create("$URL")
    $SSL_THUMBPRINT = $ENDPOINT_REQUEST.ServicePoint.Certificate.GetCertHashString()

    return $SSL_THUMBPRINT -replace '(..(?!$))','$1'
}


$xdConnections = Get-ChildItem XDHyp:\Connections | Select HypervisorConnectionName, HypervisorAddress, SslThumbprints

$xdThumbprints = @()

foreach($xdc in $xdConnections) 
    {
    $line = ""| Select HypervisorConnectionName, HypervisorAddress, SslThumbprints, vCenterThumbprints, SameThumbprint
              
    $line.HypervisorConnectionName = ($xdc).HypervisorConnectionName
    $line.HypervisorAddress        = ($xdc).HypervisorAddress | Out-String
    $line.SslThumbprints           = ($xdc).SslThumbprints | Out-String
    $line.vCenterThumbprints       = Get-SSLThumbprint (($xdc).HypervisorAddress | Out-String)
    $line.SameThumbprint           = ($line.SslThumbprints -match $line.vCenterThumbprints)

    $xdThumbprints += $line
        
    }

$xdThumbprints | Export-Csv c:\scripts\logs\sslthumbprints.csv

Page 4 of 7

Powered by WordPress & Theme by Anders Norén