# ADLBiLSTM: A Semantic Generation Algorithm for Multi-Grammar Network Access Control Policies
## 1 Introduction  
Network access control policies are a commonly used method to implement organizational security policies [1]. They define a series of rules and actions to match and process network packets. These rules are set based on various factors such as source address, destination address, port number, protocol type, etc., to ensure that only packets that meet specific conditions can pass through the network. However, in practical applications, the configuration and management of network access control policies face many challenges. Traditional network access control configuration methods mainly rely on manual operations, but due to the low readability of policies [2; 3; 4], manual configuration is inefficient and prone to errors and when new security threats emerge, manual modification and updating of policies are required, resulting in poor scalability [5; 6; 7; 8], which can lead to serious security issues in the network [9]. At the same time, the lack of unified standards and specifications increases the difficulty of configuring network access control policies with different grammars. Therefore, the automatic semantic generation of security policies is particularly important. Automatic semantic generation can effectively parse security policies with different syntaxes, realize the automation of network access control configuration, and thus improve configuration efficiency and reduce errors. However, there are currently few studies on the automation of security policy semantic generation. In the early stage, semantic generation mainly relied on manual work to transform security policies into machine-understandable languages. Later, compilers were used to semantically generate security policies, but it requires manual settings beforehand and only adapts to fixed security policies. Nowadays, the compilation technique proposed by researchers [10] can work without human intervention, but it is still only suitable for monolingual grammar and cannot cope with multilingual environments, which has become a bottleneck for theautomation of network access control configuration. Regarding the current limitation of security policy semantic generation techniques in accommodating multi-grammar environments, this paper aimed to implement an algorithm that can automatically generate security policy semantics for multiple grammars. Inspired by the advancements in natural language processing, this paper abstracted the task of automatic security policy semantic generation as a sequence labeling task in natural language processing and proposes a network security policy semantic generation algorithm named ADLBiLSTM, which is used to generate semantics for different types and grammatical structures of security policies. This model combines a self-attention mechanism and double-layer BiLSTM for automatic feature extraction, which is used to generate semantics for security policies with different grammars and assist in the management of network security policies. Our contributions in this work can be summarized as follows.  
(1) We propose an algorithm for semantic generation of network security policies, which combines the self-attention mechanism with a double-layer BiLSTM to automatically extract features of network security policies from different levels and generate semantics accordingly.  
(2) Through experiments, we verify that the model performs excellently in automatically generating semantics for network security policies of different types and grammars.  
This paper is organized as follows. Section 2 reviews related works. We propose the semantic generation algorithm in Section 3. We provide the evaluating experiments in Section 4. Section 5 concludes the paper.