Citrix Gateway

Stateless RDP Proxy

The Stateless RDP Proxy accesses an RDP host. Access is granted through the RDPListener on Citrix Gateway when the user authenticates on a separate Citrix Gateway Authenticator. The information required by the RDPListener for Citrix Gateway is securely stored on a STA server. A STA server can be placed anywhere as long as the Citrix Gateway and application enumeration servers can reach it. For details see, https://support.citrix.com/article/CTX101997.

The flow and new knobs created for this functionality are described here.

Prerequisites

  • User is authenticated on the Citrix Gateway authenticator.

  • The initial /rdpproxy URL and RDP Client are connected to a different RDPListener Citrix Gateway.

  • The Authenticator Gateway using a STA Server securely passes the RDPListener Gateway information.

Configuration

  • Add a rdpServer profile. The server profile is configured on the RDPListener Gateway.

     add rdpServer Profile [profilename] -rdpIP [IPV4 address of the RDP listener] -rdpPort [port for terminating RDP client connections] -psk [key to decrypt RDPTarget/RDPUser information, needed while using STA].
    

    For stateless RDP proxy, the STA Server validates the STA ticket, sent by the RDP client, to obtain the RDPTarget/RDPUser information.

    The rdpServer Profile is configured on the VPN virtual server using the following command:

     add vpn vserver v1 SSL [publicIP] [portforterminatingvpnconnections] -rdpServerProfile [rdpServer Profile]
    

    Warning Once the rdpServerProfile is configured on the VPN virtual server, it cannot be modified. Also, the same serverProfile cannot be reused on another VPN virtual server.

The rdp profile command was renamed as rdpClient profile and has new parameters. The multiMonitorSupport command was added. Also, an option to configure custom params, which are not supported as part of the RDP client profile, has been added. The clientSSL param was removed, since the connection is always secured. The client profile is configured on the authenticator Gateway.

add rdpClient profile <name> -rdpHost <optional FQDN that will be put in the RDP file as ‘fulladdress’> [-rdpUrlOverride ( ENABLE | DISABLE )] [-redirectClipboard ( ENABLE | DISABLE )] [-redirectDrives ( ENABLE | DISABLE )]

        [-redirectPrinters ( ENABLE | DISABLE )] [-keyboardHook <keyboardHook>] [-audioCaptureMode ( ENABLE | DISABLE )] [-videoPlaybackMode ( ENABLE | DISABLE )]

        [-rdpCookieValidity <positive_integer>][-multiMonitorSupport ( ENABLE | DISABLE )] [-rdpCustomParams <string>]

The –rdpHost configuration is used in a single Gateway deployment.

  • Associate the RDP Profile with the VPN virtual server.

You can associate an RDP profile either by configuring a sessionAction+sessionPolicy or by setting the global VPN parameter.

Example:

add vpn sessionaction <actname> -rdpClientprofile <rdpprofilename>

add vpn sessionpolicy <polname> NS_TRUE <actname>

bind vpn vserver <vservername> -policy <polname> -priority <prioritynumber>

OR

set vpn parameter –rdpClientprofile <name>

Connection Counter

A new connection counter ns_rdp_tot_curr_active_conn was added, which keeps the record of the number of active connections in use. It can be viewed as a part of the nsconmsg command on the Citrix ADC shell. CLI command to view these counters is planned to be added later.

Connection Flow

There are two connections involved in the RDP Proxy flow. The first connection is the user’s SSL VPN connection to the Citrix Gateway VIP, and enumeration of the RDP resources.

The second connection is the native RDP client connection to the RDP listener (configured using rdpIP and rdpPort) on the Citrix Gateway, and subsequent proxying of the RDP client to server packets securely.

Connection flow diagram

  1. The User connects to the Authenticator Gateway VIP and provides the credentials.

  2. After successful login to the gateway, the user is redirected to the homepage/external portal which enumerates the remote desktop resources that the user can access.

  3. Once the user selects an RDP resource, a request is received by the Authenticator Gateway VIP, in the format https://AGVIP/rdpproxy/ip:port/rdptargetproxy indicating the published resource that the user clicked. This request has the information about the IP and port of the RDP server that the user has selected.

  4. The authenticator gateway processes the /rdpproxy/ request. Because the user is already authenticated, this request comes with a valid gateway cookie.

  5. The RDPTarget and RDPUser information is stored on the STA server and a STA Ticket is generated. The information is stored as an XML blob which is optionally encrypted using the configured pre-shared key. If encrypted, the blob is base64 encoded and stored. The Authenticator Gateway uses one of the STA servers that is configured on the Gateway virtual server.

  6. The XML blob is in the following format

    <Value name=”IPAddress”>ipaddr</Value>\n<Value name=”Port”>port</Value\>n
    
    <Value name=”`Username`”>username</Value\>\n<Value name=”Password”>pwd\</Value\>
    
  7. The rdptargetproxy obtained in the /rdpproxy/ request is put as the ‘fulladdress’ and the STA ticket (pre-pended with the STA AuthID) is put as the loadbalanceinfo in the.rdp file.

  8. The .rdp file is sent back to the client end-point.

  9. The native RDP client launches and connects to the RDPListener Gateway. It sends the STA ticket in the initial x.224 packet.

  10. The RDPListener Gateway validates the STA ticket and obtains the RDPTarget and RDPUser information. The STA server to be used is retrieved using the ‘AuthID’ present in the loadbalanceinfo.

  11. A Gateway session is created for storing authorization/auditing policies. If a session exists for the user, it is reused.

  12. The RDPListener Gateway connects to the RDPTarget and single signs on using CREDSSP.

Single Gateway Compatibility

If the RDP file is generated using the /rdpproxy/rdptarget/rdptargetproxy URL, we generate a STA ticket, otherwise the current method of the loadbalanceinfo referring to the session directly is used.

RDP file generation method

In a single gateway deployment, the /rdpproxy URL comes to the Authenticator Gateway itself. A STA server is not required. The authenticator gateway encodes the RDPTarget and the Citrix ADC AAA session cookie securely and sends this as the loadbalanceinfo in the .rdp file. When the RDP Client sends this token in the x.224 packet, the authenticator gateway decodes the RDPTarget information, looks up the session, and connects to the RDPTarget.

Upgrade Notes

The rdpIP and rdpPort, which were previously configured on the VPN virtual server is part of the rdpServerProfile. The rdp Profile is renamed as rdp ClientProfile and the parameter clientSSL is removed. Therefore, the earlier configuration does not work.

Create RDP Server Profile

  1. Go to Citrix Gateway > Policies > RDP.

    Select RDP option

  2. Go to Server Profiles tab and click Add.

    Add profile

  3. Enter the following information to create the RDP Server Profile.

    RDP server details

Configure RDP Client Profile

  1. Go to Citrix Gateway > Policies > RDP

    Select RDP option

  2. Go to Client Profiles tab and click Add.

    Click to add profile

  3. Enter the following information to configure the RDP Server Profile.

    RPD profile information

Set up a Virtual Server

  1. Go to Citrix Gateway > Virtual Server.

    Virtual server page

  2. Click Add to create an RDP Server.

    Add virtual server

  3. Complete the data on this Basic Settings page and click OK.

    Add basic settings

  4. Click the pencil to edit the page.

    Edit the page

Stateless RDP Proxy