ADC

Configuring NetScaler appliance for audit logging

Warning:

Classic policy expressions and its usage are deprecated (discouraged from use but still supported) from NetScaler 12.0 build 56.20 onwards and as an alternative, Citrix recommends you to use advanced policies. For more information, see Advanced Policies.

Audit logging displays status information from different modules so that an administrator can see event history in the chronological order. The main components of an Audit framework are ‘audit action’ and ‘audit policy’. ‘Audit action’ describes Audit Server configuration information whereas ‘audit policy’ links a bind entity to an ‘audit action’. The audit policies use the ‘Classic Policy Engine’(CPE) framework or Progress Integration (PI) framework to link ‘audit action’ to ‘system global bind entities’.

However, the policy frameworks differ from each other in binding audit log policies to global entities. Previously, the audit module supported only classic and advanced policy expressions. Currently, using the advanced expression you can bind audit log policies only to System global entities.

Note

When you bind a policy to global entities, you must bind it to a system global entity of the same expression. For example, you can’t bind a classic policy to an advanced global entity or bind an advanced policy to a classic global entity.

Also, you can’t bind both classic audit log policy and advanced audit log policy to a load balancing virtual server.

Configuring audit log policies in a classic policy expression

Configuring audit logging in classic policy consists of the following steps:

  1. Configuring an audit log action. You can configure an audit action for different servers and for different log levels. ‘Audit action’ describes Audit Server configuration information whereas ‘audit policy’ links a bind entity to an ‘audit action’. By default, the SYSLOG uses a user data protocol (UDP) for data transfer and NSLOG uses only TCP to transfer log information to the log servers. TCP is more reliable than UDP for transferring complete data. When using TCP for SYSLOG, you can set the buffer limit on the NetScaler appliance to store the logs. After the buffer limit is reached, the logs are sent to the SYSLOG server.
  2. Configuring audit log policy. You can configure either SYSLOG policies to log messages to a SYSLOG server or NSLOG policy to log messages to an NSLOG server. Each policy includes a rule that is set to true or ns_true for the messages to be logged, and a SYSLOG or NSLOG action.
  3. Binding audit log policies to global entities. You must globally bind the audit log policies to global entities such SYSTEM, VPN, NetScaler AAA and so on. You can do it to enable logging of all NetScaler system events. By defining the priority level, you can set the evaluation order of the audit server logging. Priority 0 is the highest and is evaluated first. The higher the priority number, the lower is the priority of evaluation.

Each of these steps is explained in the following sections.

Configuring audit log action

To configure SYSLOG action in advanced policy infrastructure by using the CLI.

Note

The NetScaler appliance allows you to configure only one SYSLOG action to SYSLOG server IP address and port. The appliance does not allow you to configure multiple SYSLOG actions to the same server IP address and port.

A syslog action contains a reference to a syslog server. It specifies which information to log and mentions how to log that information.

At the command prompt, type the following commands to set the parameters and verify the configuration:

