Skip to main content
NetApp Knowledge Base

Native FPolicy File Blocking

Views:
13,471
Visibility:
Public
Votes:
20
Category:
ontap-9
Specialty:
NAS
Last Updated:

 

Applies to

ONTAP 9

Answer

Overview:

Certain administrators want to have policies that do not allow certain file types to be stored on the file server basically requesting for file filter request. These could be music, video or other such file types. The scan for such files can be either based on:
Based on file extensions (native support in Data ONTAP) - for example, block all files matching *.mp3. This is a less reliable approach. It does not need data access to files. Native support for file blocking based on file extensions does not require a connection to any external FPolicy server.

Based on file magic signature (requires external server) - for example, block all files with magic and signature matching mp3 format. This is more accurate as signature matching is done, similar to what anti-virus scanners do to detect viruses.

For more information, see the following link:

FPolicy file blocking for ONTAP 9

The administrator enables event for CREATE, OPEN, CLOSE and RENAME requests. When the FPolicy server is notified of these event triggers, it can run checks based on either of the two mechanisms (file extension or file signature) and DENY requests if match is found.

Sample Configuration:

Perform the following steps to configure a Native FPolicy.

  1. Configure the Policy Event:

Cluster::> vserver fpolicy policy event create -vserver SvmName -event-name Event -protocol cifs -file-operations create,open,rename
 

Cluster::> vserver fpolicy policy event show -vserver SvmName -event-name Event -instance
                                        Vserver: SvmName
                                          Event: Event
                                       Protocol: cifs
                                File Operations: create, open, rename
                                        Filters: -
                   Is Volume Operation Required: false

  1. Configure Policy:

Cluster::> vserver fpolicy policy create -vserver SvmName -policy-name blockext -events Event -engine native -is-mandatory true -allow-privileged-access no -is-passthrough-read-enabled false
 

Cluster::> vserver fpolicy policy show -vserver SvmName -instance 
                                         Vserver: SvmName
                                          Policy: blockext
                               Events to Monitor: Event
                                  FPolicy Engine: native
                 Is Mandatory Screening Required: true
                         Allow Privileged Access: no
                 User Name for Privileged Access: -
                     Is Passthrough Read Enabled: false
                          Configure Policy Scope:

Cluster::> vserver fpolicy policy scope create -vserver SvmName -policy-name blockext -file-extensions-to-include mp3,mp4,flv,wmv -shares-to-include "*" -is-file-extension-check-on-directories-enabled true
 

Cluster::> vserver fpolicy policy scope show -vserver SvmName -instance
                                         Vserver: SvmName
                                          Policy: blockext
                               Shares to Include: *
                               Shares to Exclude: -
                              Volumes to Include: -
                              Volumes to Exclude: -
                      Export Policies to Include: -
                      Export Policies to Exclude: -
                      File Extensions to Include: mp3, mp4, flv, wmv
                      File Extensions to Exclude: -
  Is File Extension Check on Directories Enabled: true

  1. Enable Policy: Cannot assign same sequence number to multiple policies under the single vserver, but for the policy in different vserver same sequence numbers which were used in previous vserver can be used.

Cluster::> vserver fpolicy enable -vserver SvmName -policy-name blockext -sequence-number 1

Cluster::> vserver fpolicy show -vserver SvmName
                      Sequence
Vserver  Policy Name  Number    Status  Engine
-------  -----------  --------  ------  ------
SvmName  blockext     1         on      native

Cluster::> event log show -time > 2m
Time                Node         Severity      Event
------------------- ------------ ------------- --------------------------
3/27/2017 10:35:34  cm2520n2-ams INFORMATIONAL mgmt.fpolicy.policy.enabled: FPolicy policy blockext is enabled on Vserver SvmName.

  1. Tests results using above policy from a Windows client:

Attempt to rename a file using mp3, mp4, flv, or wmv extension is Denied
Attempt to open a file with mp3, mp4, flv, or wmv extension is Denied
Attempt to delete a file with mp3, mp4, flv, or wmv extension is Denied
Attempt to copy a file with mp3, mp4, flv, or wmv extension to the share is Denied

 
For more information, see the CIFS and NFS Auditing Guide for your version of ONTAP.

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.