A security audit method and system based on machine learning

Through the machine learning-based security audit method, the timing and non-temporal characteristics in the database user log are extracted and classified, which solves the problems of low efficiency and accuracy of manual audits, and improves the accuracy and information security of database security audits.

CN115001814BActive Publication Date: 2024-11-01SHANXI YUNZHIYOU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210614632.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2024-11-01
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

The existing database audit function relies on manual management, is inefficient and cannot effectively combine timing characteristics and non-timing characteristics to make risk judgments, resulting in low accuracy.

Method used

Using machine learning-based security auditing method, by obtaining preprocessed user log data, multi-dimensional user features, including time-sequence and non-time-sequence features, and inputting them into the trained security audit model to perform risk users and risk-free User classification.

Benefits of technology

It improves the accuracy of user log data audit results, reduces the occurrence of security incidents, and improves network information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115001814B_ABST
    Figure CN115001814B_ABST
Patent Text Reader

Abstract

The present invention discloses a security audit method and system based on machine learning, which relates to the field of information security technology. The method comprises: obtaining pre-processed user log data to be audited; extracting features from the user log data to be audited to obtain multi-dimensional user feature data, wherein the multi-dimensional data features include time series features and non-sequence features, and the non-time series features include spatial features, access content features, operator features, and access trajectory features; inputting the multi-dimensional user features into a trained security audit model to obtain security audit results. The present invention realizes the extraction of time series features and non-time series features through a feature recognition module, and realizes security auditing based on multi-dimensional user features through a security audit model. The technical solution of the present invention can improve the accuracy of the audit results of user log data, reduce the occurrence of security incidents, and thus improve network information security.
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 technology, and in particular to a security audit method and system based on machine learning. Background Art

[0002] With the rapid development of the Internet, the amount of data is also increasing at a rapid rate. The effective storage and security control of data are undoubtedly crucial issues in the information age. The efficient storage and good capacity of the database solve the problem of storing massive data, and its application scope is becoming more and more extensive. But at the same time, ensuring security has also become a top priority in the database development process.

[0003] Since a large amount of sensitive data is stored in the database, if the database is not adequately controlled, supervised, and reviewed, the harm caused is immeasurable. In order to prevent data resource leakage and hacker intrusion from having a significant impact on database security, major database companies are making improvements and research on database security to varying degrees. The emergence of the audit function has a significant impact on database security.

[0004] The audit log will record all the operation processes in the database, such as: the operator and its IP address, operation time, operation content, etc. Once a security problem occurs, by checking the audit log, not only can the affected data scope be checked, but also the root cause of the problem can be traced, and the security strategy formulated in this way is more reliable. Therefore, the importance of the audit function is also demonstrated.

[0005] Currently, audit operations are basically managed manually by administrators, who need to view audit logs, troubleshoot problems, determine risks, formulate security policies, and implement security plans. However, this also has some disadvantages: manual risk judgment is inefficient; using simple audit rules, it is impossible to combine time series features and non-time series features for judgment, and the accuracy is low. Summary of the invention

[0006] In view of the defects in the prior art, the present invention provides a security audit method and system based on machine learning.

[0007] In a first aspect, a security audit method based on machine learning is provided, the method comprising:

[0008] S1: Obtain the pre-processed user log data to be audited;

[0009] S2: Extracting features from the user log data to be audited to obtain multi-dimensional user feature data, wherein the multi-dimensional data features include time series features and non-sequence features, and the non-time series features include spatial features, access content features, operator features, and access trajectory features;

[0010] S3: Input the multi-dimensional user features into the trained security audit model to obtain security audit results, wherein the audit results include risky users and non-risky users.

[0011] Preferably, before step S1, the following steps are also included:

[0012] S11: Obtain the user's log data to be audited;

[0013] S12: Preprocessing the log data to be audited.

[0014] Preferably, in step S12, preprocessing the user data to be audited includes:

[0015] S121: Delete irrelevant data, duplicate data, smooth data, and filter data irrelevant to preset audit indicators, wherein the preset audit indicators include time, space, user, system, and content;

[0016] S122: Identify and process missing values ​​to obtain pre-processed user data to be audited.

[0017] Preferably, in step S2, the method of extracting features from the user log data to be audited to obtain multi-dimensional user feature data includes:

[0018] S21: inputting the time data in the user log data to be audited into a first feature recognition module to obtain a time series feature;

[0019] S22: Inputting the space, user, system and content data in the user log data to be audited into a second feature recognition module to obtain non-time series features.

[0020] Preferably, in step S21, the first feature recognition module includes an input layer, an embedding layer, a splicing layer, and an output layer; in step S22, the second feature recognition module includes an input layer, an embedding layer, a recognition layer, a splicing layer, and an output layer, and the recognition layer includes a CNN network layer and a Transformer network layer.

