How does ONTAP Native FPolicy determine a file extension
Applies to
- ONTAP 9
- Native FPolicy
- SMB/CIFS Protocol
Answer
Question
- How does ONTAP Native FPolicy determine the file extension when a file name contains one or more periods (
.)? - For example, what extensions are used for FPolicy matching for the following file names?
sample.txt
sample.tar.gz
sample
sample.
sample.カタカナ漢字
sample._→⇒㈵
Answer
- Native FPolicy performs file screening based on the file extension rather than the file contents.
- A period (
.) is not included in the extension configured in the FPolicy extension list.
Example1:
File name: sample.txt
Extension: txt
Example2:
File name: sample.tar.gz
Extension: gz
- When a file name contains multiple periods, such as
sample.tar.gz, Native FPolicy matches the portion after the last period as the extension. - Therefore the extension of file
sample.tar.gzisgzbut nottar.gz. - The
.itself is not part of the extension configured for FPolicy matching. - For files that do not have an extension, monitoring can be controlled by the following FPolicy scope option:
-is-monitoring-of-objects-with-no-extension-enabled {true|false}
The following behavior was verified in testing:
sample.txt->txt-
sample.tar.gz->gz sample
This file name does not have a file extension.
FPolicy provides the following scope option to control whether objects without an extension are monitored:
-is-monitoring-of-objects-with-no-extension-enabled {true|false}
sample.
Testing from a Windows SMB client confirmed that Windows did not allow a file name ending with a period (.) to be created.
Therefore, Native FPolicy extension matching for sample. could not be evaluated through the tested Windows SMB client.
sample.カタカナ漢字andsample._→⇒㈵
カタカナ漢字 and _→⇒㈵ could be configured as an extension and that the corresponding file operation was successfully blocked by Native FPolicy.
Note: This confirms the behavior for the tested character only. It does not establish that every Unicode, multibyte, special, or environment-dependent character is supported as an FPolicy extension.
Additional Information
- When an extension containing a period was configured, ONTAP returns the following error:
Error: "test,.test" is an invalid value for field "-file-extensions-to-include <file extension>"
