CN115935390A - Attribute-based method for controlling and encrypting dynamic access to files in secure sandbox - Google Patents
Attribute-based method for controlling and encrypting dynamic access to files in secure sandbox Download PDFInfo
- Publication number
- CN115935390A CN115935390A CN202211577805.3A CN202211577805A CN115935390A CN 115935390 A CN115935390 A CN 115935390A CN 202211577805 A CN202211577805 A CN 202211577805A CN 115935390 A CN115935390 A CN 115935390A
- Authority
- CN
- China
- Prior art keywords
- file
- attribute
- user
- sandbox
- attributes
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 244000035744 Hura crepitans Species 0.000 title claims abstract description 53
- 230000008569 process Effects 0.000 claims description 27
- 238000011217 control strategy Methods 0.000 claims description 3
- 230000009286 beneficial effect Effects 0.000 abstract description 5
- 230000008859 change Effects 0.000 abstract description 2
- 230000003068 static effect Effects 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 8
- 239000008186 active pharmaceutical agent Substances 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000000903 blocking effect Effects 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 238000013475 authorization Methods 0.000 description 3
- 238000002347 injection Methods 0.000 description 3
- 239000007924 injection Substances 0.000 description 3
- 230000002265 prevention Effects 0.000 description 3
- 239000000243 solution Substances 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000002955 isolation Methods 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 208000019585 progressive encephalomyelitis with rigidity and myoclonus Diseases 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 208000032826 Ring chromosome 3 syndrome Diseases 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
Images
Landscapes
- Storage Device Security (AREA)
Abstract
Description
技术领域technical field
本发明涉及信息安全领域中的电子文件保护,具体为电子文件的访问控制以及电子文件加密保护。The invention relates to electronic file protection in the field of information security, in particular to electronic file access control and electronic file encryption protection.
背景技术Background technique
电子文件指终端上所有的企业、政府等组织单位内部流动的文件,内部文件会包含重要决策、机密信息等,一旦泄露会对相应组织造成不利影响。Electronic documents refer to the internal documents of all enterprises, governments and other organizational units on the terminal. Internal documents will contain important decisions and confidential information. Once leaked, it will adversely affect the corresponding organization.
现有的电子文件保护技术大多靠人工管理或者强制阻断的方式。人工方式依靠管理人员和内部相应政策来进行约束,一方面人工管理存在人员成本,另一方面存在很大主观因素,容易造成文件泄密。强制阻断的方式是指禁用终端上可能发生文件传播的途径如USB、网络设备等,这种方式在如今“互联网+办公”的模式下存在很大弊端,不利于文件在允许的范围内共享,大大降低了工作效率。Most of the existing electronic file protection technologies rely on manual management or forced blocking. The manual method relies on managers and corresponding internal policies to restrict. On the one hand, manual management has personnel costs, and on the other hand, there are many subjective factors, which are likely to cause document leakage. The method of forced blocking refers to the disabling of possible ways of file transmission on the terminal, such as USB, network devices, etc. This method has great disadvantages in today's "Internet + Office" mode, which is not conducive to file sharing within the allowed range , greatly reducing work efficiency.
目前在部分组织中会实施数据防泄漏系统(Data Leakage Prevention,DLP),DLP是应用在数据防泄漏场景下的一种系统架构。DLP在数据的生命周期中对数据分类划分和风险评估,同时也有对数据流向的管控。但是目前DLP着重点在于网络侧,主要检查不同网络通信协议中携带的敏感信息,其可以检测网络传输过程中的数据泄露,但是明显不足的是可以检测的泄露途径比较单一,且如果通过虚拟专用网络(Virtual Private Network,VPN)或者使用加密流量将难以检测,需要扩大检测的范围。而目前的终端DLP产品大多只具有加密的功能,缺少在终端上执行控制策略的能力,一旦加密方式被破解或泄露,仍存在有泄密的风险。本发明针对终端文件缺乏管控的问题,将沙盒和文件访问控制结合,在文件透明加解密操作前置访问控制策略引擎,为每个文件附加允许访问的条件如时间、操作路径、用户身份等。同时沙盒策略有效保护了文件不被非可信应用的非法读取和破坏。针对传统的加密方式密钥容易泄露的问题,本发明采用属性基加密的方式,避免了用户对密钥的记忆。At present, data leakage prevention systems (Data Leakage Prevention, DLP) are implemented in some organizations. DLP is a system architecture applied in data leakage prevention scenarios. DLP classifies and divides data and assesses risks during the data life cycle, and also controls the flow of data. However, at present, DLP focuses on the network side, and mainly checks sensitive information carried in different network communication protocols. It can detect data leakage during network transmission, but the obvious disadvantage is that the leakage path that can be detected is relatively simple, and if the virtual private The network (Virtual Private Network, VPN) or the use of encrypted traffic will be difficult to detect, and the scope of detection needs to be expanded. However, most of the current terminal DLP products only have the function of encryption, and lack the ability to execute control policies on the terminal. Once the encryption method is cracked or leaked, there is still a risk of leakage. Aiming at the problem of lack of management and control of terminal files, the present invention combines sandbox and file access control, pre-access control policy engine in file transparent encryption and decryption operation, and attaches access-allowing conditions such as time, operation path, user identity, etc. to each file . At the same time, the sandbox policy effectively protects files from being illegally read and destroyed by untrusted applications. Aiming at the problem that the key of the traditional encryption method is easily leaked, the present invention adopts the method of attribute-based encryption, which avoids the memory of the key by the user.
现有技术中,申请号202110739746.4的专利说明书中提出一种文件重定向加解密的系统及方法。该申请在Linux操作系统中通过对文件操作相关函数进行HOOK,在读写文件时在内存中进行加解密。与本发明显著区别在于:该申请应用于Linux操作系统,本发明针对Windows操作系统,其中相关文件操作API显著不同;该申请作用范围是进程内文件操作,本发明拥有对外部明文文件进行文件内容识别以及访问控制能力;该申请对于每个文件请求在内存中对文件解密,本发明基于缓冲区,对加解密进行性能优化;该申请对于文件的采用传统对称加密的方式进行加密,本发明基于属性基加密实现无需记忆密钥的文件加密方式与密文共享的方案。In the prior art, the patent specification of application number 202110739746.4 proposes a system and method for file redirection encryption and decryption. The application performs encryption and decryption in memory when reading and writing files by hooking functions related to file operations in the Linux operating system. Significant difference with the present invention is: this application is applied to the Linux operating system, and the present invention is aimed at the Windows operating system, wherein the relevant file operation API is significantly different; Identification and access control capabilities; the application requests to decrypt the file in memory for each file, and the present invention optimizes the performance of encryption and decryption based on the buffer; the application encrypts the file using traditional symmetric encryption, and the present invention is based on Attribute-based encryption implements a file encryption method and a ciphertext sharing scheme that does not require memory keys.
发明内容Contents of the invention
本发明针对文件安全沙盒,提供了一种基于属性的文件动态访问控制和加密方法。针对文件安全沙盒环境缺乏策略管控的问题,将动态访问控制与加密结合,在安全隔离环境中提供一套动态保护文件系统。管理人员可以即时调整访问对象的属性,通过终端上策略引擎,实现对文件的权限进行动态调整。在内核层实现属性基加密,用户操作文件时进行无感知的加解密操作,同时避免了文件在分享过程密钥泄露问题。旨在解决文件在组织内部访问时文件控制策略生效存在延时、文件不易共享以及文件易泄密等问题。Aiming at the file security sandbox, the invention provides an attribute-based file dynamic access control and encryption method. In view of the lack of policy control in the file security sandbox environment, dynamic access control and encryption are combined to provide a dynamic protection file system in a secure isolation environment. Administrators can adjust the attributes of access objects in real time, and dynamically adjust file permissions through the policy engine on the terminal. Attribute-based encryption is implemented at the kernel layer, and users perform imperceptible encryption and decryption operations when operating files, and at the same time avoid the problem of key leakage during file sharing. It aims to solve the problems that there is a delay in the effect of the file control policy when the file is accessed within the organization, the file is not easy to share, and the file is easy to leak.
为达到上述目的,本发明方案如下:参阅图1,用户通过所支持的认证方式授权后,在终端为用户建立安全沙盒;捕获用户终端上的文件操作,通过判断文件操作是否处于沙盒环境以及对文件数据进行解析来判断文件是否处于受保护状态;如果文件属于不受保护文件,则仅对文件做隔离保护,如果文件属于受保护文件,则送入访问控制策略引擎中进行处理,来判断用户是否具有此文件对应的操作权限;如果不具备对应权限将会对文件操作进行拦截并记录;如果具备文件对应权限,对文件进行透明加解密,划分文件的读写操作,写入时加密并嵌入用户的属性信息,读取时基于用户的密钥进行解密,基于双缓冲实现透明访问。In order to achieve the above object, the solution of the present invention is as follows: Referring to Fig. 1, after the user is authorized by the supported authentication method, a security sandbox is established for the user at the terminal; the file operation on the user terminal is captured, and by judging whether the file operation is in a sandbox environment And analyze the file data to determine whether the file is in a protected state; if the file is an unprotected file, only the file is isolated and protected; if the file is a protected file, it is sent to the access control policy engine for processing. Determine whether the user has the operation authority corresponding to the file; if the user does not have the corresponding authority, the file operation will be intercepted and recorded; if the user has the corresponding authority of the file, the file will be transparently encrypted and decrypted, the read and write operations of the file will be divided, and the encryption will be encrypted when writing And embed the user's attribute information, decrypt based on the user's key when reading, and realize transparent access based on double buffering.
具体包括如下步骤:Specifically include the following steps:
步骤S1:进行系统初始化,包括系统主密钥和公钥生成、用户身份注册;Step S1: System initialization, including system master key and public key generation, user identity registration;
步骤S2:用户在终端使用所支持的认证方式登录,获得授权认证后为用户建立安全沙盒环境;Step S2: The user logs in using the supported authentication method on the terminal, and establishes a secure sandbox environment for the user after obtaining authorization and authentication;
所支持认证方式包括:密码认证、USB-Key认证、证书认证。Supported authentication methods include: password authentication, USB-Key authentication, and certificate authentication.
步骤S3:在终端安全沙盒中拦截文件操作;Step S3: intercepting file operations in the terminal security sandbox;
步骤S4:判断一个文件操作所对应的文件是否属于当前安全沙盒;Step S4: judging whether the file corresponding to a file operation belongs to the current security sandbox;
如果文件属于安全沙盒,则进行步骤6操作;If the file belongs to the security sandbox, proceed to step 6;
如果文件不属于安全沙盒,则进行步骤5操作;If the file does not belong to the security sandbox, proceed to step 5;
步骤S5:文件自识别过程,对文件进行解析,基于文件名称、文件格式以及文件内容进行匹配。如果属性库中存在对应的文件,则将文件通过属性库中属性进行加密,移入沙盒中;如果不存在对应文件则放行文件操作;Step S5: the file self-identification process, analyzing the file, and matching based on the file name, file format and file content. If there is a corresponding file in the attribute library, the file will be encrypted through the attributes in the attribute library and moved into the sandbox; if there is no corresponding file, the file operation will be released;
步骤S6:收集当前运行环境,具体的,包括时间,文件操作路径,用户身份信息,文件关键字和文件权限字段,通过访问控制策略引擎来得出文件操作是否允许;Step S6: Collect the current operating environment, specifically, including time, file operation path, user identity information, file keywords and file permission fields, and obtain whether the file operation is allowed through the access control policy engine;
如果策略引擎结果为拒绝访问,则丢弃该文件操作;If the result of the policy engine is access denied, the file operation is discarded;
如果策略引擎结果为允许访问,则对文件读写操作进行区分,进入文件的透明加解密流程;If the result of the policy engine is to allow access, it will distinguish the file read and write operations, and enter the transparent encryption and decryption process of the file;
步骤S7:根据文件操作类型进行加解密操作。Step S7: Perform encryption and decryption operations according to the file operation type.
对于文件读操作,读取文件加密标志位;For file read operations, read the file encryption flag;
若为加密文件,则判断是否存在解密缓存,存在缓存的文件直接返回明文文件句柄,如果不存在缓存,使用当前用户属性进行解密,解密成功则返回明文文件句柄并加入缓存中;If it is an encrypted file, it is judged whether there is a decryption cache. If there is a cached file, the plaintext file handle is returned directly. If there is no cache, the current user attribute is used for decryption. If the decryption is successful, the plaintext file handle is returned and added to the cache;
若为非加密文件,则返回用户明文文件句柄;If it is a non-encrypted file, return the user's plaintext file handle;
对于文件写操作,在缓存中更新明文,依照相应属性加密文件。For file write operations, the plaintext is updated in the cache, and the file is encrypted according to the corresponding attributes.
本发明的有益效果包括:The beneficial effects of the present invention include:
(1)对于文件设计两层保护机制(1) Design a two-layer protection mechanism for files
在现有安全沙盒文件隔离的基础上,引入动态访问控制系统与内核层透明加解密,用户必须同时具有访问权限和解密密钥才能访问文件,任一层无法通过即无法获取对应权限。On the basis of the existing security sandbox file isolation, a dynamic access control system and transparent encryption and decryption of the kernel layer are introduced. Users must have both access rights and decryption keys to access files. If any layer cannot pass, the corresponding rights cannot be obtained.
(2)管理人员可动态调整文件权限(2) Administrators can dynamically adjust file permissions
管理人员可对访问对象(环境、人员)属性进行修改,通过终端侧的策略引擎可实时修改文件的访问权限,即时回收或授权用户权限。整个过程用户无感知。Managers can modify the attributes of access objects (environment, personnel), and the policy engine on the terminal side can modify the access rights of files in real time, and instantly reclaim or authorize user rights. The user is not aware of the whole process.
(3)提升加密文件共享过程中的安全性(3) Improve security during encrypted file sharing
传统加密文件共享过程中涉及到密钥的共享,本发明摆脱一文件一密钥的限制,多用户可使用多份密钥解密同一文件,提高加密文件分享过程中的安全性。The traditional encryption file sharing process involves the sharing of keys. The present invention gets rid of the limitation of one key for one file, and multiple users can use multiple keys to decrypt the same file, thereby improving the security in the process of sharing encrypted files.
附图说明Description of drawings
图1为实施例中的授权用户沙盒环境下发的流程示意图;Fig. 1 is a schematic flow chart of the authorized user sandbox environment delivery in the embodiment;
图2为实施例中Windows文件操作重定向的示意图;Fig. 2 is the schematic diagram of Windows file operation redirection in the embodiment;
图3为实施例中对相似文件管控策略定义的示意图;Fig. 3 is a schematic diagram of the definition of similar file management and control strategies in the embodiment;
图4为实施例中终端侧访问控制实现的示意图;FIG. 4 is a schematic diagram of implementation of terminal-side access control in an embodiment;
图5为实施例中终端侧文件透明加解密保护实现的流程图;Fig. 5 is the flow chart that realizes the transparent encryption and decryption protection of terminal side file in the embodiment;
图6为实施例中文件透明加密方式示意图;Fig. 6 is the schematic diagram of file transparent encryption mode in the embodiment;
图7为实施例中文件透明解密方式示意图;Fig. 7 is a schematic diagram of a file transparent decryption method in an embodiment;
图8为本发明提出的基于属性的安全沙盒内文件动态访问控制和加密方法流程图。FIG. 8 is a flow chart of an attribute-based dynamic access control and encryption method for files in a security sandbox proposed by the present invention.
具体实施方式Detailed ways
本实施例中提供了一种基于属性的文件动态访问控制和加密方法。This embodiment provides an attribute-based dynamic file access control and encryption method.
以下是涉及相关名词的说明:The following is a description of related nouns:
属性:指各类对象的属性,如文件密级、系统时间或用户等级等。Attribute: Refers to the attributes of various objects, such as file confidentiality level, system time or user level, etc.
文件:指在终端上受保护的文件,具有一定机密性和对应访问权限。File: refers to the protected file on the terminal, which has certain confidentiality and corresponding access rights.
安全沙盒:在终端操作系统上划分隔离区域,对位于其中的进程所执行的操作进行管控。Security sandbox: divides the isolated area on the terminal operating system, and controls the operations performed by the processes in it.
访问控制:依照预定义策略在用户进行文件操作时对其进行控制,包括放行和阻止其操作。Access control: Control users when they operate on files according to predefined policies, including allowing and blocking their operations.
属性基加密:根据用户属性、环境属性对文件进行加密。Attribute-based encryption: encrypt files based on user attributes and environment attributes.
该基于属性的文件动态访问控制和加密方法步骤如下:The steps of the attribute-based file dynamic access control and encryption method are as follows:
S1:对整个系统进行必要的初始化,进行加解密相关的密钥生成与属性定义等相关操作。S1: Necessary initialization of the entire system, and related operations such as key generation and attribute definition related to encryption and decryption.
S101:系统授权中心进行密钥初始化,进行系统主密钥MSK的生成和系统公钥PK的生成。S101: The system authorization center performs key initialization, and generates a system master key MSK and a system public key PK.
本实施例采用基于双线性配对的密码系统(Pairing-Based Cryptography,PBC)库中提供的相关函数进行实现,选定A类质数阶椭圆曲线y2=x3+x,对应生成参数见表1。计算所得系统主密钥MSK为128字节。This embodiment is realized by using the related functions provided in the library of Pairing-Based Cryptography (PBC) based on bilinear pairing, and the class A prime order elliptic curve y 2 =x 3 +x is selected, and the corresponding generation parameters are shown in the table 1. The calculated system master key MSK is 128 bytes.
表1Type A质数阶曲线参数Table 1 Type A prime order curve parameters
定义系统中的属性全集,包括用户组、文件组等属性。Define the complete set of attributes in the system, including attributes such as user groups and file groups.
本实施例给定一组属性:This example is given a set of attributes:
Admin:用户组,管理员;Admin: user group, administrator;
UserGroup:用户组,普通用户;UserGroup: user group, common user;
SuFile:文件组,最高等级文件。SuFile: file group, the highest level file.
对不同属性进行SHA-256散列计算,通过element_from_hash函数映射到群上的点,追加到系统公钥PK。管理员可以向不同属性组添加对应成员。Perform SHA-256 hash calculation on different attributes, map to the points on the group through the element_from_hash function, and append to the system public key PK. Administrators can add corresponding members to different attribute groups.
S102:用户通过提供身份信息进行注册操作,向授权中心提供的身份信息需要包含一个唯一标识此用户的ID,每个用户提供此特定ID的值都不相同。S102: The user performs a registration operation by providing identity information, and the identity information provided to the authorization center needs to contain an ID that uniquely identifies the user, and the value of this specific ID provided by each user is different.
S2:用户在终端使用所支持的认证方式登录,获得授权认证后为用户建立安全沙盒环境。图1为该过程示意图。S2: The user logs in using the supported authentication methods on the terminal, and establishes a secure sandbox environment for the user after obtaining authorization and authentication. Figure 1 is a schematic diagram of the process.
用户在终端进行授权认证后,服务端生成认证凭证,下发给用户终端,终端以此凭证作为名称建立沙盒环境。注意同一时刻一个凭证只与一个用户进行绑定。实现沙盒动态与用户身份的动态绑定,防止伪造沙盒来获取权限。After the user performs authorization and authentication on the terminal, the server generates an authentication credential and sends it to the user terminal, and the terminal uses the credential as the name to establish a sandbox environment. Note that a credential is only bound to one user at a time. Realize the dynamic binding of sandbox dynamics and user identities to prevent counterfeiting sandboxes to obtain permissions.
S3:在用户终端建立沙盒环境,并通过捕获文件操作来实现与主机隔离。S3: Establish a sandbox environment on the user terminal and isolate it from the host by capturing file operations.
为本发明提供的一种Windows中文件操作捕获以及重定向方法,如图2所示。该实施例为文件访问控制和加解密保护提供基础能力,通过对文件操作原始API的Hook来实现自有逻辑。发明中的文件操作捕获方法不同于直接通过驱动程序对文件操作进行捕获,是一种在用户态进行捕获的方式。该过程包含以下步骤:A method for capturing and redirecting file operations in Windows provided by the present invention is shown in FIG. 2 . This embodiment provides basic capabilities for file access control and encryption and decryption protection, and realizes its own logic by operating the Hook of the original API on the file. The method for capturing file operations in the invention is different from capturing file operations directly through the driver program, and is a way of capturing in user mode. The process consists of the following steps:
S301:沙盒内进程启动时进行DLL注入,对文件操作API进行Inline Hook,包括NtCreateFile、NtOpenFile、NtDeleteFile、NtReadFile、NtWriteFile等。S301: DLL injection is performed when the process in the sandbox starts, and Inline Hook is performed on the file operation API, including NtCreateFile, NtOpenFile, NtDeleteFile, NtReadFile, NtWriteFile, etc.
S302:创建Windows服务,在服务内实现数据采集、文件加密以及访问控制等判断,对不同的功能点创建命名管道来实现同步或异步的远程过程调用。S302: Create a Windows service, realize data collection, file encryption, access control and other judgments in the service, and create named pipes for different function points to realize synchronous or asynchronous remote procedure calls.
S303:在对常用文件API Hook成功后,对原有操作前通过命名管道通信将需要执行的逻辑发送服务端,可以选择同步方式等待远程函数调用返回结果,或者异步方式非阻塞地向下执行原有逻辑。S303: After successfully hooking the common file API, send the logic that needs to be executed to the server through the named pipe communication before the original operation. You can choose to wait for the return result of the remote function call in a synchronous manner, or execute the origin in a non-blocking manner downwards. There is logic.
此方法优势在于尽量把逻辑抽出内核层和Hook内代码。此方案一方面只通过驱动层来确保DLL注入成功,基于逻辑均在ring3层实现;另一方面,尽量在Hook后函数中减少操作,通过命名管道和系统服务将关键逻辑从原有进程空间分离。通过此方案可大幅减少因为Hook代码部分出现问题而造成的原有程序非预期执行和触发PatchGuard造成系统蓝屏崩溃的问题。The advantage of this method is to extract the logic out of the kernel layer and the code in the Hook as much as possible. On the one hand, this solution only uses the driver layer to ensure the success of DLL injection, and the logic is implemented in the ring3 layer; on the other hand, try to reduce operations in the post-hook function, and separate the key logic from the original process space through named pipes and system services . Through this solution, the problem of unexpected execution of the original program caused by problems in the Hook code part and the blue screen crash of the system caused by triggering PatchGuard can be greatly reduced.
S4:发生文件操作时,判断是否为沙盒内文件操作。如果文件属于当前沙盒,则进行步骤6操作,如果文件不属于当前沙盒,进行步骤5操作S4: When a file operation occurs, determine whether it is a file operation in the sandbox. If the file belongs to the current sandbox, proceed to step 6; if the file does not belong to the current sandbox, proceed to step 5
在以下场景下判定为沙盒内文件操作:In the following scenarios, it is judged as a file operation in the sandbox:
1)沙盒内进程所访问的文件;1) Files accessed by processes in the sandbox;
2)文件路径位于沙盒缓存路径。2) The file path is located in the sandbox cache path.
S5:对文件进行识别,判定其是否属于受保护文件,如图3所示。S5: Identify the file and determine whether it is a protected file, as shown in FIG. 3 .
此步骤对本发明的文件双层保护机制有益效果体现于用户会存在沙盒外部的文件操作行为,例如文件拷贝、沙盒外文件下载等,所以会存在没有在属性集合内定义的文件,需要根据内容进行相似度判断。该过程包含以下步骤:The beneficial effect of this step on the file double-layer protection mechanism of the present invention is reflected in the fact that the user will have file operation behaviors outside the sandbox, such as file copy, file download outside the sandbox, etc., so there will be files that are not defined in the attribute set. Content similarity judgment. The process consists of the following steps:
S501:对于沙盒外部程序不进行Dll注入,通过MiniFilter过滤驱动拦截文件操作。S501: Do not perform Dll injection for the sandboxed external program, and intercept file operations through the MiniFilter filter driver.
S502:在触发PreOperation回调函数时,进行一次过滤,按文件格式进行过滤,例如docx、txt等文档格式文件。S502: When triggering the PreOperation callback function, perform a filter, filter by file format, such as docx, txt and other document format files.
文件格式匹配方式为文件头特征匹配。The file format matching method is file header feature matching.
(1)对于特定文件格式如docx、png或wav等,通过解析文件的文件头部数据,与特征库进行对比;(1) For a specific file format such as docx, png or wav, etc., compare it with the feature library by parsing the file header data of the file;
(2)对于无特定格式文件,如txt或无格式后缀文件,对其首位32字节进行编码探测,(2) For files without a specific format, such as txt or files with no format suffix, the first 32 bytes of the code are detected,
检测是否属于已知编码集来判断文件是否包含可读的文本信息。Checks for known encoding sets to determine whether a file contains readable text information.
S503:进行内容匹配。对于S302过滤结果进行分类:图片格式、音频格式、文本格式等,将其与系统中文件特征库进行内容匹配。本发明对于内容匹配算法方案提供可编程接口,可由用户提供可选的文件内容相似算法。S503: Perform content matching. Classify the filtering results of S302: image format, audio format, text format, etc., and match them with the file feature library in the system. The invention provides a programmable interface for the content matching algorithm scheme, and the user can provide an optional file content similar algorithm.
特别的,本发明给出使用局部敏感哈希算法来进行离线文本相似度比较方式。In particular, the present invention provides an offline text similarity comparison method using a local sensitive hash algorithm.
(1)沙盒中进行文本文件创建、修改操作时,对其标记为需要保护的文件,根据局部敏感哈希算法将其哈希后的结果加入该沙盒所对应的哈希表链中。(1) When creating and modifying text files in the sandbox, mark the files that need to be protected, and add the hashed results to the hash table chain corresponding to the sandbox according to the local sensitive hash algorithm.
(2)预设相似度敏感值,即对应汉明距离,本发明采用3作为预设值。如果文本汉明距离小于等于预设值,则认为所操作文本文件与受保护文本相似度很高。(2) The preset similarity sensitivity value, that is, the corresponding Hamming distance, the present invention uses 3 as the preset value. If the text Hamming distance is less than or equal to the preset value, it is considered that the operating text file is highly similar to the protected text.
如果沙盒外部文件与受保护文件相似程度很高,则对外部文件按受保护文件对应属性进行加密,赋予其与受保护文件相同的权限,供沙盒内程序访问。If the external files of the sandbox are highly similar to the protected files, the external files will be encrypted according to the corresponding attributes of the protected files, and given the same permissions as the protected files, for access by programs in the sandbox.
S6:收集当前运行环境,具体的,包括时间,文件操作路径,用户身份信息,文件关键字和文件权限字段,通过访问控制策略引擎来得出文件操作是否允许,如图4所示。S6: Collect the current operating environment, specifically, including time, file operation path, user identity information, file keywords and file permission fields, and obtain whether the file operation is allowed through the access control policy engine, as shown in Figure 4.
引入基于属性的访问控制来对角色、权限进行统一的描述,使用PERM元模型来进行策略存储,增强了访问控制模型的灵活性。此实施例对本发明有益效果为对文件属性进行分类,把属性集合中的属性区分为静态属性和动态属性,提高访问控制策略的灵活程度,同时实现了在服务端策略更新时进行实时的访问控制策略下发并应用。Attribute-based access control is introduced to describe roles and permissions uniformly, and the PERM meta-model is used for policy storage, which enhances the flexibility of the access control model. The beneficial effect of this embodiment on the present invention is to classify the file attributes, distinguish the attributes in the attribute set into static attributes and dynamic attributes, improve the flexibility of the access control strategy, and realize real-time access control when the server strategy is updated. The policy is issued and applied.
该过程包含以下步骤:The process consists of the following steps:
S601:属性访问控制策略定义与下发。S601: Define and issue an attribute access control policy.
S601-1:属性访问控制策略定义。管理员在服务端进行访问控制策略定义。S601-1: Attribute access control policy definition. Administrators define access control policies on the server side.
首先按照PERM元模型进行模型设计,包括请求定义、策略定义、匹配规则定义。本发明将文件访问请求属性分为文件属性、环境属性、文件操作。First, model design is carried out according to the PERM meta-model, including request definition, policy definition, and matching rule definition. The invention divides file access request attribute into file attribute, environment attribute and file operation.
文件属性包含:文件名、文件格式以及文件受保护属性;File attributes include: file name, file format, and file protected attributes;
环境属性包含:计算机时间、计算机标识(S402中会具体说明)、用户凭据以及沙箱环境状态等;The environment attributes include: computer time, computer identification (will be specified in S402), user credentials, and sandbox environment status, etc.;
文件操作包含:文件读操作、文件写操作。File operations include: file read operations, file write operations.
下述内容是一种所定义的访问控制模型。The following is a defined access control model.
[request_definition][request_definition]
r=file,env,actr=file,env,act
[policy_definition][policy_definition]
p=file,env,actp=file,env,act
[policy_effect][policy_effect]
e=some(where(p.eft==allow))e=some(where(p.eft==allow))
[matchers][matchers]
m=eval(p.file)&&eval(p.env)&&r.act==p.actm=eval(p.file)&&eval(p.env)&&r.act==p.act
在模型确定之后,管理员需要按照策略定义进行策略设置。由上述定义给出一种具体实施策略:After the model is determined, the administrator needs to set the policy according to the policy definition. A specific implementation strategy is given by the above definition:
p,p,
r.file.name=="secret.txt"&&r.file.format=="asciitext"&&r.file.protected==tru e,r.file.name=="secret.txt"&&r.file.format=="asciitext"&&r.file.protected==true,
r.env.box_name=="DefaultBox"&&r.env.Hour>=8&&r.env.Hour<=22&&r.env.box_name=="DefaultBox"&&r.env.Hour>=8&&r.env.Hour<=22&&
r.env.Day>=1&&r.env.Day<=5&&r.env.image_name=="notepad.exe"&&r.env.id=="650fe3266b5b152137e362627c581902"&&r.env.user=="eyJhbGbioiJIUzj1NiJ9…",r.env.Day>=1&&r.env.Day<=5&&r.env.image_name=="notepad.exe"&&r.env.id=="650fe3266b5b152137e362627c581902"&&r.env.user=="eyJhbGbioiJIUzj1NiJ9…",
writewrite
根据策略描述,当发生文件请求时,进行如下匹配:According to the policy description, when a file request occurs, the following matches are performed:
(1)文件名为“secret.txt”(1) The file name is "secret.txt"
(2)文件格式为asciitext(2) The file format is asciitext
(3)文件保护位为受保护状态(3) The file protection bit is protected
(4)当前沙盒名为“DefaultBox”(4) The current sandbox name is "DefaultBox"
(5)当前访问时间在周1至周5中8点到22点范围内(5) The current visit time is within the range of 8:00 to 22:00 from Monday to Friday
(6)当前请求进程为notepad.txt(6) The current request process is notepad.txt
(7)当前终端标识为"650fe3266b5b152137e362627c581902"(7) The current terminal ID is "650fe3266b5b152137e362627c581902"
(8)当前用户标识为"eyJhbGbioiJIUzj1NiJ9…"(8) The current user ID is "eyJhbGbioiJIUzj1NiJ9..."
(9)当前操作为写操作(9) The current operation is a write operation
当有文件请求匹配成功后,即可允许其访问,否则拒绝访问。When a file request is successfully matched, its access can be allowed, otherwise access is denied.
S601-2:属性访问控制策略下发。由于本发明在终端侧进行访问控制,所以需要及时与服务端的访问控制策略进行同步。本发明基于ZeroMQ进行策略的下发。S601-2: Issuing the attribute access control policy. Since the present invention performs access control on the terminal side, it needs to be synchronized with the access control policy of the server in time. The present invention issues strategies based on ZeroMQ.
服务端维护策略版本号,当管理员进行策略变更的时候,对版本号进行升级。The server maintains the policy version number, and when the administrator changes the policy, the version number is updated.
终端用户在身份认证通过后,主动向服务端申请当前策略。服务端返回响应请求,返回策略版本,并与本地版本进行比对。如果本地版本号小于服务端,则向服务端请求进行策略同步。After passing the identity authentication, the terminal user actively applies to the server for the current policy. The server returns the response request, returns the policy version, and compares it with the local version. If the local version number is smaller than that of the server, request policy synchronization from the server.
终端用户在使用过程中,客户端与服务端借助ZMQ发布订阅模式实现长连接,服务端进行策略变更时,对新版本号对于所有订阅者队列中客户端进行广播,通知变更。当客户端比对本地版本不一致时向服务端请求进行策略同步。During the use of the end user, the client and the server use the ZMQ publish-subscribe mode to realize a long-term connection. When the server changes the policy, it broadcasts the new version number to all clients in the subscriber queue to notify the change. When the client is inconsistent with the local version, it requests the server to perform policy synchronization.
S602:属性访问控制终端侧实现。本发明提出一种在终端侧实现属性访问控制的方法。S602: Realize at the terminal side of the attribute access control. The invention proposes a method for realizing attribute access control on the terminal side.
(1)启动本地服务进程,新建命名管道"\\.\pipe\abacpipe"并监听此命名管道,用于接收客户端访问控制相关信息。(1) Start the local service process, create a new named pipe "\\.\pipe\abacpipe" and listen to this named pipe to receive information related to client access control.
(2)通过对沙盒内运行程序进行DLL注入,对文件操作相关API进行Inline hook。当发生对应的文件操作时首先通过命名管道将当前沙盒环境参数、文件属性、文件操作发送服务进程。服务进程在接收到文件请求相关操作时,对策略中缺失的环境参数进行补全,下列出特定缺失参数补全方式:(2) Inline hook the file operation-related API by injecting DLL into the program running in the sandbox. When the corresponding file operation occurs, the current sandbox environment parameters, file attributes, and file operations are first sent to the service process through the named pipe. When the service process receives the operation related to the file request, it completes the missing environment parameters in the policy. The specific missing parameter completion methods are listed below:
计算机标识:由系统硬件决定,通过拼接CPUID、BIOS UUID以及系统串号生成字符串,对其进行哈希后记为计算机标识;Computer ID: Determined by the system hardware, a string is generated by concatenating CPUID, BIOS UUID, and system serial number, which is hashed and recorded as a computer ID;
系统时间:客户端与服务端进行NTP校时,获取校正后系统时间。System time: The client and server perform NTP time calibration to obtain the corrected system time.
(3)本地服务进程中策略引擎按照策略模型进行动态匹配,执行结果为“通过”和“拒绝”,返回给客户端。客户端在收到执行结果后从而决定是否继续执行原始系统API,(3) In the local service process, the policy engine performs dynamic matching according to the policy model, and the execution results are "passed" and "denied", which are returned to the client. After receiving the execution result, the client decides whether to continue to execute the original system API,
并对用户操作进行记录。And record user operations.
S7:根据捕获的文件操作类型进行文件加解密操作。S7: Perform file encryption and decryption operations according to the captured file operation type.
此步骤为本发明提供一种多用户密钥共享的文件透明加密方法,属于文件双层保护机制中第二层加密保护。对本发明增益效果为无需对文件加密密钥进行记忆,实现多用户同时对密文解密,提高了文件共享时的安全性。如图5所示。This step provides the present invention with a multi-user key sharing file transparent encryption method, which belongs to the second-layer encryption protection in the file double-layer protection mechanism. The beneficial effect of the present invention is that there is no need to memorize the file encryption key, and multiple users can decrypt the ciphertext at the same time, which improves the security of file sharing. As shown in Figure 5.
由于沙箱内文件存在恶意绕过访问控制引擎或者物理方式读取硬盘而泄露的风险,故需要对文件进行加密。本发明针对传统加密方式密钥单一、密文共享方式复杂等问题,提出一种在属性访问控制背景下多用户密钥共享的文件透明加密方法。该过程包含以下步骤:Since the files in the sandbox may maliciously bypass the access control engine or be leaked by physically reading the hard disk, the files need to be encrypted. Aiming at the problems of single key and complex ciphertext sharing method in the traditional encryption method, the present invention proposes a file transparent encryption method for multi-user key sharing under the background of attribute access control. The process consists of the following steps:
S701:生成用户密钥。用户密钥在用户通过认证后由服务端下发,同S601-2所述策略下发机制,用户密钥属于运行时信息,可实时由管理员进行修改。用户密钥构建方式:S701: Generate a user key. The user key is issued by the server after the user passes the authentication. It is the same as the policy delivery mechanism described in S601-2. The user key belongs to runtime information and can be modified by the administrator in real time. User key construction method:
(1)用户属性定义。管理员在服务端定义用户属性,用户属性需要包含在用户属性集中(1) Definition of user attributes. The administrator defines user attributes on the server side, and the user attributes need to be included in the user attribute set
(2)生成用户密钥。服务端基于CP-ABE,通过用户属性和系统主密钥MSK生成用户密钥SK,通过ZMQ实时下发到用户终端。(2) Generate user key. Based on CP-ABE, the server generates user key SK through user attributes and system master key MSK, and sends it to the user terminal in real time through ZMQ.
S702:文件透明加密。当沙盒中写文件操作被放行,则进行文件透明加密操作。首先将需加密的文件移入沙盒保护的明文缓冲区,对文件通过属性加密的方式进行加密。加密后的文件移入文件的原路径,从而实现文件透明加密,如图6所示。S702: File transparent encryption. When the file writing operation in the sandbox is released, the file transparent encryption operation will be performed. First move the file to be encrypted into the plaintext buffer protected by the sandbox, and encrypt the file through attribute encryption. The encrypted file is moved into the original path of the file, so as to realize the transparent encryption of the file, as shown in Figure 6.
具体加密方式如下:The specific encryption method is as follows:
(1)构造用户访问结构(1) Construct user access structure
根据系统所定义全局属性集中的属性组或单一属性来进行访问结构的构造。分为请求对象属性和目标对象属性,请求对象属性为用户组或特定用户,响应对象属性为文件组或特定文件。一个示例为:The access structure is constructed according to the attribute group or single attribute in the global attribute set defined by the system. Divided into request object attributes and target object attributes, request object attributes are user groups or specific users, and response object attributes are file groups or specific files. An example would be:
SuFile∩AdminSuFile∩Admin
SuFile与Admin同S101中属性集定义,代表同时具有访问SuFile组权限的访问对象和管理员组的成员才可解密该文件。SuFile and Admin are defined with the attribute set in S101, which means that only the access object and the members of the administrator group who have access to the SuFile group authority can decrypt the file.
在用户终端上,对于原来具有访问结构的文件,加密时默认继承原访问结构;对于普通文件,默认以特定登录用户来构造访问结构,如Bob为当前登录用户则构造的访问结构为Bob;对于需要扩展访问范围的文件可向服务端申请,审批后进行访问结构的下发。On the user terminal, for a file with an original access structure, the original access structure is inherited by default during encryption; for ordinary files, the access structure is constructed with a specific login user by default, such as Bob is the current login user, the constructed access structure is Bob; for Files that need to expand the scope of access can apply to the server, and the access structure will be issued after approval.
(2)文件透明加密(2) File transparent encryption
启动本地服务进程,新建命名管道"\\.\pipe\encrypt"并监听此命名管道,用于接收客户端加密文件路径。Start the local service process, create a new named pipe "\\.\pipe\encrypt" and listen to this named pipe, which is used to receive the encrypted file path of the client.
通过对沙盒内运行程序进行DLL注入,对CloseFile进行Inline hook。当发生对应的文件操作时首先通过命名管道将当前文件路径发送服务进程。服务进程在接收到文件路径时,对当前文件访问结构进行解析,来确定属性加密时具体使用的访问结构。经属性加密后写入文件原路径。Inline hook CloseFile by injecting DLL into programs running in the sandbox. When the corresponding file operation occurs, the current file path is first sent to the service process through the named pipe. When the service process receives the file path, it analyzes the current file access structure to determine the specific access structure used in attribute encryption. Write the original path of the file after attribute encryption.
S703:文件透明解密。当沙盒中读文件操作被放行,则进行文件透明解密操作,如图7所示。S703: Transparently decrypt the file. When the file read operation in the sandbox is released, the file transparent decryption operation is performed, as shown in Figure 7.
具体解密方式如下:The specific decryption method is as follows:
启动本地服务进程,新建命名管道"\\.\pipe\decrypt"并监听此命名管道,用于接收客户端解密文件路径。Start the local service process, create a new named pipe "\\.\pipe\decrypt" and listen to this named pipe to receive the client decrypted file path.
通过对沙盒内运行程序进行DLL注入,对OpenFile进行Inline hook。当发生对应的文件操作时首先通过命名管道将当前文件路径发送服务进程。服务进程在接收到文件路径时,判断当前文件是否在文件缓冲区存在。如文件缓冲区中存在相同文件则代表文件已经解密,进行文件重定向操作,将返回缓冲区中文件句柄;如果文件缓冲区中无相同文件,则根据当前用户的密钥进行解密。如果解密成功则加入文件缓冲区,返回缓冲区中文件句柄;解密失败则拒绝访问。Inline hook OpenFile by injecting DLL into programs running in the sandbox. When the corresponding file operation occurs, the current file path is first sent to the service process through the named pipe. When the service process receives the file path, it judges whether the current file exists in the file buffer. If the same file exists in the file buffer, it means that the file has been decrypted, and the file redirection operation will return the file handle in the buffer; if there is no identical file in the file buffer, it will be decrypted according to the current user's key. If the decryption is successful, it will be added to the file buffer, and the file handle in the buffer will be returned; if the decryption fails, access will be denied.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211577805.3A CN115935390A (en) | 2022-12-09 | 2022-12-09 | Attribute-based method for controlling and encrypting dynamic access to files in secure sandbox |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211577805.3A CN115935390A (en) | 2022-12-09 | 2022-12-09 | Attribute-based method for controlling and encrypting dynamic access to files in secure sandbox |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115935390A true CN115935390A (en) | 2023-04-07 |
Family
ID=86553409
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211577805.3A Pending CN115935390A (en) | 2022-12-09 | 2022-12-09 | Attribute-based method for controlling and encrypting dynamic access to files in secure sandbox |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115935390A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116861411A (en) * | 2023-06-05 | 2023-10-10 | 北京连山科技股份有限公司 | Secure sandbox data protection method and system based on Seccomp mechanism |
CN117290823A (en) * | 2023-11-21 | 2023-12-26 | 中国电信股份有限公司江西分公司 | APP intelligent detection and safety protection method, computer equipment and medium |
-
2022
- 2022-12-09 CN CN202211577805.3A patent/CN115935390A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116861411A (en) * | 2023-06-05 | 2023-10-10 | 北京连山科技股份有限公司 | Secure sandbox data protection method and system based on Seccomp mechanism |
CN117290823A (en) * | 2023-11-21 | 2023-12-26 | 中国电信股份有限公司江西分公司 | APP intelligent detection and safety protection method, computer equipment and medium |
CN117290823B (en) * | 2023-11-21 | 2024-05-10 | 中国电信股份有限公司江西分公司 | APP intelligent detection and safety protection method, computer equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11528142B2 (en) | Methods, systems and computer program products for data protection by policing processes accessing encrypted data | |
Kapil et al. | Attribute based honey encryption algorithm for securing big data: Hadoop distributed file system perspective | |
Riedel et al. | A framework for evaluating storage system security | |
US10460119B2 (en) | IDPS access-controlled and encrypted file system design | |
US6801998B1 (en) | Method and apparatus for presenting anonymous group names | |
US9380037B2 (en) | Methods and devices for trusted protocols for a non-secured, distributed environment with applications to virtualization and cloud-computing security and management | |
US20140019753A1 (en) | Cloud key management | |
US20020046350A1 (en) | Method and system for establishing an audit trail to protect objects distributed over a network | |
US20180018472A1 (en) | Data access control systems and methods | |
US8769271B1 (en) | Identifying and enforcing strict file confidentiality in the presence of system and storage administrators in a NAS system | |
US11295029B1 (en) | Computer file security using extended metadata | |
WO2008121157A2 (en) | Cryptographic key management system facilitating secure access of data portions to corresponding groups of users | |
WO2023078055A1 (en) | Method and system for securely sharing data between first area and second area | |
US20220092193A1 (en) | Encrypted file control | |
CN115935390A (en) | Attribute-based method for controlling and encrypting dynamic access to files in secure sandbox | |
US20220086000A1 (en) | Cryptographic systems | |
JP7571954B2 (en) | SYSTEM AND METHOD FOR SECURE ELECTRONIC DATA TRANSFER - Patent application | |
CN110392062A (en) | A kind of multidimensional encryption method and device based on big data | |
CN1819590A (en) | Enciphering method of computer electronic documents | |
Darwish et al. | Privacy and security of cloud computing: a comprehensive review of techniques and challenges | |
Desausoi et al. | Building a secure and auditable Personal Cloud | |
Sohal et al. | Comparative Analysis of Different Cryptographic Mechanisms of Data Security and Privacy in Cloud Environment | |
KR101473410B1 (en) | Method for Accessing Recording Area of Digital Certificate | |
Xu et al. | A survey of security services and techniques in distributed storage systems | |
TW200830112A (en) | Information security management method for immediate communication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |