6.5. File Control

The File Control feature in cOS Core performs checks on files passing through the firewall. The transfer could be done using any of the following protocols:

File Control Setup

The recommended way of performing file control is using an IP Policy object. The set steps are the following:

  1. Create a new File Control Profile object and adjust its properties accordingly.

  2. Associate the profile with an IP Policy that triggers on the target traffic. The Service property of the IP policy must be set to a service object which has its Protocol property set to the targeted traffic type (for example, HTTP).

A File Control Policy can be used in combination with one or more other types of processing that is enabled on an IP policy. For example, an Anti-Virus Policy could be assigned and enabled on the same IP policy so that files are also scanned for malware.

File Control Profile Object Properties

A File Control Profile object has the following properties:

Example 6.49. File Control Setup with an IP Policy

In this example, internal HTTP clients will be downloading files from the Internet which will be checked using a File Control Policy so that files of the type .exe or .msi will be blocked. In addition, the MIME type of any downloaded files will be verified.

Command-Line Interface

A. Create a new Service object for inbound HTTP traffic:

Device:/> add Service ServiceTCPUDP my_http_service
			Type=TCP
			DestinationPorts=80
			Protocol=HTTP

B. Create an FileControlPolicy object:

Device:/> add Policy FileControlPolicy my_fc_policy
			FileListType=Block
			File=exe,msi
			VerifyContentMimeType=Yes

C. Create an IP Policy for HTTP traffic:

Device:/> add IPPolicy Name=my_http_policy
			SourceInterface=lan
			SourceNetwork=lannet
			DestinationInterface=wan
			DestinationNetwork=all-nets
			Service=my_http_service
			Action=Allow
			SourceAddressTranslation=NAT
			NATSourceAddressAction=OutgoingInterfaceIP
			FileControl=Yes
			FC_Mode=UsePolicy
			FC_Policy=my_fc_policy

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

A. Create a new Service object for inbound SMTP:

  1. Go to: Objects > Services > Add > TCP/UDP Service
  2. Now enter:
    • Name: my_http_service
    • Type: TCP
    • Destination: 80
    • Protocol: HTTP
  3. Click OK

B. Create a File Control Profile object:

  1. Go to: Policies > Firewalling > File Control > Add > File Control Profile
  2. Now enter:
    • Name: my_fc_profile
    • File Type Action: Block
    • File Types: exe.msi
    • Validate File Extension: Enabled
  3. Select OK

C. Create an IP Policy for HTTP traffic:

  1. Go to: Policies > Firewalling > Main IP Rules > Add > IP Policy
  2. Now enter:
    • Name: my_http_policy
    • Action: Allow
  3. Under Filter enter:
    • Source Interface: lan
    • Source Network: lannet
    • Destination Interface: wan
    • Destination Network: all-nets
    • Service: my_http_service
  4. Under Source Translation enter:
    • Address Translation: NAT
    • Address Action: Outgoing Interface IP
  5. Under File Control enter:
    • Enable File Control: ON
    • File Control Profile: my_fc_profile
  6. Click OK