How to create a custom log when a user 'logs in' or 'logs out' of the Gateway session.

How to create a custom log when a user 'logs in' or 'logs out' of the Gateway session.

book

Article ID: CTX580412

calendar_today

Updated On:

Description

Demonstrate on Citrix Gateway How to create a custom log when a user 'logs in' or 'logs out' of the Gateway to a Storefront session.


Instructions

We need to use a responder Policy with a NOOP action, this means it won't affect the traffic, it will just apply the LogAction on the Vserver through the responder policy.

For the 'Log in' logging configuration:
  1. Create a LogAction to log the user interaction, with your custom text for 'Logging in', for example, with the following command:
    • add audit messageaction LogOutLog INFORMATIONAL "\"Client with IP  \" +CLIENT.IP.SRC +\"Logged in\""
  2. Create a responder policy to log the user interaction, this will match the HTTP GET 'resource list' that a client send when it has been authenticated, bind the 'LogAction' here: 
    • add responder policy ResponderLogInLog "HTTP.REQ.URL.PATH.EQ(\"/Citrix/StoreWeb/Resources/List\")" NOOP NOOP -logAction LogInLog
  3. Bind the policy to the Vserver Gateway as a responder policy with the REQUEST typing, with the following command:
    • bind vpn vserver external_gateway_cvad -policy ResponderLogInLog -priority 100 -gotoPriorityExpression END -type REQUEST

For the 'Log out' logging configuration:
  1. Create a LogAction to log the user interaction, with your custom text for 'Logging out', for example, with the following command:
    • add audit messageaction LogOutLog INFORMATIONAL "\"Client with IP  \" +CLIENT.IP.SRC +\"Logged out\""
  2. Create a responder policy to log the user interaction, this will match the HTTP GET Authentication/Logoff that a client send when it logs out, bind the 'LogAction' here, with the following command:
    • add responder policy ResponderLogOutLog "HTTP.REQ.URL.PATH.EQ(\"/Citrix/StoreWeb/Authentication/Logoff\")" NOOP NOOP -logAction LogOutLog
  3. Bind the policy to the Vserver Gateway as a responder policy of type request, with the following command: 
    • bind vpn vserver external_gateway_cvad -policy ResponderLogOutLog -priority 110 -gotoPriorityExpression END -type REQUEST
  1. Enable the Custom log messages on ns.log, with the following command: 
    • set audit syslogParams -userDefinedAuditlog YES

To demonstrate the outcome: 
  1. Open an SSH session to the ADC
  2. Enter the command: shell
  3. Type: tail -f /var/log/ns.log | grep 'default RESPONDER'
The logs will be generated when the user hits the path for resource list and the log out path 

image.png

Issue/Introduction

Demonstrate on Citrix Gateway How to create a custom log when a user 'logs in' or 'logs out' of the Gateway to a Storefront session.

Additional Information

Gateway to Storefront Flow - https://support.citrix.com/article/CTX227054/netscaler-gateway-storefront-and-xendesktop-integration-communication-workflow