search cancel

Create policies using the CLI Inline Command 

book

Article ID: 253056

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

To create policies using the CLI, you can use the inline policy command. This command either creates a new policy file or, if the specified file already exists, overwrites an existing policy file. You cannot edit an existing policy file using this command.

Resolution

To create policy files:

  1. At the (config) command prompt, enter the following command: SGOS#(config) inline policy file end-of-input-marker

where file specifies the type of policy you want to define: Central (Central policy file), Forward (Forward policy file), or local (local policy file).
end-of-file-marker—Specifies the string that marks the end of the current inline command input; eof usually works as a string. The CLI buffers all input until you enter the marker string. 

     2. Define the policy rules using CPL (refer to the Content Policy Language Reference).
         
        Enter each line and press Enter. To correct mistakes on the current line, use Backspace. If a mistake has been made in a line that has already been terminated by Enter, exit the inline policy command by typing Control+C to prevent the file from being saved.

     3.  Enter the eof marker to save the policies and exit the inline mode. For more information on the inline command, refer to the Command Line Interface Reference).

To load policy files:

At the (config) command prompt, enter the following commands:
      SGOS#(config) policy {forward-path | local-path | central-path} url
      SGOS#(config) load policy {forward | local | central}

The appliance compiles and installs the new policy. A warning might occur if the new policy causes conflicts. If a syntax error is found, the appliance displays an error message. For information about these messages, refer to the Content Policy Language Reference. Correct the error, and then reload the file.