[0021] Preferably, the training method of the security audit model includes:

[0022] Acquire a training sample set, wherein the training sample set includes multiple training samples, and the training samples include multi-dimensional user features and corresponding labels,

[0023] For each training sample in the training sample set, the initial security audit model is trained based on the label and multi-dimensional user features of the training sample to obtain a security audit model.

[0024] Preferably, for each training sample in the training sample set, the initial security audit model is trained based on the label and multi-dimensional user characteristics of the training sample, and the obtained security audit model includes:

[0025] Inputting the multidimensional features of each training sample into the initial security audit model to obtain the audit result corresponding to the training sample;

[0026] Determining the accuracy of the initial security audit model based on the audit result corresponding to each training sample and the label corresponding to the training sample;

[0027] When the accuracy of the initial security audit model reaches a preset value, the security audit model is obtained.

[0028] In the second aspect, a security audit system based on machine learning includes:

[0029] A data acquisition module is used to obtain pre-processed user log data to be audited;

[0030] A feature extraction module is used to extract features from the user data to be audited to obtain multi-dimensional user feature data;

[0031] The security audit module is used to input the multi-dimensional user features into the trained security audit model to obtain security audit results, wherein the audit results include risky users and non-risky users.

[0032] The beneficial effects of the present invention are as follows: applying the network data auditing method and device of the present invention to obtain the pre-processed user log data to be audited; extracting features from the user data to be audited to obtain multi-dimensional user feature data; inputting the multi-dimensional user features into the trained security audit model to obtain security audit results; and realizing the extraction of time series features and non-time series features by establishing an audit indicator and feature recognition module, and realizing security audit based on multi-dimensional user features by establishing a security audit model. The technical solution of the present invention can improve the accuracy of the audit results of user log data, reduce the occurrence of security incidents, and thus improve network information security.

[0033] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.

[0035] Figure 1 A schematic diagram of the structure of a mobile terminal for the security audit method provided by an embodiment of the present invention;

[0036] Figure 2 A flowchart of a security audit method provided by an embodiment of the present invention;

[0037] Figure 3 A structural diagram of the security audit system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The following embodiments of the technical solution of the present invention are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and are therefore only used as examples, and cannot be used to limit the protection scope of the present invention.

[0039] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by those skilled in the art to which the present invention belongs.

[0040] The method embodiment provided in the first embodiment of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal of a security audit method according to an embodiment of the present invention, such as Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor (the processor may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory for storing data. Optionally, the mobile terminal may also include a transmission device and an input and output device for communication functions. It can be understood by ordinary technicians in this field that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0041] The memory can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the enterprise risk assessment processing method in the embodiment of the present invention. The processor executes various functional applications and data processing by running the computer program stored in the memory, that is, implementing the above method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the mobile terminal via a network. The above examples include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0042] The transmission device is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0043] In this embodiment, a security audit method running on the above mobile terminal or network architecture is provided. Figure 2 is a flow chart of a security audit method based on machine learning according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0044] Step 1: Obtain the pre-processed user log data to be audited;

[0045] In the embodiment of the present invention, before step S1, the following steps are also included: S11: obtaining the user's log data to be audited; S12: preprocessing the log data to be audited.

[0046] In an embodiment of the present invention, through network devices or other devices, using ETL tools that support reading and writing of mainstream relational databases, supporting reading and writing of distributed NoSQL databases and supporting reading and writing of Hadoop, existing audit data from various data sources are collected to obtain the user's log data to be audited.

[0047] It should be noted that the preprocessing of the user log data to be audited includes: deleting irrelevant data, duplicate data, smoothing data, screening data irrelevant to preset audit indicators, wherein the preset audit indicators include time, space, user, system, and content; identifying and processing missing values ​​to obtain preprocessed user data to be audited. Specifically, the time data is used to characterize time series information, the space data is used to characterize information such as the user's IP address and the changed IP address, the user data is used to characterize information such as the operator's identity information and the operating system, and the content data is used to characterize information such as the operator's visitor's identity information and the number of visits.

[0048] Furthermore, when deleting data, the deletion method can be divided into two types according to different data processing angles: deleting observation samples and deleting variables. When replacing data, variables can be divided into numerical and non-numerical types according to their attributes, and the two are handled differently: if the variable where the missing value is located is numerical, the data value and its corresponding content are directly deleted; if it is a non-numerical variable, the median or mode of all other valid observations of the variable is used for replacement.

[0049] Through the above method, the user log data to be audited can be preprocessed in advance, reducing the difficulty of subsequent processing and improving audit efficiency.

