跳转到主内容

Native FPolicy 文件阻止

Views:
1,047
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
nas
Last Updated:

​ ​ ​  

适用于

ONTAP 9

回答

概述:

某些管理员希望制定策略,不允许将某些文件类型存储在文件服务器上,这基本上是要求提供文件筛选功能。这些可能是音乐、视频或其他此类文件类型。对此类文件的扫描可以基于:
基于文件扩展名(Data ONTAP 中的原生支持)- 例如,阻止所有匹配 *.mp3 的文件。这是一种不太可靠的方法。它不需要对文件进行数据访问。基于文件扩展名的文件阻止原生支持不需要连接到任何外部 FPolicy 服务器。

基于文件 magic 签名(需要外部服务器)- 例如,阻止所有 magic 和签名与 mp3 格式匹配的文件。由于执行了签名匹配,因此这种方法更准确,类似于防病毒扫描程序检测病毒的方式。

有关详细信息,请参见以下链接:

针对 ONTAP 9 的 FPolicy 文件拦截

管理员启用针对 CREATE、OPEN、CLOSE 和 RENAME 请求的事件。当 FPolicy 服务器收到这些事件触发器的通知时,它可以根据这两种机制(文件扩展名或文件签名)之一运行检查,并在找到匹配项时拒绝请求。

示例配置:

请执行以下步骤以配置本机 FPolicy。

  1. 配置策略事件:

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. 配置策略:

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::> set advanced

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
Is Monitoring of Objects with No Extension Enabled: false

  1. 启用策略: 无法为单个 vserver 下的多个策略分配相同的序列号,但对于不同 vserver 中的策略,可以使用先前的 vserver 中使用的相同序列号。

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. 从 Windows 客户端使用上述策略的测试结果:

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

 有关详细信息,请参见适用于您的 ONTAP 版本的 CIFS 和 NFS 审核指南。

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.