Create exception page with company logo and install exception page via CLI.
search cancel

Create exception page with company logo and install exception page via CLI.

book

Article ID: 170679

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

Creating exception page with company logo and install exception page via CLI.

Resolution

Step 1: Convert the logo picture to Base64. You can do this using a website such as https://codebeautify.org/image-to-base64-converter .

Step 2: Edit the HTML code and add the Base64 code within the body at the appropriate position.
Example:
<html>
<head>
<title>Access Denied</title>
</head>
<body>
<center>
<p><img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAAArCAYAAAAUjzg1AAAAGXRFWHRTb2Z0d2FyZQB
BZG9iZSBJbWFnZVJlYWR5ccllPAAADZ1JREFUeNrsXAl0VcUZnhA22UIR2cpeigjIaqFlkYAQsIiUpaJQBSEoGgGpKaVwbKVyS
pVFFLAsamkrRQ1UFuGUrYCAUCCyymbAICjQsoaQAElIvy/5L0wmc+97CUmI5f7n/Oe+N3e2O/Pdf533lCqklLqqaW1wOniQ8umO
oCKFcVI/qFW7V8sRCSPxcTx4l79NdwYVLUQALIlLFfn
DBTfDwalNdgoeHMgwHdc/qHALkgxjSTjJAPHYV2WozMp8Kqpi1qu6p4Vv3Vrf/UkT+Ieh
4gLFA7TU6gX3E54OvTdwWMGih5LIvSkh53mRzak1TJbwCEa/0l9+mWwaiBkkFa/rY5XLxmxqQYR2TYhPYm1R/jfoyt8a/1VgGE
/l8i+xSQ/ifAAOPs9qE/RIvAAAAAAElFTkSuQmCC'/></p>
<p>
font face="Arial, Helvetica, sans-serif" size="4" color="Red"><b>You are about to access the Internet from the Example Company Network
<p>
<font face="Arial, Helvetica, sans-serif" size="4" color="Red">INTERNET USAGE IS MONITORED AND LOGGED.</font>
<p>
<font face="Arial, Helvetica, sans-serif" size="3" color="Red"><b> Your IP address: $(client.address)
<br>Your username: $(user.name)</b></font>
<p>
<font face="Arial, Helvetica, sans-serif" size="4" color="red">YOU HAVE BEEN DENIED ACCESS TO THIS SITE. PLEASE READ OUR
SECURITY POLICY AT http://intranet.example.com/up.html
<p>
For any comments email <A href='mailto:[email protected]?subject=Barred web page $(url), IP address: $(client.address), User ID:
$(user)'>Customer Service Center</a></font>
<p>
</center>
</body>
</html>
 

Step 3: Install the new HTML code "exception page" via cli.

The following commands create a user-defined exception page that returns a HTTP status code of 403 to the client, and uses the same HTML content as described in the tech brief linked previously in this article.

Blue Coat SG#
Blue Coat SG# config terminal
Enter configuration commands, one per line.  End with CTRL-Z.
Blue Coat SG#(config)exceptions
Blue Coat SG#(config exceptions)create my_exception
  ok
Blue Coat SG#(config exceptions)edit my_exception

In the following sample, the command "inline format EOT" specifies the content of your exception page. The "EOT" marker tells SGOS this is the end-of-text, and must be at the beginning of its own line for SGOS to detect that you're finished entering the exception page content.  It's also case-sensitive.

Blue Coat SG#(config exceptions user-defined.my_exception)inline format EOT
<html>
<head>
<title>Access Denied</title>
</head>
<body>
<center>
<p><img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAAArCAYAAAAUjzg1AAAAGXRFWHRTb2Z0d2FyZQB
BZG9iZSBJbWFnZVJlYWR5ccllPAAADZ1JREFUeNrsXAl0VcUZnhA22UIR2cpeigjIaqFlkYAQsIiUpaJQBSEoGgGpKaVwbKVyS
pVFFLAsamkrRQ1UFuGUrYCAUCCyymbAICjQsoaQAElIvy/5L0wmc+97CUmI5f7n/Oe+N3e2O/Pdf533lCqklLqqaW1wOniQ8umO
oCKFcVI/qFW7V8sRCSPxcTx4l79NdwYVLUQALIlLFfn
DBTfDwalNdgoeHMgwHdc/qHALkgxjSTjJAPHYV2WozMp8Kqpi1qu6p4Vv3Vrf/UkT+Ieh
4gLFA7TU6gX3E54OvTdwWMGih5LIvSkh53mRzak1TJbwCEa/0l9+mWwaiBkkFa/rY5XLxmxqQYR2TYhPYm1R/jfoyt8a/1VgGE
/l8i+xSQ/ifAAOPs9qE/RIvAAAAAAElFTkSuQmCC'/></p>
<p>
font face="Arial, Helvetica, sans-serif" size="4" color="Red"><b>You are about to access the Internet from the Example Company Network
<p>
<font face="Arial, Helvetica, sans-serif" size="4" color="Red">INTERNET USAGE IS MONITORED AND LOGGED.</font>
<p>
<font face="Arial, Helvetica, sans-serif" size="3" color="Red"><b> Your IP address: $(client.address)
<br>Your username: $(user.name)</b></font>
<p>
<font face="Arial, Helvetica, sans-serif" size="4" color="red">YOU HAVE BEEN DENIED ACCESS TO THIS SITE. PLEASE READ OUR
SECURITY POLICY AT http://intranet.example.com/up.html
<p>
For any comments email <A href='mailto:[email protected]?subject=Barred web page $(url), IP address: $(client.address), User ID:
$(user)'>Customer Service Center</a></font>
<p>
</center>
</body>
</html>
EOT               

  ok

Blue Coat SG#(config exceptions user-defined.my_exception)http-code 403
  ok
Blue Coat SG#(config exceptions user-defined.my_exception)exit
Blue Coat SG#(config exceptions)exit
Blue Coat SG#(config)exit
Blue Coat SG#

If using Blue Coat Reporter, change http-code 403 to an appropriate code if needed so Reporter reports the correct verdict.

Implementing this CLI results in a custom exception page called "my_exception" in the ProxySG configuration.

Once the Custom exception page is created in the CLI, if the Managemant Console GUI was already open, a new browser session is needed for java to dispay the new exception page as an option in the VPM.

Step 4:To select the Excpetion page to be used in the VPM rule:

    1.Right Click the Action field of the rule to reference the new Exception
    2.Click Set
    3.Click New
    4.Select "Return Exception" object
    5.Name the customer exception object appropriately
    6.Click "User-defined excpetion"
    7.Click dropdown
    8.Select the new custom exception just created in CLI
    9.Click OK
    10.Install Policy

Users should now see the custom excpetion page created in CLI when block on that rule.