A distributed system APT detection method

By using smart contracts and federated learning private blockchains in distributed systems, combined with identity authentication and quality certification mechanisms, the data security and privacy issues in APT detection model training are solved, and detection accuracy and system security are improved.

CN114679332BActive Publication Date: 2024-10-22ZHEJIANG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210391517.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2024-10-22
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

The training of APT detection models in distributed systems has data security risks. Model parameters are easily forged or modified during network transmission, and the privacy of each node's data is difficult to guarantee, leading to detection accuracy and privacy issues.

Method used

Adopt a private blockchain based on smart contracts and federated learning, use identity authentication encryption and decryption technology and elliptic curve algorithm to generate public and private keys, ensure the security of model transmission through signature and signature verification, and utilize a consensus mechanism based on quality certification Verify the validity of the model and train it using the Skip-Gram algorithm and multi-layer perceptron to ensure data privacy and model accuracy.

Benefits of technology

While ensuring the data privacy and security of each client node, it improves the accuracy of APT detection, reduces the risk of model parameters being modified or forged, and enhances the overall security of the distributed system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114679332B_ABST
    Figure CN114679332B_ABST
Patent Text Reader

Abstract

The present invention discloses an APT detection method for a distributed system, wherein each client node in the distributed system uses its own system log data to iteratively train a global APT detection model sent by an APT detection request node to obtain a local APT detection model. These client nodes then send the updated local APT detection model to the APT detection request node via a network. The APT detection request node receives these updated model parameters and aggregates them to obtain a global APT detection model for the next iteration. Each client node and the APT detection request node repeat the above process until the global APT detection model converges. The privacy and security of the data of each client node are guaranteed, and model training is performed without the data of each node leaving the local area, thereby reducing the risk of model parameters being modified or forged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of information security, and in particular relates to an APT detection method for ensuring data security of each node in a distributed system. Background Art

[0002] With the increase in Internet business volume, the amount of data and tasks for Internet application systems has increased rapidly. A distributed system consists of a group of computer nodes that work in coordination through network communication and complete common tasks. Transmission between networks is a potential data security risk. APT attacks are diverse and long-lasting. Only a very small amount of attack traffic will be generated over a long span of time. These attacks are also mixed in a large amount of normal traffic. Existing security detection systems (such as firewalls and intrusion detection systems) are difficult to detect, and traditional traffic detection methods have data privacy security issues. Once a node in a distributed system is attacked, it is easy to spread to other nodes, endangering the security of the entire system.

[0003] With the development of network attack detection methods based on machine learning, APT detection methods based on deep learning have received widespread attention. By analyzing a large number of normal samples and attack samples, it builds a model for APT attacks and can discover the nonlinear hidden features of APT attacks with a high accuracy rate.

[0004] However, this method still has some security issues. The transmission of each model update data in the network is not safe. If an attacker forges or modifies these parameters, the global model can bypass certain specific attack detections or fail to converge to a good effect. In addition, the local system data of each node may be very different due to its different functions and tasks in the distributed system. If each node sends its own training data to a third party for deep learning, there will be data privacy issues. Summary of the invention

[0005] The purpose of the present invention is to provide an APT detection method for a distributed system, which improves the accuracy of APT detection while ensuring the data security of each client node.

[0006] To achieve the above object, the technical solution adopted by the present invention is:

[0007] A distributed system APT detection method, wherein the distributed system includes an APT detection request node and a client node participating in global APT detection model training, wherein the APT detection request node and the client node form a private blockchain based on smart contracts and federated learning, and the APT detection method of the distributed system is implemented in the APT detection request node, including:

[0008] Step 1: Use the unique ID of the node in the distributed system as the public key using the encryption and decryption technology based on identity authentication, generate the private key using the elliptic curve algorithm, and broadcast the message containing the public key to each client node;

[0009] Step 2: Sign the global APT detection model with a private key, and broadcast the signed global APT detection model to each client node; the global APT detection model is used for training by the client node using the system log data of its own node after the signature is verified, and after the training is completed, the updated local APT detection model is encrypted using the public key of the APT detection request node and fed back to the APT detection request node;

