Method and system for marking object tags and generating security policies in operating system

Through automated tagging of operating system object labels and generating security policy methods, the high cost and manual analysis problems when deploying SELinux policies are solved, and fast and accurate operating system deployment is achieved, which is suitable for the deployment needs of a large number of operating system versions.

CN114372259BActive Publication Date: 2024-11-12IND TECH RES INST
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110001980.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-10-16
Filing Date
2021-01-04
Publication Date
2024-11-12
Estimated Expiration
2041-01-04

AI Technical Summary

Technical Problem

When deploying SELinux policies on newly released operating system distributions, it is necessary to manually analyze a large number of program behaviors and fine-tune the system settings, resulting in high labor and time costs, especially when deploying a large number of versions, and there is a possibility of operational errors.

Method used

Using a method of marking the tags of objects in the operating system and a method of generating security policies, the tag tool obtains preset tags based on the target attributes, compares and refers to the object attributes in the operating system, selects the appropriate tag to mark the target object, and passes the analysis program Generate candidate tags and eventually form security policies.

Benefits of technology

It realizes automated operating system deployment, reduces labor and time costs, reduces the possibility of operational errors, and supports the rapid deployment of operating system releases that meet environmental needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114372259B_ABST
    Figure CN114372259B_ABST
Patent Text Reader

Abstract

A method and system for marking an object label and generating a security policy in an operating system. The method comprises: a labeling tool obtains a preset label according to a target attribute of a target object in a target operating system, obtains a reference object in a reference operating system, compares whether the target attribute is the same as the reference attribute of the reference object to generate a comparison result, and selectively marks the target object with a preset label, a reference label or one of a plurality of candidate labels according to the comparison result and the type of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security of operating systems, and is related to a method and system for automatically generating labels and security policies for resources in a newly released operating system. Background Art

[0002] In the field of information security of operating systems, there are operating systems that use labeling mechanisms to set security specifications, such as Linux. SELinux is an access control mechanism applied to the Linux operating system, which adopts the Mandatory Access Control (MAC) model. Compared with the Discretionary Access Control (DAC) model used by traditional Linux operating systems, the MAC model focuses on the behavior during execution rather than the identity of the executor, so the problem of identity fraud is solved in the DAC model. In order to achieve the protection mechanism of the MAC model proposed by SELinux, all objects in the operating system need to be labeled; and in order to limit the behavior of system programs, labels are needed to write SELinux policies and rules to describe the allowed system program behavior.

[0003] When deploying SELinux policies on a new operating system release, it is necessary to manually analyze the source code behaviors of many programs and then fine-tune the system-related settings to match the operating procedures of the new operating system. However, when a large number of operating system releases need to be deployed and there are only slight differences between the versions, the manpower and time costs of the above approach will grow exponentially, not to mention the increased possibility of human error. Therefore, there is an urgent need for an efficient method to support the deployment of SELinux security policies in new operating system releases. Summary of the invention

[0004] In view of this, the present invention proposes a method and system for marking an object tag of an operating system and a method and system for generating a security policy for an operating system, thereby reducing the manpower cost and time cost when deploying a large number of operating systems.

[0005] A method for marking an object label of an operating system according to an embodiment of the present invention is applicable to a target object in a target operating system, the target object having a target attribute, the method comprising: obtaining a preset label based on the target attribute with a marking tool; obtaining a reference object in a reference operating system, the reference object having a reference attribute and a reference label; comparing whether the target attribute is the same as the reference attribute to generate a comparison result; and selectively marking the target object with the preset label, the reference label or one of multiple candidate labels based on the comparison result and the type of the target object.

[0006] A method for generating a security policy for an operating system according to an embodiment of the present invention is applicable to a plurality of target objects in a target operating system, each of which has a target attribute. The method comprises: a method for marking an object label of an operating system according to an embodiment of the present invention, obtaining a preset label according to the target attribute using a marking tool; obtaining a reference object in a reference operating system, the reference object having a reference attribute and a reference label; comparing whether the target attribute is the same as the reference attribute to generate a comparison result, and when the comparison result indicates that the target attribute is the same as the reference attribute, marking the target object with the reference label; when the comparison result indicates that the target attribute is different from the reference attribute, determining whether the type of the target object belongs to a program; and when the type of the target object does not belong to a program, marking the target object with the preset label; and when the type of the target object belongs to a program, executing an analysis program to obtain a plurality of candidate labels, and selecting one from the candidate labels to mark the target object according to an access quantity corresponding to each of the candidate labels. Each of the target objects is marked with the preset label, the reference label or one of the candidate labels; a boot test script is executed with the target operating system to generate a plurality of system audit messages; and each of the system audit messages is converted into a rule with a policy generation tool, and the rules are collected to form a security policy.

