A dynamic access control method based on variational autoencoder and attributes
Through the combination of variational autoencoders and static rules, the problem of high requirements for prior knowledge and label data in dynamic access control is solved, fine-grained access control in an unlabeled data environment is achieved, and model training costs and Adaptable and suitable for complex network environments.
Patent Information
- Application Number
- CN202210498302.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-09
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-05-09
AI Technical Summary
The existing technology has high requirements for prior knowledge and label data in dynamic access control, and is difficult to effectively apply to huge amounts of unlabeled network data. It lacks versatility and cannot achieve fine-grained and dynamic access control well.
Adopt a dynamic access control method based on variational autoencoder (VAE), combine static rule matching and anomaly detection of VAE model, realize multi-factor attribute decision-making through incremental training of VAE model, reduce dependence on label data, and adapt to dynamic access Control needs.
It achieves effective dynamic access control decisions without the need for complex data labels, reduces model training costs and workload, adapts to changing user and behavior patterns in practice, and improves the accuracy and versatility of access control.
Smart Images

Figure CN114944945B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cyberspace security, and specifically is a dynamic access control method based on variational autoencoders and attributes. Background Art
[0002] With the rapid development of the Internet of Things and the era of big data, a huge amount of data has entered the Internet. How to protect data from malicious access and ensure that data operations are performed with permission is the main issue discussed in access control. As a key technology to ensure information security, access control can effectively monitor resource access and prevent unauthorized information flows.
[0003] The network environment is becoming increasingly complex, and it is necessary to implement high-demand, fine-grained, and dynamic access control. In this context, attribute-based access control (ABAC) has emerged as a new form of access control, which formulates access policies based on the attributes of access users, access resources, environmental conditions, and execution operations. Since attributes can describe entities from different perspectives and attribute values are variable over time, ABAC allows users to change access control policies based on actual conditions, which can effectively solve the problem of fine-grained access control in dynamic large-scale environments. ABAC is an ideal access control model in new computing environments and has broad application prospects.
[0004] In order to adapt to the needs of dynamic access control in complex networks, more access control variants have emerged that are improved according to their application scenarios, such as access control based on risk, context, workflow, etc. They perform dynamic access control through risk assessment, machine learning or context perception, and use richer data to determine the credibility of personal identity to achieve real-time access control decisions and policy execution. However, the implementation of these access controls requires sufficient prior knowledge and labeled classified data, which may be subject to certain conditions, are not universal, and cannot be directly applied to practice.
[0005] When faced with a huge amount of unlabeled network data, due to the lack of sufficient prior knowledge and established data category labeling standards, manual category labeling is a large task with high cost. In this case, unsupervised learning is a better solution. As an unsupervised learning algorithm, autoencoders are widely used in anomaly detection. They use normal samples to train the model and classify the loss error output by the model, which can solve the problem of few attack samples and unlabeled data. Summary of the invention
[0006] The purpose of the present invention is to address the defects and problems of the background technology, and provide a dynamic access control method based on variational autoencoders and attributes, which realizes multi-factor attribute decision-making through VAE anomaly detection, thereby solving the problem of high requirements for prior knowledge and label data in dynamic access control, effectively realizing dynamic decision-making of access control, and performing access control according to user access behavior during the entire access process.
[0007] The technical solution adopted by the present invention to solve the above technical problems is:
[0008] A dynamic access control method based on variational autoencoders and attributes includes two parts: static rule matching and dynamic access decision based on VAE model. The specific steps are as follows:
[0009] Step 1: Set static rules for access control;
[0010] Step 2: Obtain log files, extract data features, and train the VAE model;
[0011] Step 3: When there is new type of user data, perform incremental training on the VAE model;
[0012] Step 4: Combine static rules with the VAE model to implement dynamic access control.
[0013] Furthermore, the step 1 specifically includes the following sub-steps:
[0014] Step 1.1, set static access rules according to the application scenario, such as access user group, access resource ID, access operation, access time, connection network, etc.;
[0015] Step 1.2: Convert the set static access rules into XACML standard language representation.
[0016] Furthermore, the step 2 specifically includes the following sub-steps:
[0017] Step 2.1, obtain the original access log, calculate the message flow characteristics and statistical characteristics of the corresponding session of the request for each access request, and obtain the original data set;
[0018] Step 2.2, digitize and standardize the feature data of the training set;
[0019] Step 2.3: Classify the original data set through the clustering algorithm, and take a data set with a much larger data volume than other classes as normal access data to obtain the training set of the VAE model;
[0020] Step 2.4, set the VAE model network structure and loss function: The VAE model uses the Intro-VAE network, the structure is as follows Figure 1As shown, it consists of an encoder, a decoder and a discriminator, where the encoder and decoder use a fully connected network, and the discriminator estimates the difference between the generated sample and the real sample through the encoder and decoder of the VAE network; the encoder loss function is equal to the sum of the loss functions of the output of the VAE network and the discriminator, and the decoder loss function is equal to the reconstruction loss function plus the loss function of the discriminator output;
[0021] Step 2.5: Use the training data set to train the VAE model, save the model parameters, and test the training samples with the trained VAE model to obtain the mean of the reconstruction loss function. This mean is used as the threshold for abnormal classification, where the reconstruction loss function uses the mean square error.
[0022] Furthermore, the step 3 specifically includes the following sub-steps:
[0023] Step 3.1: According to the feature data calculation method described in step 2, a new category of data set S is obtained. i ;
[0024] Step 3.2: Generate a dataset S with new categories i A random number dataset R with a certain size ratio that follows a standard normal distribution and has the same dimension as the feature data. This ratio depends on the ratio of the number of original data users to the number of new types of users. Input the dataset R into the decoder of the original VAE model to obtain the same random number as the original dataset X. i-1 Dataset S with the same distribution i-1 ;
[0025] Step 3.3: Merge dataset S i-1 And the dataset S i , get the data set X i ;
[0026] Step 3.4: Using dataset X i Retrain the VAE model, save the model parameters, test the training samples with the trained VAE model to obtain the mean of the reconstruction loss function, and use this mean as the threshold for anomaly classification.
[0027] Furthermore, the step 4 specifically includes the following sub-steps:
[0028] Step 4.1, when an access request is input, obtain the relevant attributes of the request according to the calculation requirements and rule requirements in steps 1 and 2;
[0029] Step 4.2: Input the generated attribute feature vector into the access control engine, and determine whether the request is legal according to the static access rules set in step 1. Requests that do not meet the rules are denied access;
[0030] Step 4.3: For the request filtered by the rules, input the VAE model trained in steps 2 and 3 to calculate the reconstruction loss function. If this value is greater than the threshold, the access behavior is judged as abnormal and the access request is rejected. Otherwise, it is a normal access behavior and the access request is approved.
[0031] Step 4.4: Output the result of the access decision.
[0032] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0033] 1. Combining static rules with dynamic decisions can effectively and accurately implement dynamic access control.
[0034] 2. When using the VAE model for classification, the training set only requires normal samples and does not require complex data labels, reducing the cost and workload of model training.
[0035] 3. Use the generative function of VAE for incremental learning to improve the model without relying on the original data set and without significantly increasing the training cost. This is more in line with practical applications when a large amount of new data is constantly appearing, such as new user groups and behavior patterns. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is the Intro-VAE network structure diagram;
[0037] Figure 2 This is the VAE incremental learning network structure diagram;
[0038] Figure 3 Dynamic access decision flow chart for VAE model;
[0039] Figure 4 The framework diagram of a dynamic access control method based on variational autoencoder and attributes of the present invention. DETAILED DESCRIPTION
[0040] The technical solution provided by the present invention will be further explained below in conjunction with specific embodiments. It should be noted that the following specific implementation methods are only used to explain the present invention rather than to limit the scope of the present invention.
[0041] This paper proposes an attribute-based dynamic access control method based on variational autoencoder. Figure 4As shown in the figure, it includes two parts: static rule matching and dynamic access decision based on VAE anomaly detection. Static rule matching is implemented through XACML. After inputting an access request, static attributes such as access user group and access time are matched to filter out requests that meet the requirements; then, Intro-VAE is used to calculate the loss error based on the message traffic characteristics of the request and the statistical characteristics of the corresponding session of the request. If it is lower than a certain threshold, the access is authorized. When a new category needs to be added, the Intro-VAE model is updated using incremental learning.
[0042] Specifically, the present invention comprises the following steps:
[0043] Step 1: Set static rules for access control. The specific process is as follows:
[0044] Step 1.1. Set static access rules according to the application scenario. In this example, the following access rules are set: access resource ID-user group-access time-access operation. For example, users with the Admin role are allowed to read / write resources with ID A during working hours from Monday to Friday.
[0045] Step 1.2: Convert the set static access rules into XACML standard language representation.
[0046] Step 2: Get the log file, extract data features, and train the VAE model. The specific process is as follows:
[0047] Step 2.1, obtain the original access log, and calculate the message traffic characteristics and statistical characteristics of the request corresponding session for the user access behavior based on each access request; according to the access log data used in this example, the data characteristics are shown in Table 1.
[0048] Table 1
[0049]
[0050] Step 2.2: Digitize the text features in the feature data and use formula (1) to perform Z-Score standardization on the data features.
[0051]
[0052] Among them, x * Represents the standardized value of a certain type of feature, x represents the initial feature value, μ is the mean value, and σ is the variance.
[0053] Step 2.3: Classify the original data set using the Brich clustering algorithm. The branching_factor is equal to the size of the data set. The value of n_clusters is not specified. A data set with a much larger data volume than other classes is used as normal access data to obtain the training set of the VAE model.
[0054] Step 2.4, set the VAE model network structure and loss function. The VAE model network structure is as follows Figure 1 As shown, it consists of an encoder, a decoder, and a discriminator. The encoder and decoder use a fully connected network (2): i represents the i-th layer of the encoder, d j represents the jth layer of the decoder, (w k ,b k ) represents the parameters of the kth layer of the entire network, x represents the input vector, z represents the hidden variable, and y represents the output vector.
[0055]
[0056] The discriminator estimates the difference between the generated sample and the real sample through the encoder-decoder of the VAE network. The loss function of the encoder is the sum of the loss functions of the two parts of the VAE network output and the discriminator output. The calculation formula is shown in formula (3), where E and D represent the encoder-decoder, m and weight 1 、weight 2 is the weight parameter, N is a random vector that obeys the standard normal distribution, e 2-1 and e 2-2 Represents the two vectors output by the encoder, x represents the input vector and y represents the output vector.
[0057]
[0058] The loss function of the decoder is equal to the reconstruction loss function plus the loss function of the discriminator output. The calculation formula is shown in formula (4).
[0059]
[0060] Among them, weight 1 、weight 2 is the weight parameter, x represents the input vector, y represents the output vector, N is a random number vector that obeys the standard normal distribution, and the calculation formula of the MSE function is shown in formula (5).
[0061] Step 2.5: Use the processed training data set to train the VAE model and save the model parameters. The training model parameters are shown in Table 2. Use the trained VAE model to test the training samples to obtain the mean of the reconstruction loss function, which is used as the threshold for abnormal classification. The reconstruction loss function uses the mean square error (5).
[0062] Table 2
[0063]
[0064]
[0065] The classification effect of the VAE model on this data set is shown in Table 3:
[0066] Table 3
[0067] Accuracy Precision Recall F1 score 98.7% 92.2% 99.8% 0.959
[0068] Step 3: When there is new data or new categories of data, incremental training is performed on the VAE model. The specific process is as follows:
[0069] Step 3.1: When a new behavior pattern category is generated, such as when a new user group is added, the obtained log file is calculated according to the feature data calculation method described in step 2 to obtain a new category data set S i .
[0070] Step 3.2: According to the newly added data set S i The ratio of the size of the original training dataset to the size of the new category dataset S i A random number dataset R of the same size, standard normal distribution, and the same dimension as the feature data. Read the decoder parameters from the original VAE model, input the dataset R into the decoder, and get the same random number as the original dataset X. i-1 Dataset S with the same distribution i-1 .
[0071] Step 3.3: Set the dataset S i-1 And the dataset S i Merge to get data set X i .
[0072] Step 3.4: Retrain the VAE model using the dataset Xi, save the model parameters, test the training samples with the trained VAE model to obtain the mean of the reconstruction loss function, and use this mean as the threshold for anomaly classification.
[0073] Here, one user group is taken as one type of data. The effect of training the VAE model with the single type of user group data and classifying each type of data is shown in Table 4. The accuracy of each type of the VAE model after incremental training is shown in Table 5. The incremental training effect of the VAE model after incremental training is shown in Table 6.
[0074] Table 4
[0075]
[0076]
[0077] Table 5
[0078] category 1 2 3 4 5 Accuracy 0.963 0.974 0.980 0.928 0.896
[0079] Table 6
[0080] Number of categories added Accuracy Precision Recall F1 score 1 0.969 0.901 0.988 0.942 2 0.994 0.988 0.985 0.987 3 0.990 0.966 0.983 0.975 4 0.984 0.930 0.981 0.955 5 0.981 0.919 0.975 0.946
[0081] Step 4: Combine static rules with the VAE model to implement dynamic access control. The specific process is as follows:
[0082] Step 4.1: When an access request is input, the relevant attributes of the request are obtained according to the calculation requirements and rule requirements in steps 1 and 2. The characteristics are shown in Table 1.
[0083] Step 4.2: Input the generated attribute feature vector into the access control engine, and determine whether the request is legal based on the static access rules set in step 1. If it does not meet the rules, access is denied.
[0084] Step 4.3: The access decision process in this step is as follows Figure 3 As shown in the figure, after the request is filtered by the rules, the VAE model trained in step 2 and step 3 is input to calculate the reconstruction loss function. If this value is greater than the threshold, the access behavior is judged as abnormal and the access request is rejected. Otherwise, it is a normal access behavior and the access request is approved.
[0085] Step 4.4: Output the result of the access decision, i.e., deny access or allow access.
[0086] It should be noted that the above embodiments are for illustrative purposes only, but the scope of the present invention is not limited to the above specific embodiments. Without departing from the principles of the present invention, other implementations obtained by those skilled in the art within the framework of the present invention are deemed to be within the scope of protection of the present invention.
Claims
1. A dynamic access control method based on variational autoencoder and attributes, characterized in that: It includes two parts: static rule matching and dynamic access decision based on VAE model, including the following steps: Step 1: Set static rules for access control; Step 2: Obtain log files, extract data features, and train the VAE model; Step 3: When there is new type of user data, perform incremental training on the VAE model; Step 4: Combine static rules with the VAE model to achieve dynamic access control; The step 2 specifically includes the following sub-steps: Step 2.1, obtain the log file, and calculate the characteristics of the user access behavior based on each access request; Step 2.2, digitize and standardize the feature data; Step 2.3: Classify the original data set through the clustering algorithm, and take a data set with a much larger data volume than other classes as normal access data to obtain the training set of the VAE model; Step 2.4, set the VAE model network structure and loss function; Step 2.5: Use the training data set to train the VAE model, calculate the threshold for abnormal classification, and save the model parameters; The VAE model in step 2.4 adopts the Intro-VAE network structure, which consists of an encoder, a decoder and a discriminator; the loss function of the encoder is equal to the sum of the loss functions of the outputs of the VAE network and the discriminator, and the loss function of the decoder is equal to the reconstruction loss function plus the loss function of the discriminator output; the threshold of abnormal classification is equal to the mean of the mean square error obtained by testing the training samples of the trained VAE model; The step 4 specifically includes the following sub-steps: Step 4.1, when an access request is input, calculate the relevant attributes of the request; Step 4.2: Input the generated attribute feature vector into the access control engine, determine whether the request is legal based on the static access rules, and reject requests that do not meet the requirements; Step 4.3: For requests that pass the rule filtering, input their feature vectors into the VAE model to calculate the reconstruction loss function and determine whether they are abnormal requests; Step 4.4: Output the result of the access decision.
2. A dynamic access control method based on variational autoencoder and attributes according to claim 1, characterized in that: The step 1 specifically includes the following sub-steps: Step 1.1: Set static access rules according to the application scenario; Step 1.2: Convert the set static access rules into XACML standard language representation.
3. According to claim 1, a dynamic access control method based on variational autoencoder and attributes is characterized in that: The step 3 specifically includes the following sub-steps: Step 3.1: Digitize and standardize the feature data of the new category according to the process described in step 2.2 to obtain the data set S i ; Step 3.2: Generate a random number dataset R that follows a standard normal distribution and has the same dimension as the feature data. Input the dataset R into the decoder of the original VAE model to obtain the same random number as the original dataset X. i-1 The same distribution of data sets S i-1 ; Step 3.3: Merge dataset S i-1 And dataset S i , get the data set X i ; Step 3.4: Using dataset X i Retrain the VAE model, calculate the threshold for anomaly classification, and save the model parameters.
4. A dynamic access control method based on variational autoencoder and attributes according to claim 3, characterized in that: The random number data set R and data set S in step 3.2 i The size ratio depends on the ratio of the number of original data users to the number of new types of users.
5. The dynamic access control method based on variational autoencoder and attributes according to claim 3, characterized in that: The step 3.4 only needs to save the VAE model parameters after this training for subsequent incremental learning, and there is no need to save the data set used for training.
6. A dynamic access control method based on variational autoencoder and attributes according to claim 1, characterized in that: In step 4.3, the VAE model compares the size of the reconstruction loss function and the abnormal threshold when judging an abnormality. If it is greater than the abnormal threshold, it is an abnormality and access is denied. Otherwise, the access request is approved.