[0010] Step 3: Receive the trained local APT detection model sent by each client node and decrypt it using the private key, verify the local APT detection model using the consensus mechanism based on quality proof, and reward or improve the trust score of the client node that generates a valid local APT detection model;

[0011] Step 4: Update the global APT detection model in the APT detection request node using an aggregation algorithm based on the effective local APT detection model;

[0012] Step 5: If the global APT detection model in the APT detection request node has not converged, return to step 2 to continue training; otherwise, use the global APT detection model that has converged after multiple rounds of updates to detect APT attacks in the distributed system.

[0013] Several optional methods are also provided below, but they are not intended to be additional limitations on the above-mentioned overall solution, but are merely further supplements or preferences. Under the premise that there are no technical or logical contradictions, each optional method can be combined with the above-mentioned overall solution separately, and multiple optional methods can also be combined.

[0014] Preferably, the global APT detection model is used for training using the system log data of the client node after the client node verifies the signature, including:

[0015] The client node verifies the signature of the global APT detection model broadcast by the APT detection request node;

[0016] After the signature verification is passed, a system behavior diagram is constructed based on the system behavior involved in the system log data of this client node;

[0017] Perform random walk sampling on the system behavior graph, learn a large number of sampled node sequences based on the Skip-Gram algorithm, and obtain the embedded representation vector of each node;

[0018] The attention mechanism is used for the embedded representation vector of each node, and the activation function is set to obtain the overall representation vector. The overall representation vector is used and the multi-layer perceptron is used as the classifier to train the global APT detection model.

[0019] Preferably, the verification of the local APT detection model using a consensus mechanism based on quality proof includes:

[0020] quantifying the performance of the local APT detection model using detection accuracy deviation;

[0021] The local APT detection model whose detection accuracy deviation is higher than the set threshold is marked as an invalid local APT detection model, otherwise it is marked as a valid local APT detection model.

[0022] Preferably, the using the detection accuracy deviation to quantify the performance of the local APT detection model comprises:

[0023] If there are N client nodes in the private blockchain, the APT detection request node selects Q client nodes for federated learning aggregation in each iteration, Q≤N, and the tth client node C t (C t ∈Q) The local APT detection model fed back to the APT detection request node in the i-th iteration is The detection accuracy deviation of the local APT detection model is quantified as follows:

[0024]

[0025] In the formula, y i For local APT detection model The true value of the test, f(x i ) is the local APT detection model The predicted value of the output, is the client node C in the i-th iteration t The trust score of n is the client node C t The total number of iterations involved, the calculated detection accuracy deviation The higher the value, the higher the client node C t Feedback-based global APT detection model The lower the detection accuracy, the worse the training effect.

[0026] Preferably, after rewarding or improving the trust score of the client node that generates the effective local APT detection model, the method further includes:

[0027] A block is packaged, the block is put on the chain, and broadcast to all nodes in the distributed system. The block at least includes the hash value of the parameters of the local APT detection model provided by all client nodes participating in the training and the hash value of the unique ID of all client nodes participating in the training in the distributed system.

[0028] The present application also provides an APT detection method for a distributed system, wherein the distributed system includes an APT detection request node and a client node participating in the training of a global APT detection model, wherein the APT detection request node and the client node constitute a private blockchain based on smart contracts and federated learning, and the APT detection method for the distributed system is implemented in each client node, including:

[0029] Step 1: Receive a message broadcast by an APT detection request node to obtain a public key of the APT detection request node; the public key of the APT detection request node is generated according to the unique ID of the APT detection request node in a distributed system using an encryption and decryption technology based on identity authentication, and the corresponding private key is generated by an elliptic curve algorithm;

[0030] Step 2: Receive the global APT detection model signed with a private key broadcast by the APT detection request node;

[0031] Step 3: After the global APT detection model is signed, it is trained using the system log data of its own node, and the training is completed as the updated local APT detection model;

[0032] Step 4: Use the public key of the APT detection request node to encrypt the updated local APT detection model and feed it back to the APT detection request node; the local APT detection model fed back to the APT detection request node is decrypted by the APT detection request node, verified using a consensus mechanism based on quality proof, and the aggregation algorithm is used to update the global APT detection model in the APT detection request node.

[0033] Preferably, the global APT detection model is trained using the system log data of its own node after the signature verification, including:

