Machine learning in a continuous integration and deployment environment for compliance and security of infrastructure as code
View Patent ↗In an approach for policy security shifting left of infrastructure as code compliance, a processor trains a neural network model to classify a code per policy and provide a policy vector score for the code associated with one or more policies. A processor enables the neural network model to scan and score a new code during a continuous integration and continuous deployment pipeline. A processor outputs a scanned score of the new code to a user. A processor retrains the neural network model by capturing a continuous integration and continuous deployment change and run-time compliance posture that occurs as a response by the user.
1 . A computer-implemented method comprising:
training, by one or more processors using training data, a neural network model to classify a code, included in the training data, per policy of a plurality of policies and provide a vector of scores for the code,
wherein each score of the vector of scores indicates a level of possibility of complying with a respective policy of the plurality of policies,
wherein the training the neural network model includes adjusting weights of interconnections between intermediate layers of the neural network model,
wherein the training data includes one or more modifications of the code, and
wherein the one or more modifications of the code are selected from a group consisting of an addition of random keywords to the code, a scrambling of the code, blocks of the code re-ordered, lines within a block of the code re-ordered, tokens of the code renamed, and combinations thereof, and
wherein the training data is labeled using a vector of labels indicating a compliance check result of deploying the code and a cost-estimate or a performance-estimate of deploying the code;
generating a blocking alert based at least in part on a determination of a magnitude of the vector of scores for the code; and
retraining, by one or more processors, the neural network model by capturing a continuous integration and continuous deployment change and run-time compliance posture that occurs as a response by a user, and
wherein the neural network model is a convolutional neural network model, a recurrent neural network model, a transformer neural network model, or a combination of the convolutional neural network model and the recurrent neural network model.
2 . The computer-implemented method of claim 1 , further comprising:
enabling the neural network model,
wherein the enabling includes scanning a new code while the user types the new code.
3 . The computer-implemented method of claim 1 ,
wherein the code is an infrastructure as code.
4 . The computer-implemented method of claim 1 ,
wherein the plurality of policies comprises an industry-specific methodology requirement and a cost estimate check.
5 . A non-transitory computer-readable medium storing a set of instructions for wireless communication, the set of instructions comprising:
one or more instructions that, when executed by one or more processors of a device, cause the device to:
train, using training data, a neural network model to classify a code, included in the training data, per policy of a plurality of policies and provide a vector of scores for the code, wherein each score of the vector of scores indicates a level of possibility of complying with a respective policy of the plurality of policies, wherein the one or more instructions, to cause the device to train the neural network model, cause the device to adjust weights of interconnections between intermediate layers of the neural network model, wherein the training data includes one or more modifications of the code, and wherein the one or more modifications of the code included in the training data are selected from a group consisting of an addition of random keywords to the code, a scrambling of the code, blocks of the code re-ordered, lines within a block of the code re-ordered, tokens of the code renamed, and combinations thereof, and wherein the training data is labeled using a vector of labels indicating a compliance check result of deploying the code and a cost-estimate or a performance-estimate of deploying the code;
generate a blocking alert based at least in part on a determination of a magnitude of the vector of scores for the code; and
retrain the neural network model by capturing a continuous integration and continuous deployment change and run-time compliance posture that occurs as a response by a user, and
wherein the neural network model is a convolutional neural network model, a recurrent neural network model, a transformer neural network model, or a combination of the convolutional neural network model and the recurrent neural network model.
6 . The non-transitory computer-readable medium of claim 5 ,
wherein the one or more instructions cause the device to:
enable the neural network model which includes program instructions to scan a new code while the user types the new code.
7 . The non-transitory computer-readable medium of claim 5 ,
wherein the code is an infrastructure as code.
8 . The non-transitory computer-readable medium of claim 5 ,
wherein the plurality of policies comprises an industry-specific methodology requirement and a cost estimate check.
9 . A computer system, comprising:
one or more processors; and
one or more memory devices coupled to the one or more processors, wherein the one or more processors are configured to:
train a neural network model using training data to classify a code, included in the training data, per policy of a plurality of policies and provide a vector of scores for the code, wherein each score of the vector of scores indicates a level of possibility of complying with a respective policy of the plurality of policies, wherein the one or more processors, to train the neural network model, are configured to adjust weights of interconnections between intermediate layers of the neural network model, wherein the training data includes one or more modifications of the code, and wherein the one or more modifications of the code are selected from a group consisting of an addition of random keywords to the code, a scrambling of the code, blocks of the code re-ordered, lines within a block of the code re-ordered, tokens of the code renamed, and combinations thereof, and wherein the training data is labeled using a vector of labels indicating a compliance check result of deploying the code and a cost-estimate or a performance-estimate of deploying the code;
generate a blocking alert based at least in part on a determination of a magnitude of the vector of scores for the code; and
retrain the neural network model by capturing a continuous integration and continuous deployment change and run-time compliance posture that occurs as a response by a user, and
wherein the neural network model is a convolutional neural network model, a recurrent neural network model, a transformer neural network model, or a combination of the convolutional neural network model and the recurrent neural network model.
10 . The computer system of claim 9 ,
wherein the one or more processors are configured to:
enable the neural network model which includes program instructions to scan a new code while the user types the new code.
11 . The computer system of claim 9 ,
wherein the code is an infrastructure as code.
12 . The computer system of claim 9 ,
wherein the plurality of policies comprises an industry-specific methodology requirement and a cost estimate check.
13 . The computer-implemented method of claim 1 ,
wherein the training data comprises a vector of labels that present a result of deploying the code and running post-deployment checks on a deployed account.
14 . The computer-implemented method of claim 1 , further comprising:
labeling another code by deploying the code to a cloud account and running a configuration scan on the code.
15 . The computer-implemented method of claim 1 ,
wherein each score in the vector of scores has a value that increases as the code has a higher probability of complying with the respective policy.