-  add audit syslogAction <name> <serverIP> [-serverPort <port>] -logLevel <logLevel> [-dateFormat ( MMDDYYYY | DDMMYYYY )] [-transport ( TCP | UDP )]`
-  show audit syslogAction [<name>]

<!--NeedCopy-->

To configure NSLOG action in advanced policy infrastructure by using the CLI.

An ns log action contains a reference to a nslog server. It specifies which information to log and mentions how to log that information.

At the command prompt, type the following commands to set the parameters and verify the configuration:

-  add audit nslogAction <name> <serverIP> [-serverPort <port>] -logLevel <logLevel> [-dateFormat ( MMDDYYYY | DDMMYYYY )]
-  show audit nslogAction [<name>]
<!--NeedCopy-->

Configuring audit log policies

Configure audit log Policies in classic Policy infrastructure by using the CLI.

At the command prompt, type:

-  add audit syslogpolicy <name> <-rule> <action>
-  add audit nslogpolicy <name> <-rule> <action>
<!--NeedCopy-->

Binding audit syslog policies to audit syslog global

Bind audit log policy in advanced policy framework by using the CLI.

At the command prompt, type:

bind syslogGlobal -policyName <policyName> -priority <priority>

unbind syslogGlobal -policyName <policyName> -priority <priority>

Bind audit log policy in classic policy framework by using the CLI.

At the command prompt, type:

bind systemglobal <policy Name> <Priority>

unbind systemglobal <policy Name> <Priority>

Configuring audit log policies using advanced policy expression

Configuring audit logging in advanced policy consists of the following steps:

  1. Configuring an audit log action. You can configure an audit action for different servers and for different log levels. ‘Audit action’ describes Audit Server configuration information whereas ‘audit policy’ links a bind entity to an ‘audit action’. By default, SYSLOG uses a user data protocol (UDP) for data transfer and NSLOG uses only TCP to transfer log information to the log servers. TCP is more reliable than UDP for transferring complete data. When using TCP for SYSLOG, you can set the buffer limit on the NetScaler appliance to store the logs. After the buffer limit is reached, the logs are sent to the SYSLOG server.
  2. Configuring audit log policy. You can configure either SYSLOG policies to log messages to a SYSLOG server or NSLOG policy to log messages to an NSLOG server. Each policy includes a rule that is set to true or ns_true for the messages to be logged, and a SYSLOG or NSLOG action.
  3. Binding audit log policies to global entities. You must globally bind the audit log policies to SYSTEM global entity to enable logging of all NetScaler system events. By defining the priority level, you can set the evaluation order of the audit server logging. Priority 0 is the highest and is evaluated first. The higher the priority number, the lower is the priority of evaluation.

Note

The NetScaler appliance evaluates all the policies that are bind to true.

Configuring audit log action

To configure syslog action in advanced policy infrastructure by using the CLI.

At the command prompt, type the following commands to set the parameters and verify the configuration:

-  add audit syslogAction <name> <serverIP> [-serverPort <port>] -logLevel <logLevel> [-dateFormat ( MMDDYYYY | DDMMYYYY )] [-transport ( TCP | UDP )]
-  show audit syslogAction [<name>]
<!--NeedCopy-->

Configure the NSLOG action in advanced policy infrastructure by using the CLI:

At the command prompt, type the following commands to set the parameters and verify the configuration:

-  add audit nslogAction <name> <serverIP> [-serverPort <port>] -logLevel <logLevel> [-dateFormat ( MMDDYYYY | DDMMYYYY )]
-  show audit nslogAction [<name>]
<!--NeedCopy-->

Configuring audit log policies

To add a syslog audit action by using the CLI.

Note

The -managementlog and -mgmtloglevel parameters are only available in NetScaler 13.1-37.199 and later FIPS releases.

At the command prompt, type:

    add audit syslogAction <name> (<serverIP> | ((<serverDomainName>[-domainResolveRetry <integer>])
    | -lbVserverName <string>))[-serverPort <port>] -logLevel <logLevel> [-managementlog <managementlog> ...] ... [-mgmtloglevel <managementloglevel> ...][-dateFormat <dateFormat>]
     [-logFacility <logFacility>][-tcp ( NONE | ALL )] [-acl ( ENABLED | DISABLED )]
    [-timeZone ( GMT_TIME | LOCAL_TIME )][-userDefinedAuditlog ( YES | NO )]
     [-appflowExport ( ENABLED | DISABLED )] [-lsn ( ENABLED | DISABLED )][-alg ( ENABLED | DISABLED )]
    [-subscriberLog ( ENABLED | DISABLED )][-transport ( TCP | UDP )] [-tcpProfileName <string>][-maxLogDataSizeToHold]
<!--NeedCopy-->

Example

    > add audit syslogaction audit-action1 10.102.1.1 -loglevel INFORMATIONAL -dateformat MMDDYYYY
    > add audit nslogAction nslog-action1 10.102.1.3 -serverport 520 -loglevel INFORMATIONAL -dateFormat MMDDYYYY
    > add audit syslogpolicy syslog-pol1 TRUE audit-action1
    > add audit nslogPolicy nslog-pol1 TRUE nslog-action1
    > bind system global nslog-pol1 -priority 20
<!--NeedCopy-->

Add a nslog audit action by using the CLI.

At the command prompt, type:

    add audit nslogAction <name> (<serverIP> | (<serverDomainName>[-domainResolveRetry <integer>])) [-serverPort <port>]       -logLevel <logLevel> ... [-dateFormat <dateFormat>][-logFacility <logFacility>] [-tcp ( NONE | ALL )][-acl ( ENABLED | DISABLED )] [-timeZone ( GMT_TIME | LOCAL_TIME )][-userDefinedAuditlog ( YES | NO )][-appflowExport ( ENABLED | DISABLED )] [-lsn ( ENABLED | DISABLED )][-alg ( ENABLED | DISABLED )] [-subscriberLog ( ENABLED | DISABLED )]`
<!--NeedCopy-->

Binding audit log policies to global entities

Bind the syslog audit log policy in advanced policy framework by using the CLI.

At the command prompt, type:

bind audit syslogGlobal <policyName> [-globalBindType <globalBindType

unbind audit syslogGlobal <policyName>[-globalBindType <globalBindType>]

Configuring audit log policy by using the GUI

  1. Navigate to Configuration > System > Auditing > Syslog.
  2. Select Servers tab.
  3. Click Add.
  4. In the Create Auditing Server page, populate the relevant fields, and click Create.
  5. To add the policy, select the Policies tab, and click Add.
  6. In the Create Auditing Syslog Policy page, populate the relevant fields, and click Create.
  7. To bind the policy globally, select Advanced Policy Global Bindings from the drop-down list. Select the best_syslog_policy_ever policy. Click Select.
  8. From the drop-down list, select the bind point as SYSTEM_GLOBAL and click Bind, and then click Done.

Configuring policy-based logging

You can configure policy-based logging for rewrite and responder policies. Audit messages are then logged in a defined format when the rule in a policy evaluates to TRUE. To configure policy-based logging, you configure an audit-message action that uses advanced policy expressions to specify the format of the audit messages. And associate the action with a policy. The policy can be bound either globally or to a load balancing or content switching virtual server. You can use audit-message actions to log messages at various log levels, either in syslog format only or in both syslog and new nslog formats

Prerequisites

  • User Configurable Log Messages (userDefinedAuditlog) option is enabled for when configuring the audit action server to which you want to send the logs in a defined format.
  • The related audit policy is bound to system global.

Configuring an audit message action

You can configure audit message actions to log messages at various log levels, either in syslog format only or in both syslog and new ns log formats. Audit-message actions use expressions to specify the format of the audit messages.

Create an audit message action by using the CLI

At the command prompt, type:

add audit messageaction <name> <logLevel> <stringBuilderExpr> [-logtoNewnslog (YES|NO)]
<!--NeedCopy-->
add audit messageaction log-act1 CRITICAL '"Client:"+CLIENT.IP.SRC+" accessed "+HTTP.REQ.URL'
<!--NeedCopy-->

Configure an audit message action by using the GUI

Navigate to System > Auditing > Message Actions, and create the audit message action.

Binding audit message action to a policy

After you’ve created an audit message action, you must bind it to a rewrite or responder policy. For more information about binding log message actions to a rewrite or responder policy, see Rewrite or Responder.

Configuring NetScaler appliance for audit logging