[0034] Verify the signature of the global APT detection model broadcast by the APT detection request node;

[0035] After the signature verification is passed, a system behavior diagram is constructed based on the system behavior involved in the system log data of this client node;

[0036] Perform random walk sampling on the system behavior graph, learn a large number of sampled node sequences based on the Skip-Gram algorithm, and obtain the embedded representation vector of each node;

[0037] The attention mechanism is used for the embedded representation vector of each node, and the activation function is set to obtain the overall representation vector. The overall representation vector is used and the multi-layer perceptron is used as the classifier to train the global APT detection model.

[0038] Preferably, the verification of the local APT detection model using a consensus mechanism based on quality proof includes:

[0039] quantifying the performance of the local APT detection model using detection accuracy deviation;

[0040] The local APT detection model whose detection accuracy deviation is higher than the set threshold is marked as an invalid local APT detection model, otherwise it is marked as a valid local APT detection model.

[0041] Preferably, the using the detection accuracy deviation to quantify the performance of the local APT detection model comprises:

[0042] If there are N client nodes in the private blockchain, the APT detection request node selects Q client nodes for federated learning aggregation in each iteration, Q≤N, and the tth client node C t (C t ∈Q) The local APT detection model fed back to the APT detection request node in the i-th iteration is The detection accuracy deviation of the local APT detection model is quantified as follows:

[0043]

[0044] In the formula, y i For local APT detection model The true value of the test, f(x i ) is the local APT detection model The predicted value of the output, is the client node C in the i-th iteration t The trust score of n is the client node C t The total number of iterations involved, the calculated detection accuracy deviation The higher the value, the higher the client node C t Feedback-based global APT detection model The lower the detection accuracy, the worse the training effect.

[0045] As a preferred embodiment, it also includes: after the APT detection request node verifies using a consensus mechanism based on quality proof, rewarding or improving the trust score of the client node that generates a valid local APT detection model;

[0046] A block is packaged, the block is put on the chain, and broadcast to all nodes in the distributed system. The block at least includes the hash value of the parameters of the local APT detection model provided by all client nodes participating in the training and the hash value of the unique ID of all client nodes participating in the training in the distributed system.

[0047] The APT detection method for a distributed system provided by the present invention combines the method of federated learning with respect to data privacy issues. Each client node in the distributed system uses its own system log data to iteratively train the global APT detection model sent by the APT detection request node to obtain a local APT detection model. These client nodes then send the updated local APT detection model to the APT detection request node through the network. After receiving these updated model parameters, the APT detection request node aggregates them to obtain the global APT detection model for the next iteration. Each client node and the APT detection request node repeat the above process until the global APT detection model converges. The privacy and security of the data of each client node are guaranteed, and model training is performed without the data of each node leaving the local area, thereby reducing the risk of the model parameters being modified or forged. For the problem of insecure network transmission, the model parameters are encrypted using IBE (Identity-Based Encryption) encryption and decryption technology based on identity authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart of the APT detection method of the distributed system of the present invention implemented in an APT detection request node;

[0049] Figure 2 This is a system behavior diagram of an embodiment of the present invention;

[0050] Figure 3 The present invention is a flow chart of the APT detection method for a distributed system implemented on each client node. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0053] Embodiment 1:

[0054] This embodiment provides an APT detection method for a distributed system, which solves the problem that there are hidden dangers in the training of APT detection models in a distributed system in the prior art.

[0055] The distributed system includes an APT detection request node and a client node that participates in the global APT detection model training. It is easy to understand that the distributed system may also include other client nodes that do not participate in the global APT detection model training, and the data of the client nodes depends on the layout requirements of the distributed system, which is not limited in this embodiment.

[0056] Because there are client nodes that participate and do not participate in model training in the distributed system, it is necessary to first build a private blockchain as a training interaction space before model training. This embodiment builds a private blockchain based on smart contracts and federated learning. The private blockchain consists of APT detection request nodes in the distributed system and client nodes that participate in global APT detection model training in the distributed system. The client nodes that participate in global APT detection model training use their system logs as training data.

[0057] It should be noted that the construction of a private blockchain based on smart contracts and federated learning can be initiated by either the APT detection request node or the client node, but usually it is initiated by the APT detection request node.

