70-39
Cisco ASA 5500 Series Configuration Guide using ASDM
Chapter70 Configuring Dynamic Access Policies
Guide to Creating DAP Logical Expressions using LUA
CheckAndMsg(value, “<message string if value is true>”, “<message string if value if
false>”)
Be aware of the following when creating CheckAndMsg functions:
CheckAndMsg returns the value passed in as its first argument.
Use the EVAL function as the first argument if you do not want to use string comparison. For
example:
(CheckAndMsg((EVAL(...)) , "true msg", "false msg"))
CheckandMsg returns the result of the EVAL function and the security appliances uses it to
determine whether to select the DAP record. If the record is selected and results in termination, the
security appliance displays the appropriate message.
Checking for a Single Antivirus Program
This example checks if a single antivirus program, in this case McAfee, is installed on the user PC, and
displays a message if it is not.
(CheckAndMsg(EVAL(endpoint.av[“McAfeeAV”].exists,"NE","true"),"McAfee AV was not
found on your computer", nil))
Checking for Antivirus Definitions Within the Last 10 Days
This example checks antivirus definitions within the last 10 days (864000 sec), in particular the last
update of the McAfee AV dat file, and displays a message to a user lacking the appropriate update that
they need an antivirus update:
((CheckAndMsg(EVAL(endpoint.av[“McAfeeAV”].lastupdate,"GT","864000","integer"),"AV
Update needed! Please wait for the McAfee AV till it loads the latest dat file.",nil) ))
Checking for a Hotfix on the User PC
This example checks for a specific hotfix. If a user does not have the hotfix on their PC, a message that
it is not installed displays.
(not CheckAndMsg(EVAL(endpoint.os.windows.hotfix["KB923414"],"EQ","true"),nil,"The
required hotfix is not installed on your PC."))
or you could define it this way (which makes more sense):
(CheckAndMsg(EVAL(endpoint.os.windows.hotfix["KB923414"],"NE","true"),"The required hotfix
is not installed on your PC.",nil))
You can build the expression in this example because the debug dap trace returns:
endpoint.os.windows.hotfix["KB923414"] = "true";
Checking for Antivirus Programs
You can configure messages so that the end user is aware of and able to fix problems with missing or not
running AVs. As a result, if access is denied, the ASA collects all messages for the DAP that caused the
"terminate" condition and displays them in the browser on the logon page. If access is allowed, the ASA
displays all messages generated in the process of DAP evaluation on the portal page.
The following example shows how to use this feature to check on the Norton Antivirus program.