Skip to content

Comprehensive File Security SDK

Track file change, control file access in real time, transparent file encryption

Menu
  • Home
  • Solutions
  • Download
  • Contact

EaseFilter文件監控開發包

EaseFilter File Access Monitor SDK 允許您開發文件審計和文件監控Windows應用程序,實時監控文件變化和文件訪問,攔截文件I/O請求。可以捕獲文件打開、文件創建、文件更改、文件讀取、文件寫入、查詢文件信息、設置文件信息、查詢安全信息、設置安全信息、文件重命名、文件刪除、目錄瀏覽和文件關閉等I/O請求.您可以創建文件訪問日誌,您將知道誰、何時、訪問了哪些文件。通過跟踪和監控所有用戶和文件活動、權限更改、存儲容量並生成實時審計報告,您可以全面控制和查看用戶和數據。

EaseFilter File Access Monitor SDK 是一個文件系統過濾器驅動程序,是一個內核模式組件,作為文件系統之上的 Windows 執行程序的一部分運行。 EaseFilter 文件系統過濾驅動可以攔截針對一個文件系統或另一個文件系統過濾驅動的請求。通過在請求到達預期目標之前攔截請求,過濾器驅動程序可以擴展或替換請求的原始目標提供的功能。 EaseFilter 文件系統過濾器驅動程序可以記錄、觀察、修改甚至阻止對一個或多個文件系統或文件系統卷的 I/O 操作。

File Monitor Filter Driver

使用 EaseFilter File Monitor SDK,您可以通過以下事件在託管文件發生更改時收到通知:

文件創建事件:您可以在創建新文件時收到通知。
文件刪除事件:您可以在文件被刪除時收到通知。
文件重命名事件:您可以在文件重命名時收到通知。
文件寫入事件:您可以在文件寫入數據時收到通知。
文件安全性更改事件:您可以在文件的安全性發生更改時收到通知。
文件信息更改事件:當文件的大小、文件的屬性、文件的最後寫入時間、文件的創建時間、文件的最後訪問時間發生更改時,您可以收到通知。

以下示例創建一個過濾規則來監視運行時指定的目錄。該組件設置為監視目錄中的所有文件更改。如果文件被更改,文件名、文件更改類型、用戶名、進程名將打印到控制台。該組件還設置了監視文件打開和文件讀取IO,IO被觸發,文件打開和文件讀取信息將打印到控制台。

file audit console


using System;
using EaseFilter.FilterControl;

namespace FileMonitorConsole
{
    class Program
    {
        static FilterControl filterControl = new FilterControl();

        static void Main(string[] args)
        {
            string lastError = string.Empty;
            string licenseKey = "Email us to request a trial key: info@easefilter.com";
                
            FilterAPI.FilterType filterType = FilterAPI.FilterType.MONITOR_FILTER;
            int serviceThreads = 5;
            int connectionTimeOut = 10; //seconds

            try
            {
                if (!filterControl.StartFilter(filterType, serviceThreads, connectionTimeOut, licenseKey, ref lastError))
                {
                    Console.WriteLine("Start Filter Service failed with error:" + lastError);
                    return;
                }

                //the watch path can use wildcard to be the file path filter mask.i.e. '*.txt' only monitor text file.
                string watchPath = "c:\\test\\*";

                if (args.Length > 0)
                {
                    watchPath = args[0];
                }

                //create a file monitor filter rule, every filter rule must have the unique watch path. 
                FileFilter fileMonitorFilter = new FileFilter(watchPath);

                //Filter the file change event to monitor all file change events.
                fileMonitorFilter.FileChangeEventFilter = FilterAPI.MonitorFileEvents.NotifyAll;

                //register the file change callback events.
                fileMonitorFilter.NotifyFileWasChanged += NotifyFileChanged;

                //Filter the monitor file IO events
                fileMonitorFilter.MonitorFileIOEventFilter = (ulong)(MonitorFileIOEvents.OnFileOpen | MonitorFileIOEvents.OnFileRead);

                fileMonitorFilter.OnFileOpen += OnFileOpen;
                fileMonitorFilter.OnFileRead += OnFileRead;

                filterControl.AddFilter(fileMonitorFilter);

                if (!filterControl.SendConfigSettingsToFilter(ref lastError))
                {
                    Console.WriteLine("SendConfigSettingsToFilter failed." + lastError);
                    return;
                }

                Console.WriteLine("Start filter service succeeded.");

                // Wait for the user to quit the program.
                Console.WriteLine("Press 'q' to quit the sample.");
                while (Console.Read() != 'q') ;

                filterControl.StopFilter();

            }
            catch (Exception ex)
            {
                Console.WriteLine("Start filter service failed with error:" + ex.Message);
            }

        }

        /// Fires this event when the file was changed.
        static void NotifyFileChanged(object sender, FileChangeEventArgs e)
        {
            Console.WriteLine("NotifyFileChanged:" + e.FileName + ",eventType:" + e.eventType.ToString() 
				+ ",userName:" + e.UserName + ",processName:" + e.ProcessName);
        }

        /// Fires this event after the file was opened, the handle is not closed. 
        static void OnFileOpen(object sender, FileCreateEventArgs e)
        {
            Console.WriteLine("FileOpen:" + e.FileName + ",status:" +  e.IOStatusToString() 
				+ ",userName:" + e.UserName + ",processName:" + e.ProcessName);
        }

        /// Fires this event after the read IO was returned.
        static void OnFileRead(object sender, FileReadEventArgs e)
        {
            Console.WriteLine("FileRead:" + e.FileName + ",offset:" + e.offset + ",readLength:" 
				+ e.returnReadLength + ",userName:" + e.UserName + ",processName:" + e.ProcessName);
        }
    }
}

Recent Posts

  • File Security Filter Driver SDK

  • Using File System Filter Driver SDK

  • EEFD Transparent File Encryption SDK

  • EaseFilter File Access Control SDK

  • EaseFilter File Access Monitor SDK

  • Secure Sandbox Tool

  • Folder Locker Tool

  • Secure File Sharing with DRM

  • Process Control SDK

  • Registry Protection SDK

  • Process Monitor SDK

  • File Access Control Lists

  • Authentication and Authorization

  • Zero Trust File Access Security

  • Blacklisting and Whitelisting

  • Network File Monitor and Protector

  • Block File Access to USB Drive

  • Setup The Trusted Process Rights

  • Encrypt File With Header

  • Encrypt File On the Go

  • Track File Change In Application

File Knowledge Base

  • Understand File I/O
  • Understand File Encryption
  • Understand Filter Driver
  • Filter Driver Framework
  • Isolation Filter Driver
  • Filter Driver Resources
  • Storage Tiering Filter Driver

File Encryption

  • Understand File Encryption
  • Understand AES Encryption
  • File Encryption In C#
  • File Encryption In C++
  • Symmetric Encryption
  • Asymmetric Encryption
  • Digital Signature
  • EEFD透明文件加密開發包
  • EaseFilter文件監控開發包
  • EaseFilter文件訪問控制開發包

Comprehensive File Security SDK 2023 . Powered by WordPress