[0058] Specifically, Figure 1 As shown, the APT detection method of the distributed system in this embodiment is applied to the APT detection request node and includes the following steps:

[0059] Step 1: Use IBE's identity authentication-based encryption and decryption technology to take the unique ID of this node in the distributed system as the public key, use the elliptic curve algorithm to generate the private key, and broadcast the message containing the public key to each client node.

[0060] Specifically, after all client nodes receive the broadcast message that the APT detection request node wants to perform APT detection, each client node can determine the trust relationship between the APT detection request node and the client node. If the trust level is low, it can refuse to cooperate with the requirements of the APT detection request node and directly ignore the broadcast message. If you choose to trust the node based on the trust relationship, the APT detection request node will be marked as a requester for updating the global APT detection model, and wait for the requester to send the encrypted global APT detection model. The APT detection request node also includes its own public key information in this broadcast message, and has used the system parameters and the node's own distributed ID as the public key through PKG to generate a private key corresponding to the user identity information. The APT detection request node holds the private key locally.

[0061] When generating a private key, a trusted third party PKG (Private Key Generator) is required to generate the private key of the APT detection request node. This embodiment uses an elliptic curve algorithm key generator. Assume that the ID of the APT detection request node authenticated by the PKG is ∈ {0,1} * ,The steps for the APT detection request node to establish a public-private key pair and encrypt and send the global APT detection model are as follows:

[0062] GeneratePrivateKey(s,H(ID))→d ID

[0063] Using system parameters s, hash algorithm H(), and the distributed ID of the APT detection request node, PKG runs GeneratePrivateKey(s,H(ID)) to obtain the private key d of the APT detection request node. ID .

[0064] Sign(d ID ,model)→Sig

[0065] PKG uses a signature algorithm, based on the model model that needs to be signed and the private key d of the APT detection request node ID , output a signature value Sig.

[0066] Step 2: Sign the global APT detection model with a private key, and broadcast the signed global APT detection model to each client node; the global APT detection model is used for training using the system log data of the client node after the signature is verified. After the training is completed, the updated local APT detection model is encrypted using the public key of the APT detection request node and fed back to the APT detection request node.

[0067] This application uses IBE authentication-based encryption and decryption technology to encrypt and decrypt the global APT detection model, including the following steps:

[0068] The client node uses the public key of the APT detection request node obtained by the previous broadcast to decrypt the global APT detection model signed by the APT detection request node. The decryption also verifies the identity of the APT detection request node. The updated local APT detection model obtained through training is encrypted with the public key of the APT detection request node and sent to the APT detection request node. The APT detection request node uses its private key to decrypt the updated local APT detection model received.

[0069] The process of the client node verifying whether the received global APT detection model belongs to the APT detection request node corresponding to the public key ID is as follows.

[0070] VerifyID(H(ID),model,Sig)→Valid∨Invalid

[0071] The hash value of the APT detection request node ID, the global APT detection model model, and the signature Sig are used for signature verification. If the ID output by the signature verification (i.e. Valid) is the ID of the node that initiated the APT detection request (i.e. Invalid), the signature verification passes.

[0072] After verification, the system behavior involved in the client node system log data includes processes, files, networks, node attributes, etc., and a system behavior graph is constructed on this basis. Figure 2 As shown. Perform random walk sampling on the system behavior graph (for example, use cypher and gremlin to perform random walk on the graph), learn a large number of sampled node sequences based on the Skip-Gram algorithm, obtain the embedded representation vector of each node, use the attention mechanism, set the activation function to obtain the overall representation vector, use the overall representation vector, use the multi-layer perceptron as a classifier to train the global APT detection model, and use the updated model as the local APT detection model.

[0073] The client node trains multiple times to obtain a converged and updated global APT detection model, uses the converged and updated global APT detection model as the local APT detection model, encrypts the model parameters using the public key of the APT detection request node, and sends them to the APT detection request node.

[0074] Encrypt(H(ID),UpdatedModel)→CipherText

[0075] The local APT detection model UpdatedModel is encrypted with the public key to obtain the ciphertext CipherText and sent to the APT detection request node.

