Skip to main content

Check out Interactive Visual Stories to gain hands-on experience with the SSE product features. Click here.

Skyhigh Security

About the Web Policy Code

You can work on the code that underlies the rules and rule sets of your web policy to create, edit, or delete any of them. 

WARNING: If you modify the web policy code incorrectly, the web policy functions may fail. Make sure that you understand the code before making changes to it.

 

Web Policy Code View

To view the web policy code:

  1. Login in to Secure Web Gateway with your tenant, and go to Policy > Web Policy > Policy.
    The Web Policy page appears.

  2. From the navigation panel, select the rule set for which you want to view the code. For example, select Global Block > Global Block Lists.

    clipboard_e148b5a97f4dd3f177ea17dbf05464b73.png
    The selected rule set appears together with the rules in the configuration area.

  3. Click the three dots menu next to the specific rule, then select View Policy Code.

    clipboard_e30c7f0ea3a9b6489c3fe8d30cc7d9e89.png

    The web policy code for the selected rule set appears.

    clipboard_ef8adb2452993ba96b607c865b0115360.png

How the Code Enables a Web Policy

The web policy code for Secure Web Gateway contains rules (IF-THEN statements) that address various web threats and serve as the framework for your web policy.

A general rule for a web threat policy might read as follows:

  • If a threat from web usage is identified, take action to counter it.

A rule that addresses a specific threat (malware-infected file) might read as follows:

  • If a file sent from a website in response to a user's request contains malware, block the response. This rule is represented in the web policy code by the following IF-THEN statement:
IF MWG.Body.Infected THEN MWG.Block

This code prevents a user from accessing malware-infected files using the following code items: 

  • Function: MWG.Body.Infected

  • Procedure: MWG.Block

For more information about some important web policy code elements used by Secure Web Gateway, see Web Policy Code Elements

When a website responds to a user's request, it sends the file as the body of the response. Secure Web Gateway scans the response body based on the rule defined in your web policy, and if the body (file) is infected, it is not sent to the user.

You can also use the following IF-THEN statements in reference to the above mentioned code items:

  • If a specific function returns a value (indicating a web threat), then a suitable procedure is run.
  • IF function returns critical value THEN execute procedure

Several code items are prefixed with MWG because they were created for for Secure Web Gateway Cloud based on similar items from the Secure Web Gateway (formerly McAfee Web Gateway) on-prem web security product.

 

  • Was this article helpful?