Using CLI
    • PDF

    Using CLI

    • PDF

    Article Summary

    Note: The GWCLI (Command Line Tool) will be excluded as standard from Release 10 of the Embedded Engine. Please contact support@glasswall.com should you require any additional support.

    The Glasswall CLI tool is a command line wrapper around the CDR Embedded Engine.

    The CLI tool can be used to process files and verify the output for all API functions available within the Glasswall CDR library. The results can be examined and compared to give you a clear understanding of any issues or unwanted content within files and any action carried out by the Glasswall CDR engine.

    Content Management Policy File

    See an example policy file below. A complete policy file and XSD can be found within the Glasswall distribution package.

    <?xml version="1.0" encoding="UTF-8"?>
    <config>
    
      <pdfConfig>    
        <acroform>sanitise</acroform>
        <metadata>sanitise</metadata>
        <javascript>sanitise</javascript>
        <actions_all>sanitise</actions_all>
        <embedded_files>sanitise</embedded_files>
        <internal_hyperlinks>sanitise</internal_hyperlinks>
        <external_hyperlinks>sanitise</external_hyperlinks>
        <value_outside_reasonable_limits>sanitise</value_outside_reasonable_limits>
      </pdfConfig>
      
      <wordConfig>
        <macros>sanitise</macros>
        <metadata>sanitise</metadata>
        <embedded_files>sanitise</embedded_files>
        <dynamic_data_exchange>sanitise</dynamic_data_exchange>
        <review_comments>sanitise</review_comments>
        <internal_hyperlinks>sanitise</internal_hyperlinks>
        <external_hyperlinks>sanitise</external_hyperlinks>
      </wordConfig>
      
      <pptConfig>
        <macros>sanitise</macros>
        <metadata>sanitise</metadata>
        <embedded_files>sanitise</embedded_files>
        <review_comments>sanitise</review_comments>
        <internal_hyperlinks>sanitise</internal_hyperlinks>
        <external_hyperlinks>sanitise</external_hyperlinks>
      </pptConfig>
      
      <xlsConfig>
        <macros>sanitise</macros>
        <metadata>sanitise</metadata>
        <embedded_files>sanitise</embedded_files>
        <dynamic_data_exchange>sanitise</dynamic_data_exchange>
        <review_comments>sanitise</review_comments>
        <internal_hyperlinks>sanitise</internal_hyperlinks>
        <external_hyperlinks>sanitise</external_hyperlinks>
        <connections>sanitise</connections>
      </xlsConfig>  
      
      <tiffConfig>
        <geotiff>sanitise</geotiff>
      </tiffConfig>  
    
      <svgConfig>
        <scripts>sanitise</scripts>
        <foreign_objects>sanitise</foreign_objects>
        <hyperlinks>sanitise</hyperlinks>
      </svgConfig>
    	
      <webpConfig>
        <metadata>sanitise</metadata>
      </webpConfig>
        
    </config>
    
    

    The possible settings for each element is described in the table below.

    TypeValueNotes
    contentManagementFlagsanitiseConfigures Glasswall to remove or clean document element types associated with this content management switch type from any document being processed. This removal will be logged in analysis reports as a ‘sanitisation item’
    allowConfigures Glasswall to leave document element types associated with this content management switch type in any document being processed.
    disallowConfigures Glasswall to raise an issue if document element types associated with this content management flag are found within any document being processed.

    Running the CLI tool

    The CLI tool will return 0 on success and 1 otherwise.

    The are several processing modes which are documented in the CLI Documentation. To get started, specifying an input and output directory will produce an XML report and a regenerated clean file.

    Open a terminal within the working directory containing the CLI tool, Glasswall library files, and config files, and run the following command:

    gwcli -i <path to input directory> -o <path to output directory> -c policies.xml
    

    The output files are located in the location specified. A process log is also produced with each run, summarising the outcome.


    Was this article helpful?