[0076] Step 3: Receive the trained local APT detection model sent by each client node and decrypt it using the private key, verify the local APT detection model using a consensus mechanism based on quality proof, and reward or improve the trust score of the client node that generates a valid local APT detection model.

[0077] This embodiment uses the detection accuracy deviation to quantify the performance of the local APT detection model, and marks the local APT detection model whose detection accuracy deviation is higher than the set threshold as an invalid local APT detection model, otherwise it is marked as a valid local APT detection model.

[0078] The APT detection request node receives the ciphertext CipherText of the local APT detection model sent by each client node, using the private key d ID Decryption is performed to obtain the local APT detection model UpdateModel, which is the global APT detection model updated after training by the client node.

[0079] Decrypt(d ID ,CipherText)→UpdateModel

[0080] The local APT detection model is then verified using a consensus mechanism based on Proof of Training Quality (PoQ). Client nodes that generate valid local APT detection models are rewarded.

[0081] Specifically, assuming that there are N client nodes in the private blockchain, the APT detection request node will select some client nodes Q≤N for aggregation of federated learning in each iteration, that is, participate in the global APT detection model training. Each client node C t (C t ∈Q), C t represents the tth client node in the distributed system, and i represents the number of iterations. The local APT detection model uploaded by the client node in the i-th round is The APT detection request node calculates the accurate value deviation of the training effect to screen the model provided by the client node. At the beginning, the trust score of each node They are all default values, which will be dynamically adjusted according to the number of times the effective local APT detection model is trained. This trust value will also feedback and affect the accuracy.

[0082]

[0083] In the formula, y i For local APT detection model The true value of the test, f(x i ) is the local APT detection model The predicted value of the output, is the client node C in the i-th iteration t The trust score of n is the client node C t The total number of iterations involved, the calculated detection accuracy deviation The higher the value, the higher the client node C t Feedback-based global APT detection model The lower the detection accuracy, the worse the training effect. If the value is higher than a certain threshold, the APT detection request node will mark the updated local APT detection model as an invalid model and will not enter the aggregate calculation of federated learning. It will decrease dynamically.

[0084] This embodiment can provide some digital cryptocurrency rewards and improve the trust score for client nodes that generate effective local APT detection models. When making dynamic adjustments, adjustment rules can be set according to actual conditions. For example, when an effective local AOT detection model is trained in sequence, the trust score can be increased by a preset value accordingly.

[0085] After changing the trust score, the process also includes: packaging a block, putting the block on the chain, recording the information of this round of iteration and broadcasting it to all nodes in the distributed system. The block at least includes the hash value of the updated APT detection global model parameters provided by all client nodes participating in the training and the hash value of the unique ID of all the client nodes participating in the training in the distributed system.

[0086] Specifically, the block may include the following contents: The block size is (head+TransactionN d ), where head is the block header, including the hash value of the previous block in prevBlockHash, the version number of the block header in version, the hash value of the merkle tree of the merkleRoot block transaction, the timestamp of the time block creation, the threshold of the difficultyTarget quality proof, the number of transactions in the numTransactions block, etc. dIndicates the number of client stages that provide updated local APT detection models. Transaction is an octet (iteration number i, unique ID of the distributed system APT detection request node, hash value h of the local APT detection model parameters provided by the client node, the model corresponding to The timestamp of the model upload, whether it is a valid model identifier m, and the trust score of the client node The client node’s reward p).

[0087] Step 4: Use the aggregation algorithm to update the global APT detection model in the APT detection request node according to the effective local APT detection model.

[0088] In order to protect the data privacy of each client node, the data of each client node may be highly personalized, and not all client nodes want these original data to be transmitted to the data center for sharing. Therefore, a distributed machine learning method is used to implement iterative learning tasks. The training principle of the global APT detection model is not to transmit the original training data. The aggregation algorithm of this example can use FedAvg aggregation algorithm, Krum, Trimmed Mean, Median and other methods.

[0089] This example uses the Federated Leanrning Averaging (FedAvg) algorithm to implement it: the Federated Leanrning Averaging algorithm is applicable to all objective functions in the form of cumulative errors of a finite number of samples, integrating multiple deep learning models using the stochastic gradient descent algorithm into a global model.