[0007] According to an embodiment of the present invention, a system for marking an object label of an operating system is applicable to a target object in a target operating system, and the target object has a target attribute. The system includes: a non-temporary machine-readable storage device storing a plurality of instructions; and at least one processing device electrically connected to the non-temporary machine-readable storage device, and the at least one processing device executes the instructions and triggers a plurality of operations, and the operations include: obtaining a preset label according to the target attribute by a marking tool; obtaining a reference object in a reference operating system, and the reference object has a reference attribute and a reference label; comparing the target object with the reference attribute; The target object is determined to determine whether the target attribute is the same as the reference attribute to generate a comparison result. When the comparison result indicates that the target attribute is the same as the reference attribute, the target object is marked with the reference tag. When the comparison result indicates that the target attribute is different from the reference attribute, whether the type of the target object belongs to a program is determined. When the type of the target object does not belong to a program, the target object is marked with the preset tag. When the type of the target object belongs to a program, an analysis procedure is executed to obtain a plurality of candidate tags, and one of the candidate tags is selected to mark the target object according to an access quantity corresponding to each of the candidate tags.

[0008] A system for generating a security policy for an operating system according to an embodiment of the present invention is applicable to a plurality of target objects in a target operating system, each of which has a target attribute. The system includes: a non-temporary machine-readable storage device storing a plurality of instructions; and at least one processing device electrically connected to the non-temporary machine-readable storage device, wherein the at least one processing device executes the instructions and triggers a plurality of operations, wherein the operations include: obtaining a preset label according to the target attribute using a marking tool; obtaining a reference object in a reference operating system, wherein the reference object has a reference attribute and a reference label; comparing the target attribute with the reference attribute to determine whether they are the same to generate a comparison result, and when the comparison result indicates that the target attribute is the same as the reference attribute, using the reference label to determine whether the target attribute is the same as the reference attribute. Marking the target object; and when the comparison result indicates that the target attribute is different from the reference attribute, determining whether the type of the target object belongs to a program; when the type of the target object does not belong to a program, marking the target object with the preset label; and when the type of the target object belongs to a program, executing an analysis program to obtain multiple candidate labels, and selecting one from these candidate labels to mark the target object according to an access quantity corresponding to each of these candidate labels; marking each of these target objects with the preset label, the reference label or one of these candidate labels; executing a boot test script with the target operating system to generate multiple system audit messages; and converting each of these system audit messages into a rule with a policy generation tool, and collecting these rules to form a security policy.

[0009] The above description of the contents of the present disclosure and the following description of the embodiments are used to demonstrate and explain the spirit and principle of the present invention, and to provide a further explanation of the scope of the patent application of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 is a flow chart of an embodiment of a method for marking object tags of an operating system proposed by the present invention;

[0011] Figure 2 yes Figure 1 A detailed flow chart of an implementation of step S3;

[0012] Figure 3 yes Figure 1 A detailed flow chart of an implementation of step S7;

[0013] Figure 4 yes Figure 3 A detailed flow chart of an implementation of step S72;

[0014] Figure 5 yes Figure 3 Detailed flowchart of step S73 in FIG. 1 ; and

[0015] Figure 6 The flowchart of one embodiment of the method for generating a security policy for an operating system proposed by the present invention.

[0016]

Explanation of symbols

[0017] S1~S8…Steps

[0018] S31~S32…Steps

[0019] S7~S8…Steps

[0020] S721~S724…Steps

[0021] S731~S734…Steps DETAILED DESCRIPTION

[0022] The detailed features and characteristics of the present invention are described in detail in the following embodiments, and the content is sufficient for those skilled in the art to understand the technical content of the present invention and implement it accordingly, and according to the content disclosed in this specification, the claims and the drawings, those skilled in the art can easily understand the relevant concepts and characteristics of the present invention. The following examples further illustrate the viewpoints of the present invention in detail, but do not limit the scope of the present invention in any viewpoint.