[0050] Step 2: Extract features from the user log data to be audited to obtain multi-dimensional user feature data, wherein the multi-dimensional data features include time series features and non-sequence features, and the non-time series features include spatial features, access content features, operator features, and access trajectory features;

[0051] It should be noted that in step S2, the method for extracting features from the user log data to be audited to obtain multi-dimensional user feature data includes: S21: inputting the time data in the user log data to be audited into the first feature recognition module to obtain time series features; S22: inputting the space, user, system and content data in the user log data to be audited into the second feature recognition module to obtain non-time series features.

[0052] Among them, the first feature recognition module includes an input layer, an embedding layer, and a splicing layer. The input layer is used to input the first user attributes (space, user, system and content data), the embedding layer is used to process the input first user attributes, vectorize them using the word vector method, and obtain the embedding vector of the first user attributes. The splicing layer is used to splice the embedding vectors to obtain space features, access content features, operator features, and access trajectory features.

[0053] Among them, the second feature recognition module includes an input layer, an embedding layer, and a recognition layer. The recognition layer includes a CNN network layer and a Transformer network layer. The input layer is used to input (time data) the second user attribute, and the embedding layer is used to embed the input second user attribute. The recognition layer is used to perform preliminary recognition on the second user attribute after preliminary embedding processing using the CNN network layer, and to perform precise semantic recognition on the second user attribute after preliminary recognition using the Transformer network layer. The splicing layer is used to splice the second user attribute after semantic recognition to obtain time series features.

[0054] It should be noted that although the Transformer algorithm has a good effect on the recognition of time series features, the deep Transformer algorithm has high requirements for computing resources. Therefore, it is difficult to meet the time requirements of online recognition by using this algorithm. Secondly, the Transformer algorithm is mainly used in the field of NLP. However, in the fields of information security technology and other fields involved in the present invention, the data is more complex and diversified. Therefore, it is difficult to achieve the expected effect by directly using the Transformer algorithm. Therefore, on the basis of the above, an embodiment of the present invention proposes a feature recognition method based on CNN and Transformer algorithms, which performs preliminary recognition of embedded time series features through the network layer, and performs accurate semantic recognition of the features after preliminary recognition through the Transformer network layer, so as to better complete the recognition of time series features.

[0055] Step three: input the multi-dimensional user features into the trained security audit model to obtain security audit results, wherein the audit results include risky users and non-risky users.

[0056] In an embodiment of the present invention, the training method of the security audit model includes: obtaining a training sample set, the training sample set includes multiple training samples, the training samples include multi-dimensional user features and corresponding labels, and for each training sample in the training sample set, training an initial security audit model based on the labels and multi-dimensional user features of the training samples to obtain a security audit model.

[0057] Furthermore, for each training sample in the training sample set, an initial security audit model is trained based on the label and multi-dimensional user features of the training sample to obtain the security audit model, including: inputting the multi-dimensional features of each training sample into the initial security audit model to obtain the audit result corresponding to the training sample; determining the accuracy of the initial security audit model based on the audit result corresponding to each training sample and the label corresponding to the training sample; when the accuracy of the initial security audit model reaches a preset value, obtaining the security audit model.

[0058] Specifically, the security audit model provided in the embodiment of the present invention is a multi-layer neural network model with a dense fully connected structure. The number of layers of the model is 3, and its feedforward propagation process is shown in the following formula:

[0059] h 1 =a(W 1 x+b 1 )

[0060] h 2 =a(W 2 h 1 +b 2 )

[0061] y=a(W out h 2 +b out )

[0062] x is an n-dimensional input feature and x={x 1 , x 2 , …, x n};h 1 and h 2 are the hidden features of the first hidden layer and the second hidden layer respectively; W 1 , W 2 and W out are the weights of each layer mapping, and b 1 , b 2 and b out are the biases of the mapping of each layer respectively. The weight coefficient and the bias coefficient are both the parameters to be determined for model training; a(*) is a nonlinear activation function; y is the output result. For the binary classification problem of the security audit in the embodiment of the present invention, the dimension of the output result is set to 2 dimensions, corresponding to "risky users" and "risk-free users" respectively. The size relationship of the two-dimensional output results is compared. The dimension with a larger output result is the audit result of the binary classification problem.

[0063] It should be noted that the security audit model training provided in the embodiment of the present invention adopts the ADAM algorithm, the learning rate is set to 0.0001, the number of iterations of the model training is 100 times, and during training, the loss function is set to the cross entropy function of the binary classification problem, and training is performed through samples in the training sample set, wherein the loss function is specifically as follows:

[0064]