[0090] In the federated learning setting, assuming that there are Q client nodes participating in the training, P t Represents the training samples stored in the tth client node, the number of samples is n t =|P t |, f i (w) represents the local loss of the model under the i-th sample. The FedAvg algorithm defines the following objective function f(w):

[0091]

[0092] The total loss function is the weighted average of the number of local loss samples of each client node. Unbalanced sample release is a common problem after federated learning. The APT detection request node only needs to iterate steps 2 to 5 until the global APT detection model converges or reaches the required APT detection accuracy requirement, and finally achieves the purpose of collecting data and training the global APT detection model.

[0093] Step 5: If the global APT detection model in the APT detection request node has not converged, return to step 2 to continue training; otherwise, use the global APT detection model that has converged after multiple rounds of updates to detect APT attacks in the distributed system.

[0094] It can be seen from the above embodiments that the present application adopts federated learning to solve the risk of client node data leakage, and then realizes the global APT detection model training when the local data of the client node is not shared. The IBE encryption and decryption algorithm is used to verify the identity of the APT detection request node, and the training model that needs to be transmitted can be encrypted, which overcomes the leakage of model training parameters. The use of IBE encryption and decryption technology not only ensures lightweight and data transmission security, but also avoids data forgery and tampering, and ensures the model security of federated learning. The method of deep learning based on system behavior to construct data dependency graphs is used to detect APT attacks, which has good adaptability and improves the success rate of APT detection in distributed systems. The consensus mechanism based on training quality proof is used to overcome the possible poisoning attacks in federated learning and achieve the effect of excluding malicious nodes.

[0095] Embodiment 2:

[0096] This embodiment provides an APT detection method for a distributed system, which solves the problem that there are hidden dangers in the training of APT detection models in a distributed system in the prior art.

[0097] The distributed system includes an APT detection request node and a client node that participates in the global APT detection model training. It is easy to understand that the distributed system may also include other client nodes that do not participate in the global APT detection model training, and the data of the client nodes depends on the layout requirements of the distributed system, which is not limited in this embodiment.

[0098] Because there are client nodes that participate and do not participate in model training in the distributed system, it is necessary to first build a private blockchain as a training interaction space before model training. This embodiment builds a private blockchain based on smart contracts and federated learning. The private blockchain consists of APT detection request nodes in the distributed system and client nodes that participate in global APT detection model training in the distributed system. The client nodes that participate in global APT detection model training use their system logs as training data.

[0099] It should be noted that the construction of a private blockchain based on smart contracts and federated learning can be initiated by either the APT detection request node or the client node, but usually it is initiated by the APT detection request node.

[0100] Specifically, Figure 3As shown, the APT detection method of the distributed system in this embodiment is applied to each client node and includes the following steps:

[0101] Step 1, receive the message broadcast by the APT detection request node to obtain the public key of the APT detection request node; the public key of the APT detection request node is generated according to the unique ID of the APT detection request node in the distributed system using the encryption and decryption technology based on identity authentication, and the corresponding private key is generated by the elliptic curve algorithm.

[0102] Step 2: Receive the global APT detection model signed with a private key broadcast by the APT detection request node.

[0103] Step 3: After verifying the signature of the global APT detection model, the system log data of the node itself is used for training. After the training is completed, it is used as the updated local APT detection model.

[0104] Step 4: Use the public key of the APT detection request node to encrypt the updated local APT detection model and feed it back to the APT detection request node; the local APT detection model fed back to the APT detection request node is decrypted by the APT detection request node, verified using a consensus mechanism based on quality proof, and the aggregation algorithm is used to update the global APT detection model in the APT detection request node.

[0105] Specifically, the global APT detection model is trained using the system log data of its own node after the signature is verified, including:

[0106] Verify the signature of the global APT detection model broadcast by the APT detection request node.

[0107] After the signature verification is passed, a system behavior diagram is constructed based on the system behavior involved in the system log data of this client node.

[0108] The system behavior graph is randomly sampled, and a large number of node sequences obtained by sampling are learned based on the Skip-Gram algorithm to obtain the embedded representation vector of each node.

[0109] The attention mechanism is used for the embedded representation vector of each node, and the activation function is set to obtain the overall representation vector. The overall representation vector is used and the multi-layer perceptron is used as the classifier to train the global APT detection model.

