To customize both the appearance and content of messages that are displayed to users, you can upload HTML files to the Sophos UTM.
As a guide, Sophos provides several sample templates. These templates show you how to use variables that can dynamically insert information for each notification. For example, if a file is blocked because it contains a virus, you can include a variable that automatically inserts the name of the virus that was blocked.
You can either use the sample templates as a basis for your custom messages and notifications or upload your own HTML files. Before you can deploy a custom template, you must modify it in an HTML editor and then upload it to the UTM.
For more about downloading the sample templates and uploading custom templates to the UTM, see the "Web Templates" section of the UTM documentation. The following sections are covered:
Applies to the following Sophos products and versions Sophos UTM
Each of the web templates provided by Sophos supports the use of variables to help customize the pages that are displayed to users. Some of the variables are available for use in all templates, while others are only valid within certain templates.
To download the sample templates and images, click the link below, and save the .zip file:
Note: If you are uploading your own HTML files, you must use the template-specific variables in the same context that they are used in the sample templates supplied by Sophos.
These variables can be used in all templates and cause the following to be displayed in messages:
<img src="<?company_logo?>" border="0" /> <img src="<?image_path?>/custom_image.jpg" border="0" /> <p class="customClass"><?admin_message?> <?admin_contact?>
Use the content block variables to create custom block pages that notify users about various types of restricted content. Variables determine the content for a particular block message. The sample template (block-template.html) shows you how to use variables to customize specific block types. You can customize the following message types:
These variables are available for a content block template:
<?report?> : This variable contains additional details about the reason for the block.These details are only available in English (for example,"Games is blocked"). Because the <?report?> variable is re-used for all block types, it is recommended that you further customize the messages by placing specific variables within "if" sections that are reserved for each block type (see below).
You should only use <?report?> if the messages to be displayed are English-only, and you want your messages to look similar to those that the UTM shows by default (when a customized template is not uploaded).
Notice the placement of the <?override_url?> variable within the <?override_enabled?> section below:
<?override_enabled?> <p>Insert explanation here</p> <span class="url"><a href="<?override_url?>">Click to override</a></span><?override_enabled_end?>
When the UTM processes a template in order to display a user message, it replaces any template variables with the relevant value. Templates can contain "if" variables that make up sections like the ones shown below.
Notice that each section has an opening and a closing variable. In the event of a block, only the contents of the section matching that particular block type are displayed to the user. The remaining sections remain hidden.
For example, if a user is blocked while attempting to download a file with an unacceptable MIME type, only the contents of the <?if_mimetype?> section are displayed (your custom message about MIME types). If a matching section also supports the use of a nested variable, the value of that variable (for example, <?application_name?>) is displayed along with any custom text.
The following "if" sections can be used to specify different block reasons. In most cases, it is recommended that you insert these sections for each type of block message instead of using the <?report?> variable described in the previous section.
<?if_application?> <?application_name?> (The name of the blocked application)<?if_application_end?>
<?if_virus?> <?virus_name?> (The name of the virus detected)<?if_virus_end?>
<?if_tag?> <?tag?> (The name of the tag used to tag a website)<?if_tag_end?>
<?if_tag?> <?quota_time_left?> (Remaining quota time in minutes) <?quota_time_select?> (Dropdown to select additional slices of quota time)<?if_tag_end?>
For an example of how to use variables and "if" conditions, see block-template.html.
Note – These codes can only be used for the "Surf Protection" type of block notifications.
If a message is blocked for the reason "Surf Protection" (the requested site belongs to a restricted category), you can customize the block messages so that users receive reason for the block.The blocked category is stored in the<?category?> variable (as shown below).
103 : Adult Topics
The Download/Scan template (downloader-template.html) is used to present progress results to users and indicate when a download or scan is complete. The contents of this template modify the appearance of the Download Manager.
A download/scan template must contain three sections:
These are the three stages required to download a file; however, if a file is found to contain a virus during the scanning stage, a "Virus Detected" block message is displayed to the user, and processing does not continue to the third stage.
See downloader-template.html for an example of how to use these sections.
These variables are available for the Download/Scan template:
Use the Authentication template (auth-template.html) to create custom pages that prompt users when they are accessing the system.
There are two different authentication pages:
The following variables are available for use in an authentication template:
<div id="error" style="color: red; font-weight: bold"></div>
For more information, see auth-template.html. Note for Web Application Firewall: The Authorization error page is only displayed for certain types of 401 and 403 responses, namely:
In case of a failing form authentication we redirect back to the login form (302). This works as designed so that the user can try logging in again.
Use the Error template (error-template.html) to create custom error messages that are displayed to users.
These variables are available when customizing the Error template:
For more information, see error-template.html.
If you've spotted an error or would like to provide feedback on this article, please use the section below to rate and comment on the article. This is invaluable to us to ensure that we continually strive to give our customers the best information possible.
Every comment submitted here is read (by a human) but we do not reply to specific technical questions. For technical support post a question to the community. Or click here for new feature/product improvements. Alternatively for paid/licensed products open a support ticket.