[0065] in, represents the label of the i-th sample (risk-free user / risky user, i.e. 0 / 1), and y iRepresents the two-dimensional output normalized by the softmax function. Specifically, the preset accuracy is 99.3%. When the accuracy reaches 99.3%, the model training stops.

[0066] like Figure 3 As shown, based on the above embodiment, the embodiment of the present invention also provides a security audit system based on machine learning, including:

[0067] A data acquisition module is used to obtain pre-processed user log data to be audited;

[0068] A feature extraction module is used to extract features from the user data to be audited to obtain multi-dimensional user feature data;

[0069] The security audit module is used to input the multi-dimensional user features into the trained security audit model to obtain security audit results, wherein the audit results include risky users and non-risky users.

[0070] The machine learning-based security audit system provided in the embodiment of the present invention and the machine learning-based security audit method provided in the above embodiment are based on the same inventive concept. Therefore, the more specific working principles of each module in the embodiment of the present invention can refer to the above embodiment and will not be repeated here.

[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

Claims

1. A security audit method based on machine learning, characterized in that: The method comprises: S1: Obtain the pre-processed user log data to be audited; S2: Extracting features from the user log data to be audited to obtain multi-dimensional user feature data, wherein the multi-dimensional user feature data includes time series features and non-time series features, and the non-time series features include spatial features, access content features, operator features, and access trajectory features; S3: Inputting the multi-dimensional user features into the trained security audit model to obtain security audit results, wherein the audit results include risky users and non-risky users; Among them, in step S2, the method of extracting features from the user log data to be audited to obtain multi-dimensional user feature data includes: S21: inputting the time data in the user log data to be audited into a first feature recognition module to obtain a time series feature; S22: inputting the space, user, system and content data in the user log data to be audited into a second feature recognition module to obtain non-time series features; In step S21, the first feature recognition module includes an input layer, an embedding layer, a concatenation layer, and an output layer. In step S22, the second feature recognition module includes an input layer, an embedding layer, a recognition layer, a concatenation layer, and an output layer, and the recognition layer includes a CNN network layer and a Transformer network layer. The security audit model is a multi-layer neural network model with a dense fully connected structure, with 3 layers, and its feedforward propagation process is shown in the following formula: h 1 =a(W 1 x+b 1 ) h 2 =a(W 2 h 1 +b 2 ) y=a(W out h 2 +b out ) x is an n-dimensional input feature and x={x1,x2,…,x n };h 1 and h 2 are the hidden features of the first hidden layer and the second hidden layer respectively; W 1 , w 2 and w out are the weights of each layer mapping, and b 1 , b 2 and b out are the biases of each layer mapping, and the weight coefficient and bias coefficient are the parameters to be determined for model training; a(*) is a nonlinear activation function; y is the output result, corresponding to risky users and risk-free users respectively; The loss function of the security audit model is as follows: in, represents the label of the i-th sample. When the label value is 1, it indicates a risky user, and when the label value is 0, it indicates a risk-free user. i Represents the two-dimensional output normalized by the softmax function.

2. The method according to claim 1, characterized in that: Before step S1, the method further includes: S11: Obtain the user's log data to be audited; S12: Preprocessing the log data to be audited.

3. The method according to claim 2, characterized in that In step S12, preprocessing the log data to be audited includes: S121: Delete irrelevant data, duplicate data, smooth data, and filter data irrelevant to preset audit indicators, wherein the preset audit indicators include time, space, user, system, and content; S122: Identify and process missing values ​​to obtain pre-processed user log data to be audited.

4. The method according to claim 1, characterized in that: The training method of the security audit model includes: Acquire a training sample set, wherein the training sample set includes multiple training samples, and the training samples include multi-dimensional user features and corresponding labels, For each training sample in the training sample set, the initial security audit model is trained based on the label and multi-dimensional user features of the training sample to obtain a security audit model.

5. The method according to claim 4, characterized in that For each training sample in the training sample set, the initial security audit model is trained based on the label and multi-dimensional user features of the training sample, and the obtained security audit model includes: Inputting the multidimensional features of each training sample into the initial security audit model to obtain the audit result corresponding to the training sample; Determining the accuracy of the initial security audit model based on the audit result corresponding to each training sample and the label corresponding to the training sample; When the accuracy of the initial security audit model reaches a preset value, the security audit model is obtained.

6. A security audit system based on machine learning, applicable to the method according to any one of claims 1 to 5, characterized in that: include: A data acquisition module is used to obtain pre-processed user log data to be audited; A feature extraction module is used to extract features from the user data to be audited to obtain multi-dimensional user feature data; The security audit module is used to input the multi-dimensional user feature data into the trained security audit model to obtain security audit results, wherein the audit results include risky users and non-risky users.