[0110] Specifically, the local APT detection model is verified by using a consensus mechanism based on quality proof, including:

[0111] The performance of the local APT detection model is quantified using the detection accuracy deviation.

[0112] The local APT detection model whose detection accuracy deviation is higher than the set threshold is marked as an invalid local APT detection model, otherwise it is marked as a valid local APT detection model.

[0113] Specifically, the performance of the local APT detection model is quantified using the detection accuracy deviation, including:

[0114] If there are N client nodes in the private blockchain, the APT detection request node selects Q client nodes for federated learning aggregation in each iteration, Q≤N, and the tth client node C t (C t ∈Q) The local APT detection model fed back to the APT detection request node in the i-th iteration is The detection accuracy deviation of the local APT detection model is quantified as follows:

[0115]

[0116] In the formula, y i For local APT detection model The true value of the test, f(x i ) is the local APT detection model The predicted value of the output, is the client node C in the i-th iteration t The trust score of n is the client node C t The total number of iterations involved, the calculated detection accuracy deviation The higher the value, the higher the client node C t Feedback-based global APT detection model The lower the detection accuracy, the worse the training effect.

[0117] Specifically, it also includes: after the APT detection request node verifies using a consensus mechanism based on quality proof, the client node that generates a valid local APT detection model is rewarded or the trust score is improved.

[0118] A block is packaged, the block is put on the chain, and broadcast to all nodes in the distributed system. The block at least includes the hash value of the parameters of the local APT detection model provided by all client nodes participating in the training and the hash value of the unique ID of all client nodes participating in the training in the distributed system.

[0119] For other limitations of the APT detection method for a distributed system in this embodiment, reference may be made to the limitations of the APT detection method for a distributed system in Embodiment 1, and will not be repeated here.

[0120] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0121] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A distributed system APT detection method, characterized in that: The distributed system includes an APT detection request node and a client node participating in the global APT detection model training. The APT detection request node and the client node form a private blockchain based on smart contracts and federated learning. The APT detection method of the distributed system is implemented in the APT detection request node, including: Step 1: Use the unique ID of the node in the distributed system as the public key using the encryption and decryption technology based on identity authentication, generate the private key using the elliptic curve algorithm, and broadcast the message containing the public key to each client node; Step 2: Sign the global APT detection model with a private key, and broadcast the signed global APT detection model to each client node; the global APT detection model is used for training by the client node using the system log data of its own node after the signature is verified, and after the training is completed, the updated local APT detection model is encrypted using the public key of the APT detection request node and fed back to the APT detection request node; Step 3: Receive the trained local APT detection model sent by each client node and decrypt it using the private key, verify the local APT detection model using the consensus mechanism based on quality proof, and reward or improve the trust score of the client node that generates a valid local APT detection model; Step 4: Update the global APT detection model in the APT detection request node using an aggregation algorithm based on the effective local APT detection model; Step 5: If the global APT detection model in the APT detection request node has not converged, return to step 2 to continue training; otherwise, use the global APT detection model that has converged after multiple rounds of updates to detect APT attacks in the distributed system; The method of verifying the local APT detection model by using a consensus mechanism based on quality proof includes: quantifying the performance of the local APT detection model using detection accuracy deviation; The local APT detection model whose detection accuracy deviation is higher than the set threshold is marked as an invalid local APT detection model, otherwise it is marked as a valid local APT detection model; The step of quantifying the performance of the local APT detection model using the detection accuracy deviation includes: If there are N client nodes in the private blockchain, the APT detection request node selects Q client nodes for federated learning aggregation in each iteration, Q≤N, and the tth client node C t The local APT detection model fed back to the APT detection request node in the i-th iteration is C t ∈Q, the detection accuracy deviation of the local APT detection model is quantified as follows: In the formula, y i For local APT detection model The true value of the test, f(x i ) is the local APT detection model The predicted value of the output, is the client node C in the i-th iteration t The trust score of n is the client node C t The total number of iterations involved, the calculated detection accuracy deviation The higher the value, the higher the client node C t Global APT Detection Model with Feedback The lower the detection accuracy, the worse the training effect.

