Skip to main content
Skyhigh Security

Write a Rule in the Code of Your Web Policy

To add a new rule of your own to your web policy, you can write it in the underlying code.

WARNING: Improperly modifying this code can severely damage the web policy functions. Be sure to understand the code before you add anything to it or change it otherwise.

  1. On the user interface for Secure Web Gateway, select Policy > Web Policy > Policy.

  2. On the Web Policy page, select the rule set where you want to insert your new rule. Select it from the policy tree on the left. For example, expand Global Block and select Global Block Lists.

    clipboard_e517538beb2f86514d72bd99c6b39b799.png

  3. In the configuration area on the right, click the three dots at the end of the row for the rule set that you selected, for example, Global Block Lists.

    A menu with actions appears.

    clipboard_e3f81110b40f7a7d80548dedbb7e15298.png
     
  4. Under Add Custom Rule, select Via Policy Code.

    A row with fields for the new rule is inserted after the last of the already existing rules.

    clipboard_e94605b936f0ab59b067f59d3f10a9484.png
     
  5. In the Rule Name field, type a name for the new rule. Optionally, click Add Description and in the field that appears, type a plain-text description of the new rule.
     
  6. Click Edit.

    A field for entering code appears under the rule name and description.

    clipboard_e9084cd9ebf3b57e3cdf0deb22a4e4aba.png
     
  7. Type the code for the new rule in this field.

    NOTE: The code shown here below is an example. It is taken from an already existing rule. For your new rule, use your own code, not this sample code.

    clipboard_ec9a78bf9b0f2dc62ee4addbe4a02cd8b.png
     
  8. Click Save.

You have now added a rule of your own to the code that underlies your web policy. 

The addition takes effect after you have also saved it using the Publish option.

  • Was this article helpful?