[0023] The method for marking object labels of an operating system and the method for generating a security policy for an operating system proposed in the present invention are applicable to target objects in a target operating system. The target operating system (Target distribution, TD) refers to an operating system that needs to be deployed in large quantities, which contains multiple target objects. The operating system is, for example, Unix, Linux, Ubunto, or any operating system with labelable objects, but the operating system described in the present invention is not limited to the above examples. The security policy is, for example, SELinux, AppArmour or SMACK, and the present invention does not limit the type of security policy. SELinux is used as an example below. The target object is a file on the file system, including general files, connection files, socket files, pipe files, block files, haracter files, directories, executable files (programs) and other types.

[0024] Figure 1 The flowchart of an embodiment of the method for labeling an object of an operating system proposed by the present invention is as follows: Step S1 is "a labeling tool obtains a preset label according to a target attribute".

[0025] Before step S1, the present invention needs to install in advance the relevant tools for making SELinux policies in the open source policy framework Repolicy, such as: marking tool setfiles, label database file_contexts, policy compilation tool checkpolicy, policy conversion tool audit2allow, and function libraries required for SELinux operations such as libselinux, libsepol, libsemanage, etc.

[0026] The marking tool setfiles described in step S1 is used in conjunction with the label database file_contexts. The target attribute is, for example, a file path, a file name, or a file type. In step S1, the target attribute refers to the file path of the target object. The label database file_contexts records the regular expression of the file path and the corresponding label. Please refer to Table 1 below, which lists part of the content of the label database file_contexts in a tabular form, wherein each row is a regular expression of the file path (such as / mnt ( / [^ / ]*) in the second column), a file type (such as "-l"` in the second column), and a label (such as system_u:object_r:mnt_t in the second column). Therefore, step S1 finds the preset label that matches the file path of each target object in the target operating system in the label database file_contexts. For example, a directory folder located under / mnt / will be assigned the label system_u:object_r:mnt_t according to Table 1.

[0027] Table 1

[0028] ... / mnt( / [^ / ]*)-l system_u:object_r:mnt_t / mnt( / [^ / ]*)? -d system_u:object_r:mnt_t / dev / .*system_u:object_r:device_t / etc / .*system_u:object_r:etc_t / opt / .*system_u:object_r:usr_t ...

[0029] Step S2 is "obtaining a reference object in a reference operating system", and step S3 is "comparing the target attributes with the reference attributes to see if they are the same to generate a comparison result". In one embodiment, the target operating system is Ubuntu and the reference operating system is Debian. In steps S2 and S3, the present invention uses a source operating system (source distribution, SD) that has a complete SELinux environment deployed as a template, and uses the file paths and file types of the two as the basis for comparison, and marks the resources in the target operating system that match the reference operating system with consistent labels. The reference object described in step S2 has reference attributes and reference labels, and the reference attributes are, for example, at least one of the file path, file name, or file type.

[0030] Figure 2 yes Figure 1Detailed flowchart of an implementation of step S3 in step S31. Step S31 is "determining whether the file path and file type are the same", that is, comparing whether the target object and the reference object are located in the same file path and whether they have the same file type. If the judgment result of step S31 is yes, it means that the "comparison result" described in step S3 indicates that the target attribute is the same as the reference attribute, so the process moves to step S4, "marking the target object with a reference tag".

[0031] An implementation method of the process of steps S31 to S4 is described as follows: In step S31, the target operating system executes a remote command through the encrypted network transmission protocol of Secure Shell (SSH), and sends the file path of the target object to the reference operating system. The reference operating system receives the file path of the target object and uses the file command to find out whether there is a corresponding reference object in its own file system. In the reference operating system, if the reference object can be found using the file path of the target system, the reference operating system sends the reference tag of the reference object to the target operating system, and sends the file type of the reference object to the target operating system in the form of an Internet media type (also known as a MIME type). In step S4, the target operating system determines whether the file type of the reference object is the same as the file type of the target object. If the judgment result is yes, the target object is marked with the received reference tag. If the judgment result is no, the reference tag is discarded and the target object is not marked.

[0032] If the judgment result of step S31 is no, it means that the "comparison result" described in step S3 indicates that the target attribute is different from the reference attribute. Here, the target attribute and the reference attribute refer to the file path and the file type. Considering the possibility that the files with the same name are located in different paths, the process moves to step S32, "determine whether the file name and file type are the same". If the judgment result of step S32 is yes, it means that there is a reference object similar to the target object in the reference operating system. However, the file path of this reference object relative to the reference operating system is different from the file path of the target object relative to the target operating system. In this case, the target object can still be marked according to the reference tag of this reference object, so the process moves to step S4.

[0033] In practice, the implementation method of the above process of steps S31 to S4 can be adaptively modified to be applicable to the process of steps S32 to S4.

[0034] If the result of the judgment in step S32 is no, it means that in the reference operating system, there is no reference object that can be compared to the target object in terms of file name and file path, so it is necessary to further consider whether there is a reference object in the reference operating system that is similar to the target object in content. For example, if the target object is an executable file (program), there may be a reference object in the reference operating system that has a behavior similar to that of the target object. Therefore, the process returns Figure 1 Step S5, "determine whether the type of the target object is a program".

[0035] If the target object is just a general file, and after comparing the file path and file name, nothing is found, it should be determined that there is no reference object similar to the target object in the reference operating system. Therefore, if the judgment result of step S5 is no, that is, "the type of the target object is not a program", the process moves to step S6, "marking the target object with a preset label".

[0036] If the judgment result of step S5 is yes, that is, "the type of the target object is a program", the process moves to step S7, "execute the analysis program to obtain multiple candidate tags".

[0037] Figure 3 yes Figure 1 However, before describing step S7 in detail, it is necessary to first explain the preparatory work before step S7. In detail, before executing the analysis program, the following two preparatory works must be completed, but the present invention does not limit the order of executing these two preparatory works.

[0038] The first preparation work is "marking each second target object with a second preset label using a marking tool". It is mentioned above that the target operating system has a target object, which is referred to as the first target object. In practice, an operating system such as Ubunto has multiple target objects, and all target objects except the first target object are referred to as second target objects. The label marked on the first target object by the marking tool is called the first preset label, and the label marked on the second target object by the marking tool is called the second preset label. Since one of the purposes of the present invention is to mark each target object in the target operating system with the most suitable label. Therefore, under the condition of "completed before step S7", the first preparation work can be completed, for example, in step S1, but the present invention is not limited to this.

[0039] The second preparation work is to "analyze the behavior information of each second target object" and "establish a behavior database based on multiple file names, multiple second preset tags and multiple behavior information of these second target objects." The behavior information here refers to the symbol of the file, or the metadata of the file. In practice, the behavior information of each target object in the target operating system can be obtained through tools such as readelf or objdump, and then a behavior database (symbol database) is established with the file name of the second target object, the second preset tag and the behavior information of the second target object. The behavior database is used to provide the second preset tag corresponding to the target object based on the name or behavior information of the target object. The second preparation work needs to be completed before step S7, but the present invention does not limit the timing of its completion.

[0040] Please refer to Figure 1 Step S7 and Figure 3 The analysis procedure includes a static part and a dynamic part. The static part includes steps S71 and S72, and the dynamic part includes step S73. It should be noted that steps S71 to S73 do not limit the execution order.

[0041] To facilitate understanding of the detailed process after step S7, waterfox, a third-party open source web browser developed based on MozillaFirefox, will be used as an example of the target object of "file type belongs to program" below.

[0042] Step S71 is "obtaining a first candidate tag according to the file name of the target object". Step S71 is basically the same as step S1, except that: step S1 uses the marking tool to compare the tag database file_contexts according to the "file path" of the target object, such as " / home / username / waterfox", to obtain the first preset tag, while step S71 uses the marking tool to compare the tag database file_contexts according to the "file name" of the target object, such as "waterfox", to obtain the first candidate tag.

[0043] Step S72 is "obtaining a second candidate tag based on the target behavior and target content of the target object". Similar to the aforementioned method of analyzing the "behavior information" of each second target object, in step S72, the present invention also obtains the target behavior of the target object through tools such as readelf or objdump. In addition, the present invention further obtains the target content of the target object through the string tool, and the target content refers to the printable words in the target object. In short, step S72 is to find one or more second target objects in the target operating system, and their behavior and content keywords are similar to the first target object. Figure 4 yes Figure 3 Detailed flowchart of an implementation of step S72.

[0044] Step S721 is "searching the network program library according to the file name of the target object to obtain the type keyword corresponding to the target object". For example, in the network program library maintained by AUR or Gentoo community, this step S721 uses waterfox as the keyword search to obtain type keywords such as browser, firefox, waterfox, web, etc. This step S721 can pre-screen a large number of tag databases file_contexts according to the program type of the target object to reduce the subsequent calculation and search amount. In other embodiments, this step S721 can be skipped and not executed, and the present invention is not limited to this.

[0045] Step S722 is "retrieve multiple fields from the behavior database according to the target behavior", and the target behavior is the same as the behavior information in each field retrieved. From another perspective, step S722 is to find one or more second target objects in the target operating system, and their behavior information is similar to the target behavior of the first target object. For example, two second target objects such as firefox and chrome may be found in step S722, because these programs waterfox, firefox and chrome are all browsers, and therefore have similar file access behaviors or network access behaviors.

[0046] Step S723 is "extracting keywords from the target content according to the second preset tag in the extracted field", wherein the keyword is the same as one of the second preset tags in the extracted field. For example, the second target object firefox contains two second preset tags such as "mozilla_exec_t" and "mozilla_t", and another second target object chrome contains two second preset tags such as "google_exec_t" and "google_t". This step S723 uses a part of the second preset tag corresponding to the second target object as a comparison string, and determines whether the keyword identical to the comparison string exists in the target content of the first target object. In order to increase the probability of finding keywords in the target content, the present invention ignores the strings in the second preset tag that are not helpful for searching, such as the part of "_t", and only uses the strings such as "mozilla", "mozilla_exec", "google", "google_exec" as the comparison strings. Generally speaking, the naming of tags is highly correlated with the file name and the source of the file. In addition, when the printable characters of the first target object waterfox itself are viewed with the string tool, there is a high probability of finding the keywords of its related program, that is, mozilla of firefox.

[0047] Step S724 is "selecting a second preset tag from the extracted field as the second candidate tag according to the keyword". For example, the keyword extracted in step S723 is mozilla, so step S724 sets the second preset tags "mozilla_exec_t" and "mozilla_t" corresponding to the two keywords as the second candidate tags.

[0048] As mentioned above, in the static part of the analysis program, in step S71 and step S72, the analysis program obtains the first candidate label and the second candidate label of the target object. It should be noted that the present invention does not limit the number of the first candidate labels or the second candidate labels.

[0049] Please review Figure 3 Step S73 is “obtaining a third candidate tag according to the target object and the test script”. Because the target object is an executable program, this step S73 infers the third candidate tag by using the relevant information obtained by actually executing the target object with the test script. Figure 5 yes Figure 3 Detailed flowchart of step S73.

[0050] Step S731 is “assigning a test tag to a target object”. For example, assigning a test tag test_t to waterfox.

[0051] Step S732 is "the target object with the specified test tag executes the test script to generate multiple audit messages". The test script simulates the user's execution of various operations of waterfox. Since the corresponding security policy has not been set for the test tag test_t in the target operating system, during the execution of the test script, the operating system kernel will generate multiple audit messages to report the unauthorized behavior when waterfox is executed.

[0052] Step S733 is "the policy conversion tool converts the audit message into a policy including multiple interfaces". In practice, the policy conversion tool audit2allow is used to perform the conversion described in step S733.

[0053] Step S374 is "According to the target behavior or each interface, obtain one from multiple tags in the tag database or from multiple second preset tags in the behavior database as the third candidate tag". In one embodiment, each tag in the tag database file_contexts corresponds to an interface. In another embodiment, the second preset tag in the behavior database corresponds to an interface in addition to a behavior information. Therefore, step S734 determines the third candidate tag suitable for these behaviors based on multiple behaviors after the target object actually operates. The third candidate tag may come from the tag database or the behavior database.

[0054] Please review Figure 1 Step S8, "select a marked target object from the candidate tags according to the access quantity corresponding to each candidate tag". In the first implementation of step S8, the present invention adopts the sesearch command to respectively calculate the first access quantity corresponding to the first candidate tag generated by the static part, the second access quantity corresponding to the second candidate tag, and the access quantity corresponding to the third candidate tag generated by the dynamic part. When the target object is designated as a candidate tag, in the rules of the existing strategy, the number of programs (processes) that can access this target object is called the access quantity. The present invention specifies that the candidate tag with the smallest access quantity is marked to the target object.

[0055] In the second implementation of step S8, if the analysis program can find a suitable third candidate tag in the dynamic part, the target object is directly marked with the third candidate tag. Since the target program is actually executed according to the test script in step S732, and multiple interfaces are obtained in step S733. As far as the target object is concerned, the third candidate tag obtained by actual testing is more accurate than the second candidate tag obtained by keyword matching based on the target content and target behavior. However, if the analysis program does not find any third candidate tag in the dynamic part, the analysis program will select a marked target object from the first candidate tag and the second candidate tag, and the selection method can refer to the sesearch in the previous embodiment to find the minimum access quantity.

[0056] As described above, the method for labeling objects in an operating system provided by the present invention can label all target objects in a target operating system with appropriate labels. Figure 6 1 is a flow chart of an embodiment of a method for generating a security policy for an operating system proposed by the present invention. Figure 6 In the process of steps S1 to S8, Figure 1 For each target object, each execution Figure 1 The process will eventually move to one of steps S4, S6 and S8. In other words, the target object may be labeled as a reference label from the reference operating system, a default label from Refpolicy, and a candidate label from the analysis program according to its own properties.

[0057] From the perspective of generating a security policy for the operating system, the process of steps S1 to S8 can be called a static stage, and the process of steps S9 to S10 can be called a dynamic stage.

[0058] Step S9 is "the target operating system executes the boot test script to generate multiple system audit messages". The boot test script generally refers to the system program test script configured after analyzing the system boot behavior and system program behavior. This boot test script records all program behaviors on the operating system during boot and the resources used by these programs, and selectively adds the behaviors of specific programs during general user operations after boot and the resources used by these specific programs. In other words, one of the aforementioned multiple program behaviors corresponds to a program in the system kernel mode or a program in the user mode. When the target operating system is restarted for the first time and the boot test script is executed, since the complete security policy has not yet been established, a large number of access behaviors will be prohibited by the preset security policy, and many system audit messages will be generated after the SELinux check. In step S9, these system audit messages will be stored in a log file (log), and Table 2 below is an example of a log file. This log file contains multiple tags that mark the target object when executing steps S4, S6 or S8.

[0059] Table 2

[0060]

[0061]

[0062] Step S10 is "policy generation The policy generation tool converts each system audit message into a rule, and collects the rules to form a security policy". In detail, according to the system audit message in the log file, the present invention uses the audit2allow tool to convert each system audit message into a corresponding rule. For example, Table 2 can be converted into the three rules listed in Table 3 below: Table 3

[0063]

[0064] In practice, step S10 is repeatedly executed until all system audit messages in the log file are converted into rules. Step S10 further collects these rules. In one embodiment, a complete security policy can be obtained by selecting another boot test script, repeatedly restarting the computer and executing the process of steps S9 to S10.

[0065] In summary, the present invention proposes a method for marking an object label of an operating system and a method for generating a security policy of an operating system. The above method adopts an automated process, and can quickly deploy an operating system distribution version that meets the requirements of any environment, and the operating system adopts a label mechanism to set security rules. The problem of labor cost and time cost caused by the manual analysis of system-related software behavior, setting and writing security policies in the past can be solved by the present invention. The feature of the present invention is that when a new Linux version is released, the security policy of the existing version can be referenced and reused. Therefore, it is only necessary to completely mark the labels of all resources of the current target operating system, and the support problem of the security policy can be solved in an automated manner, and the required security policy can be generated by the policy conversion tool of audit2allow, so that the new Linux distribution can be quickly supported. For hardware platforms that require a large number of different Linux distributions in the fields of the Internet of Things, intelligent manufacturing, and industrial control, the method for marking the object label of the operating system and the method for generating the security policy of the operating system proposed by the present invention can shorten the time of large-scale deployment and reduce labor costs.

[0066] Although the present invention is disclosed in the above embodiments, it is not intended to limit the present invention. Any changes and modifications made without departing from the spirit and scope of the present invention are within the scope of patent protection of the present invention. Please refer to the attached claims for the scope of protection defined by the present invention.

Claims

1. A method for marking an object tag of an operating system, applicable to a target object in a target operating system, the target object having a target attribute, the method comprising: Using a labeling tool to obtain a preset label according to the target attribute; Obtaining a reference object in a reference operating system, the reference object having a reference attribute and a reference tag; Comparing whether the target attribute is the same as the reference attribute to generate a comparison result; as well as The target object is selectively marked with the preset label, the reference label or one of a plurality of candidate labels according to the comparison result and the type of the target object. wherein the target object is a first target object, each of the target attribute and the reference attribute is at least one of a file path, a file name, and a file type, The target operating system further includes a plurality of second target objects, and the preset tag is a first preset tag; Before executing the analysis procedure, also include: Using the marking tool to mark each of the second target objects with a second preset label; analyzing the behavior information of each of the second target objects; and Establishing a behavior database according to the plurality of file names of the second target objects, the second preset tags and the behavior information; and The analysis procedure includes a static part and a dynamic part. The static part includes: Obtaining a first candidate tag according to the file name of the target object; and Obtaining a second candidate label according to the target behavior and the target content of the target object; and The dynamic part includes: obtaining a third candidate tag according to the target object and the test script, Wherein obtaining the second candidate tag according to the target behavior and the target content of the target object comprises: Extracting a plurality of fields from the behavior database according to the target behavior, wherein the target behavior is identical to the behavior information in each of the extracted fields; Extracting at least one keyword from the target content according to the second preset tags in the extracted fields, wherein the at least one keyword is the same as one of the second preset tags in the extracted fields; and At least one of the second preset tags is selected from the extracted fields according to the at least one keyword as the second candidate tag.

2. The method for labeling an object of an operating system as claimed in claim 1, wherein selectively labeling the target object with the preset label, the reference label or one of the candidate labels according to the comparison result and the type of the target object comprises: When the comparison result indicates that the target attribute is the same as the reference attribute, marking the target object with the reference tag; When the comparison result indicates that the target attribute is different from the reference attribute, determining whether the type of the target object belongs to a program; When the type of the target object does not belong to a program, marking the target object with the preset label; as well as When the type of the target object belongs to a program, an analysis program is executed to obtain the candidate tags, and one of the candidate tags is selected to mark the target object according to the access quantity corresponding to each of the candidate tags.

3. The method for marking an object tag of an operating system as claimed in claim 1, wherein Obtaining the first candidate tag according to the file name of the target object includes: The tagging tool is used to compare the tag database according to the file name to obtain the first candidate tag.

4. The method for marking an object tag of an operating system as claimed in claim 1, wherein Before obtaining the second candidate tag according to the target behavior and the target content of the target object, the method further includes: Searching a network library according to the file name of the target object to obtain a type keyword corresponding to the target object; as well as The analysis program also includes: before extracting the fields from the behavior database according to the target behavior, filtering the behavior database according to the program type keyword corresponding to the target object.

5. The method for marking an object tag of an operating system as claimed in claim 1, wherein Obtaining the third candidate tag according to the target object and the test script includes: Assign a test tag to the target object; Executing the test script with the target object assigned the test tag to generate a plurality of audit messages; Use the policy conversion tool to convert these audit messages into policies that include multiple interfaces; Based on the target behavior or each of these interfaces, one is obtained from multiple tags in the tag database or from these second preset tags in the behavior database as the third candidate tag, wherein each of these tags corresponds to one of these interfaces, or each of these behavior information corresponds to one of these interfaces.

6. A method for generating a security policy for an operating system, applicable to a plurality of target objects in a target operating system, each of the target objects having a target attribute, the method comprising: According to the method for labeling objects in an operating system as claimed in claim 1, labeling each of the target objects with the preset label, the reference label or one of the candidate labels; Executing a boot test script with the target operating system to generate a plurality of system audit messages; as well as Each of these system audit messages is converted into rules using a policy generation tool, and these rules are collected to form a security policy.

7. The method for generating a security policy for an operating system as claimed in claim 6, wherein the boot test script comprises: Behaviors of multiple programs on the target operating system and multiple resources used by these programs.

8. The method for generating a security policy for an operating system as claimed in claim 7, wherein one of the program behaviors corresponds to a program in a system kernel mode.

9. The method for generating a security policy for an operating system as claimed in claim 7, wherein one of the program behaviors corresponds to a program in a system user mode.

10. The method for generating a security policy for an operating system as claimed in claim 6, before collecting the rules to form the security policy, further comprising: The boot test script is repeatedly executed with the target operating system until the system audit messages are no longer generated.

11. A system for marking an object tag of an operating system, applicable to a target object in a target operating system, the target object having a target attribute, the system comprising: a non-transitory machine-readable storage device storing a plurality of instructions; as well as At least one processing device is electrically connected to the non-transitory machine-readable storage device, and the at least one processing device executes the instructions and causes a plurality of operations, including: Using a labeling tool to obtain a preset label according to the target attribute; Obtaining a reference object in a reference operating system, the reference object having a reference attribute and a reference tag; Comparing the target attribute with the reference attribute to determine whether they are the same to generate a comparison result; and The target object is selectively marked with the preset label, the reference label or one of a plurality of candidate labels according to the comparison result and the type of the target object. wherein the target object is a first target object, each of the target attribute and the reference attribute is at least one of a file path, a file name, and a file type, The target operating system further includes a plurality of second target objects, and the preset tag is a first preset tag; Before executing the analysis procedure, also include: Using the marking tool to mark each of the second target objects with a second preset label; analyzing the behavior information of each of the second target objects; and Establishing a behavior database according to the plurality of file names of the second target objects, the second preset tags and the behavior information; and The analysis procedure includes a static part and a dynamic part. The static part includes: Obtaining a first candidate tag according to the file name of the target object; and Obtaining a second candidate label according to the target behavior and the target content of the target object; and The dynamic part includes: obtaining a third candidate tag according to the target object and the test script, Wherein obtaining the second candidate tag according to the target behavior and the target content of the target object comprises: Extracting a plurality of fields from the behavior database according to the target behavior, wherein the target behavior is identical to the behavior information in each of the extracted fields; Extracting at least one keyword from the target content according to the second preset tags in the extracted fields, wherein the at least one keyword is the same as one of the second preset tags in the extracted fields; and At least one of the second preset tags is selected from the extracted fields according to the at least one keyword as the second candidate tag.

12. The system for labeling an object of an operating system as claimed in claim 11, wherein in the operations, selectively labeling the target object with the preset label, the reference label, or one of the candidate labels according to the comparison result and the type of the target object comprises: When the comparison result indicates that the target attribute is the same as the reference attribute, marking the target object with the reference tag; When the comparison result indicates that the target attribute is different from the reference attribute, determining whether the type of the target object belongs to a program; When the type of the target object does not belong to a program, marking the target object with the preset label; as well as When the type of the target object belongs to a program, an analysis program is executed to obtain the candidate tags, and one of the candidate tags is selected to mark the target object according to the access quantity corresponding to each of the candidate tags.

13. A system for generating a security policy for an operating system, applicable to a plurality of target objects in a target operating system, each of the target objects having a target attribute, the system comprising: a non-transitory machine-readable storage device storing a plurality of instructions; as well as At least one processing device is electrically connected to the non-transitory machine-readable storage device, and the at least one processing device executes the instructions and causes a plurality of operations, including: Using a labeling tool to obtain a preset label according to the target attribute; Obtaining a reference object in a reference operating system, the reference object having a reference attribute and a reference tag; Compare the target attribute with the reference attribute to see if they are the same to generate a comparison result, selectively marking the target object with the preset label, the reference label, or one of a plurality of candidate labels according to the comparison result and the type of the target object; Marking each of the target objects with the preset label, the reference label or one of the candidate labels; executing a boot test script with the target operating system to generate a plurality of system audit messages; and Use policy generation tools to convert each of these system audit messages into rules, and collect these rules to form security policies. wherein the target object is a first target object, each of the target attribute and the reference attribute is at least one of a file path, a file name, and a file type, The target operating system further includes a plurality of second target objects, and the preset tag is a first preset tag; Before executing the analysis procedure, also include: Using the marking tool to mark each of the second target objects with a second preset label; analyzing the behavior information of each of the second target objects; and Establishing a behavior database according to the plurality of file names of the second target objects, the second preset tags and the behavior information; and The analysis procedure includes a static part and a dynamic part. The static part includes: Obtaining a first candidate tag according to the file name of the target object; and Obtaining a second candidate label according to the target behavior and the target content of the target object; and The dynamic part includes: obtaining a third candidate tag according to the target object and the test script, Wherein obtaining the second candidate tag according to the target behavior and the target content of the target object comprises: Extracting a plurality of fields from the behavior database according to the target behavior, wherein the target behavior is identical to the behavior information in each of the extracted fields; Extracting at least one keyword from the target content according to the second preset tags in the extracted fields, wherein the at least one keyword is the same as one of the second preset tags in the extracted fields; and At least one of the second preset tags is selected from the extracted fields according to the at least one keyword as the second candidate tag.

14. The system for generating a security policy for an operating system as claimed in claim 13, wherein in the operations, selectively marking the target object with the preset label, the reference label or one of the candidate labels according to the comparison result and the type of the target object comprises: When the comparison result indicates that the target attribute is the same as the reference attribute, marking the target object with the reference tag; When the comparison result indicates that the target attribute is different from the reference attribute, determining whether the type of the target object belongs to a program; When the type of the target object does not belong to a program, marking the target object with the preset label; as well as When the type of the target object belongs to a program, an analysis program is executed to obtain the candidate tags, and one of the candidate tags is selected to mark the target object according to the access quantity corresponding to each of the candidate tags.

Citation Information

Patent Citations

  • System and method for object relationship identification in a user interface

    CN102667696A

  • Method, system, and program product for permission to access software

    CN1582430A

  • Automated secure operating system policy integration

    US10417454B1

  • Asynchronous verification for extended file attributes

    US20120066272A1