2. The APT detection method for a distributed system according to claim 1, characterized in that: The global APT detection model is used for training by using the system log data of the client node after the client node verifies the signature, including: The client node verifies the signature of the global APT detection model broadcast by the APT detection request node; After the signature verification is passed, a system behavior diagram is constructed based on the system behavior involved in the system log data of this client node; Perform random walk sampling on the system behavior graph, learn a large number of sampled node sequences based on the Skip-Gram algorithm, and obtain the embedded representation vector of each node; The attention mechanism is used for the embedded representation vector of each node, and the activation function is set to obtain the overall representation vector. The overall representation vector is used and the multi-layer perceptron is used as the classifier to train the global APT detection model.

3. The APT detection method for a distributed system according to claim 1, characterized in that: After rewarding or boosting the trust score of client nodes that generate effective local APT detection models, it also includes: A block is packaged, the block is put on the chain, and broadcast to all nodes in the distributed system. The block at least includes the hash value of the parameters of the local APT detection model provided by all client nodes participating in the training and the hash value of the unique ID of all client nodes participating in the training in the distributed system.

4. A distributed system APT detection method, characterized in that: The distributed system includes an APT detection request node and a client node participating in the global APT detection model training. The APT detection request node and the client node form a private blockchain based on smart contracts and federated learning. The APT detection method of the distributed system is implemented in each client node, including: Step 1: Receive a message broadcast by an APT detection request node to obtain a public key of the APT detection request node; the public key of the APT detection request node is generated according to the unique ID of the APT detection request node in a distributed system using an encryption and decryption technology based on identity authentication, and the corresponding private key is generated by an elliptic curve algorithm; Step 2: Receive the global APT detection model signed with a private key broadcast by the APT detection request node; Step 3: After the global APT detection model is signed, it is trained using the system log data of its own node, and the training is completed as the updated local APT detection model; Step 4: Use the public key of the APT detection request node to encrypt the updated local APT detection model and feed it back to the APT detection request node; the local APT detection model fed back to the APT detection request node is decrypted by the APT detection request node, verified by a consensus mechanism based on quality proof, and the aggregation algorithm is used to update the global APT detection model in the APT detection request node; The method of verifying the local APT detection model by using a consensus mechanism based on quality proof includes: quantifying the performance of the local APT detection model using detection accuracy deviation; The local APT detection model whose detection accuracy deviation is higher than the set threshold is marked as an invalid local APT detection model, otherwise it is marked as a valid local APT detection model; The step of quantifying the performance of the local APT detection model using the detection accuracy deviation includes: If there are N client nodes in the private blockchain, the APT detection request node selects Q client nodes for federated learning aggregation in each iteration, Q≤N, and the tth client node C t The local APT detection model fed back to the APT detection request node in the i-th iteration is C t ∈Q, the detection accuracy deviation of the local APT detection model is quantified as follows: In the formula, y i For local APT detection model The true value of the test, f(x i ) is the local APT detection model The predicted value of the output, is the client node C in the i-th iteration t The trust score of n is the client node C t The total number of iterations involved, the calculated detection accuracy deviation The higher the value, the higher the client node C t Global APT Detection Model with Feedback The lower the detection accuracy, the worse the training effect.

5. The APT detection method for a distributed system according to claim 4, characterized in that: The global APT detection model is trained using the system log data of its own node after the signature verification, including: Verify the signature of the global APT detection model broadcast by the APT detection request node; After the signature verification is passed, a system behavior diagram is constructed based on the system behavior involved in the system log data of this client node; Perform random walk sampling on the system behavior graph, learn a large number of sampled node sequences based on the Skip-Gram algorithm, and obtain the embedded representation vector of each node; The attention mechanism is used for the embedded representation vector of each node, and the activation function is set to obtain the overall representation vector. The overall representation vector is used and the multi-layer perceptron is used as the classifier to train the global APT detection model.

6. The APT detection method for a distributed system according to claim 4, characterized in that: Also includes: After verification by the APT detection request node using a consensus mechanism based on quality proof, the client node that generates a valid local APT detection model will be rewarded or its trust score will be increased; A block is packaged, the block is put on the chain, and broadcast to all nodes in the distributed system. The block at least includes the hash value of the parameters of the local APT detection model provided by all client nodes participating in the training and the hash value of the unique ID of all client nodes participating in the training in the distributed system.