Method for configuring template to synchronize default security group rule
By automatically detecting user modifications, only synchronizing default security group rules when the first access or the rules are consistent, it solves the problem of lack of default security group rules synchronization in cloud computing platforms, realizes consistency and batch creation of security group data, and simplifies the Operation process improves safety and flexibility.
Patent Information
- Application Number
- CN202410955857.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-07-17
AI Technical Summary
In cloud computing platforms, the lack of a default security group rule synchronization mechanism leads to inconvenient access control of cloud hosts and affects business security and efficiency.
Provide a method to configure templates to synchronize default security group rules. By automatically detecting whether the user has modified security group rules, it can only synchronize default security group rules when the first access is made or when the rules are consistent, ensuring that it does not affect user business and realizes security group data. Consistency and batch creation.
It realizes flexible configuration and batch creation of security group rules, ensures consistency and correctness of security group data, simplifies operational processes, improves security, does not rely on physical hardware equipment, and adapts to different needs.
Smart Images

Figure CN119094150A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of cloud computing and computer networks, and in particular to a method for synchronizing default security group rules with a configuration template. Background Art
[0002] At present, various industries are gradually integrating their business systems through cloud computing platforms. For security reasons, they can all use VPC technology for network security isolation. VPC stands for Virtual Private Cloud. VPC technology allows tenants to have an area in the cloud that is logically isolated from other tenants and use various cloud resources in this area. Tenants can fully control the virtual network on the cloud. With the popularization of cloud services, the demand for cloud hosts to use security groups has also emerged. Security groups are a virtual firewall with stateful packet filtering functions. They are used to set network access control for cloud servers, load balancing, cloud databases and other instances, and control instance-level inbound and outbound traffic. They are an important means of network security isolation. You can configure security group rules to allow or prohibit outbound and inbound traffic of instances in a security group. A security group is a logical grouping. You can add cloud servers, elastic network cards, cloud databases and other instances with the same network security isolation requirements in the same region to the same security group. When creating a new security group, you can choose from the three provided security group templates: open ports 22, 3389, 80, 443 and ICMP protocol, open all ports and customize. If the cloud platform does not set up a security group template in the early stage, and later needs to add default rules to the default security group, it is necessary to consider the synchronization mechanism of the security group rules. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a method for synchronizing default security group rules with a configuration template, which does not affect the user's business and does not synchronize the default security group rules, thus ensuring the normal operation of the customer's business.
[0004] The technical solution of the present invention is:
[0005] A method for synchronizing default security group rules with a configuration template. When a user accesses a security group for the first time, rules are automatically added to the default security group. It is detected that the rule data on OpenStack is four rules when the security group is created and the user has not manually modified them. At this time, the set template rules are automatically added under the default security group. If it is detected that the user has modified the security group rules, the default security group rules are not synchronized in order not to affect the user's business.
[0006] Furthermore,
[0007] The purpose of introducing the configuration template to synchronize the default security group rules is to configure the default security group through template management, mark the synchronized security group, ensure the consistency of security group data, and implement batch creation of security group rules, which is simple and fast.
[0008] This solution configures templates to synchronize default security group rules and does not rely on a single physical hardware device. It can flexibly manage configurations and configure default security group templates according to needs, with high security.
[0009] After the security group rules are synchronized, add a tag to the default security group and check that the security group rules are consistent with the rules configured in the security group template. The next time you query the security group list, if the security group tag exists, you do not need to synchronize the default security group rules to ensure data consistency and correctness.
[0010] Going further,
[0011] Create a default security group template, including adding in rules, modifying in rules, deleting in rules, adding out rules, modifying out rules, and deleting out rules; the rule content includes: type, i.e. IPv4 and IPv6, protocol / application, port range / ICMP type, source, and description; after the template configuration is completed, the user logs in to the console to synchronize the default security group rules.
[0012] Going further,
[0013] When a user logs in to the console interface and views the security group list or creates a cloud server or other resource, the security group list interface will first query whether the default security group under the user is marked as default.
[0014] If there is a default mark, it means that the user has already synchronized the security group rules and does not need to be synchronized again. The security group list information under the user is directly returned.
[0015] If the default security group is not tagged with "default", you need to compare the rules of the default security group to see if they are the rules when the security group was created, and determine if the user has modified the rules. If the current security group rules are consistent with the original rules, you need to synchronize the default security group rules according to the default security group template set by the network management platform, and tag the default security group with "default", indicating that the template has been synchronized, and it will not be synchronized the next time you access the security group list. If the current security group rules are inconsistent with the original rules, it means that the user has modified them. At this time, you do not need to synchronize the rules of the default security group to ensure the normal operation of user services.
[0016] The rules are:
[0017] The first rule is to allow the same security group rule with the source of IPv4 all ports and all protocols as default;
[0018] The second rule is to allow the same security group rule with the source of IPv6 all ports and all protocols as default;
[0019] The third rule is to open the rule where the source of all IPv4 ports is all;
[0020] The fourth rule is to open the rule for all IPv6 ports with the source as all.
[0021] When the user logs in to the console interface and clicks to create a security group, the tenant can choose from the three provided security group templates: open ports 22, 3389, 80, 443 and ICMP protocol, open all ports, and custom; after selecting the corresponding template, the corresponding rules will be automatically created under the created security group, and the rule description information will be added. When the user selects the first template: the inbound rule will add rules to open the same security group, open the intranet, open the Ping service, open Linux SSH login, open Windows remote login, and open the WEB service port, and the outbound rule will open everything; when the user selects the second template: both the inbound rule and the outbound rule will open everything; when the user selects the third template: the inbound rule denies all traffic, and the outbound rule opens everything; after the security group is created, you can view the security group list, view security group details, modify the security group name, delete the security group, view the inbound rule and outbound rule list, add rules, modify rules, and delete rules.
[0022] Going further,
[0023] The method implementation architecture includes the following modules: 1) northbound interface module, 2) database, 3) network platform management module, 4) security group management module;
[0024] 1) The northbound interface module is used to provide REST APIs to the outside world, so as to enable users to create networks, create cloud hosts, and synchronize default security group rules. For example, by providing tenant ID, network segment CIDR, and region, users can create networks, create subnets, delete subnets, delete virtual private networks, create security groups, delete security groups, view security group lists, and synchronize default security group rules.
[0025] 2) The database module stores relevant tenants, virtual private networks, subnets, security groups, and security group synchronization tag information; all relevant information established by tenants through the network platform management module and the security group management module is stored in the database;
[0026] 3) The network platform management module is used to manage the default security group template;
[0027] 4) The security group management module is used to manage security groups, including querying the security group list, viewing security group details, creating a security group, deleting a security group, updating the security group name, querying the input rule list, querying the output rule list, adding rules, deleting rules, and modifying rules.
[0028] in,
[0029] The network platform management module is used to manage the default security group rules. You can view the input rule list, view the output rule list, add rules, modify rules, and delete rules. You can add templates according to user needs. After the template is added, it takes effect immediately. It is not allowed to add existing rules of the default security group. The two input rules include the same security group rules that allow IPv4 and IPv6 to pass, and the two output rules include allowing all IPv4 and IPv6 to pass.
[0030] When a tenant accesses the security group list function, it first checks whether the default security group under the user is marked as default.
[0031] If there is a default mark, it means that the user has synchronized the security group rules and does not need to be synchronized again. The security group list information of the user is directly returned;
[0032] If the default security group is not tagged with default, you need to compare the rules of the default security group to see if they are the same as the rules used when the security group was created.
[0033] The beneficial effects of the present invention are
[0034] 1) After adopting the solution of synchronizing the default security group rules with the configuration template of the present invention, the default security group template can be flexibly configured, the synchronized security group can be marked, the consistency of the security group data can be ensured, and batch creation of security group rules can be realized, which is simple and fast to operate.
[0035] 2) The solution configures the template to synchronize the default security group rules, which does not rely on a single physical hardware device. It can flexibly manage the configuration and configure the default security group template according to needs, which has higher security. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 Flowchart for synchronizing default security group rules for configuration templates;
[0037] Figure 2 The implementation architecture diagram for synchronizing default security group rules for configuration templates;
[0038] Figure 3 This section describes how to synchronize the default security group rules for the configuration template. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0040] The present invention proposes a method for synchronizing default security group rules with a configuration template for a cloud computing management platform based on OpenStack.
[0041] (1) Use administrator privileges to create a default security group template on the network management platform. The template name is security-group-template. This template only synchronizes rules for the default security group under the user account. You can configure inbound and outbound rules without quota restrictions. Administrators can view the default security group template, add inbound rules, modify inbound rules, delete inbound rules, add outbound rules, modify outbound rules, and delete outbound rules. The rule content mainly includes: type (IPv4 and IPv6), protocol / application (TCP, UDP, ICMP, SSH, Telnet, etc.), port range / ICMP type, source, and description. After the template configuration is completed, the user logs in to the console to synchronize the default security group rules.
[0042] (2) When a tenant logs in to the console interface and views the security group list or creates a cloud server or other resource, the security group list can be viewed. The security group list interface will first query whether the default security group under the user has been tagged with the default tag. If the default tag is present, it means that the user has synchronized the security group rules and does not need to synchronize again. The security group list information under the user is directly returned.
[0043] (3) When a tenant logs in to the console interface and views the security group list or creates a cloud server or other resources, the security group list can be viewed. If the default security group is not tagged with default, the default security group rules need to be compared to see if they are the same as the four rules used when the security group was created. The four rules are: the first rule is to allow the same security group rules with the source of IPv4 all ports and all protocols as default, the second rule is to allow the same security group rules with the source of IPv6 all ports and all protocols as default, the third rule is to allow the rule with the source of IPv4 all ports as all, and the fourth rule is to allow the rule with the source of IPv6 all ports as all. This can be used to determine whether the user has modified the rules. If the current security group rules are consistent with the original rules, the default security group rules need to be synchronized according to the default security group template set by the network management platform, and the default security group needs to be tagged with default, indicating that the template has been synchronized and will not be synchronized the next time the security group list is accessed. If the current security group rules are inconsistent with the original rules, it means that the user has modified them. In this case, there is no need to synchronize the default security group rules to ensure the normal operation of user services.
[0044] (4) When the tenant logs in to the console interface and clicks to create a security group, the tenant can choose from the three provided security group templates: open ports 22, 3389, 80, 443 and ICMP protocol, open all ports, and custom. After selecting the corresponding template, the corresponding rules will be automatically created under the created security group, and the rule description information will be added. When the user selects the first template: the inbound rule will add rules to open the same security group, open the intranet, open the Ping service, open Linux SSH login, open Windows remote login, and open the WEB service port, and the outbound rule will open everything; when the user selects the second template: both the inbound rule and the outbound rule will open everything; when the user selects the third template: the inbound rule denies all traffic, and the outbound rule opens everything. After the security group is created, you can view the security group list, view security group details, modify the security group name, delete the security group, view the inbound rule and outbound rule list, add rules, modify rules, and delete rules.
[0045] The implementation structure diagram of the present invention is as follows Figure 1 As shown: It includes the following modules: 1) Northbound interface module 2) Database 3) Network platform management module 4) Security group management module
[0046] The northbound interface module is mainly used to provide REST APIs to enable tenants to create networks, create cloud hosts, and synchronize default security group rules. For example, tenant ID, network segment CIDR, and region are provided to create networks, create subnets, delete subnets, delete virtual private networks, create security groups, delete security groups, view security group lists, and synchronize default security group rules.
[0047] The database module stores information about related tenants, virtual private networks, subnets, security groups, security group synchronization tags, etc. All relevant information established by tenants through the network platform management module and the security group management module is stored in the database.
[0048] The network platform management module is mainly used to manage the default security group template. This template is used to manage the default security group rules. You can view the inbound rule list, view the outbound rule list, add rules, modify rules, and delete rules. Administrators can add templates based on user needs. After the template is added, it takes effect immediately. It is not allowed to add the four rules that already exist in the default security group. The two inbound rules include the same security group rules that allow IPv4 and IPv6 to pass, and the two outbound rules include allowing all IPv4 and IPv6 to pass.
[0049] The security group management module is used to manage security groups, including querying the security group list, viewing security group details, creating security groups, deleting security groups, updating security group names, querying the in-rule list, querying the out-rule list, adding rules, deleting rules, and modifying rules. When a tenant accesses the security group list function, first query whether the default security group under the user has been tagged with default. If there is a default tag, it means that the user has synchronized the security group rules and does not need to synchronize again. The security group list information under the user is directly returned. If the default security group is not tagged with default, it is necessary to compare whether the rules of the default security group are the four rules when the security group was created. The four rules are: the first rule is to allow the same security group rule with the source of the inbound rule IPv4 all ports all protocols as default, the second rule is to allow the same security group rule with the source of the inbound rule IPv6 all ports all protocols as default, the third rule is to allow the rule with the source of the outbound rule IPv4 all ports as all, and the fourth rule is to allow the rule with the source of the outbound rule IPv6 all ports as all. This determines whether the user has modified the rules. If the current security group rules are consistent with the original rules, the default security group rules need to be synchronized according to the default security group template set by the network management platform, and the default security group is tagged with default, indicating that the template has been synchronized. The next time the security group list is accessed, it will not be synchronized. If the current security group rules are inconsistent with the original rules, it means that the user has modified them. At this time, there is no need to synchronize the default security group rules to ensure the normal operation of user services.
[0050] like Figure 3 As shown, take the configuration template to synchronize the default security group rules as an example:
[0051] Prerequisites:
[0052] There is a subnet subnet1 under a network network1, and a subnet subnet2 under a network network2. Network1 belongs to user account a, and network2 belongs to user account b.
[0053] 1. The network platform management module uses administrator privileges to create a default security group template.
[0054] 2. Call the northbound interface to query the virtual private network list and subnet list, select the security group, and user A and user B call the API to create a cloud host respectively.
[0055] 3. The northbound interface management module first writes the network and subnet into the database.
[0056] 4. In the security group management module, view the default security group rules in the security group list in step 2, and add inbound and outbound rules to the default security group according to the security group template.
[0057] 5. After the default security group rule data is synchronized, the security group synchronization identification record is stored in the database and the default security group is tagged.
[0058] At this point, the configuration template synchronization default security group rules is complete.
[0059] The above description is only a preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for synchronizing default security group rules with a configuration template, characterized in that: By setting a default security group template on the network management platform, rules are automatically added to the default security group when a user accesses the security group for the first time. If the rule data on OpenStack is the rules when the security group is created and the user has not manually modified them, the set template rules are automatically added to the default security group. If it is detected that the user has modified the security group rules, the default security group rules are not synchronized.
2. The method according to claim 1, characterized in that Configure the default security group through template management and mark the synchronized security group. After the security group rules are synchronized, add a tag to the default security group and check that the security group rules are consistent with the rules configured in the security group template. The next time you query the security group list, if the security group tag exists, you do not need to synchronize the default security group rules.
3. The method according to claim 1, characterized in that: Create a default security group template, including adding in rules, modifying in rules, deleting in rules, adding out rules, modifying out rules, and deleting out rules; the rule content includes: type, i.e. IPv4 and IPv6, protocol / application, port range / ICMP type, source, and description; after the template configuration is completed, the user logs in to the console to synchronize the default security group rules.
4. The method according to claim 1, characterized in that When a user logs in to the console interface and views the security group list or creates a cloud server or other resource, the security group list interface will first query whether the default security group under the user is marked as default. If there is a default mark, it means that the user has already synchronized the security group rules and does not need to be synchronized again. The security group list information under the user is directly returned. If the default security group is not tagged with "default", you need to compare the rules of the default security group to see if they are the rules when the security group was created, and determine if the user has modified the rules. If the current security group rules are consistent with the original rules, you need to synchronize the default security group rules according to the default security group template set by the network management platform, and tag the default security group with "default", indicating that the template has been synchronized, and it will not be synchronized the next time you access the security group list. If the current security group rules are inconsistent with the original rules, it means that the user has modified them. At this time, you do not need to synchronize the rules of the default security group to ensure the normal operation of user services.
5. The method according to claim 4, characterized in that The rules are: The first rule is to allow the same security group rule with the source of IPv4 all ports and all protocols as default; The second rule is to allow the same security group rule with the source of IPv6 all ports and all protocols as default; The third rule is to open the rule where the source of all IPv4 ports is all; The fourth rule is to open the rule for all IPv6 ports with the source as all.
6. The method according to claim 5, characterized in that When the user logs in to the console interface and clicks to create a security group, the tenant can choose from the three provided security group templates: open ports 22, 3389, 80, 443 and ICMP protocol, open all ports, and custom; after selecting the corresponding template, the corresponding rules will be automatically created under the created security group, and the rule description information will be added.
7. The method according to claim 6, characterized in that When the user selects the first template: the inbound rules will add rules to allow the same security group, the intranet, the Ping service, Linux SSH login, Windows remote login, and the WEB service port, and the outbound rules will allow everything; when the user selects the second template: both the inbound and outbound rules allow everything; when the user selects the third template: the inbound rules deny all traffic, and the outbound rules allow everything; After a security group is created, you can view the security group list, view security group details, modify the security group name, delete the security group, view the inbound and outbound rule lists, add rules, modify rules, and delete rules.
8. The method according to claim 6, characterized in that The method implementation architecture includes the following modules: 1) northbound interface module, 2) database, 3) network platform management module, 4) security group management module; 1) The northbound interface module is used to provide REST APIs to the outside world, so as to enable users to create networks, create cloud hosts, and synchronize default security group rules. For example, by providing tenant ID, network segment CIDR, and region, users can create networks, create subnets, delete subnets, delete virtual private networks, create security groups, delete security groups, view security group lists, and synchronize default security group rules. 2) The database module stores relevant tenants, virtual private networks, subnets, security groups, and security group synchronization tag information; all relevant information established by tenants through the network platform management module and the security group management module is stored in the database; 3) The network platform management module is used to manage the default security group template; 4) The security group management module is used to manage security groups, including querying the security group list, viewing security group details, creating a security group, deleting a security group, updating the security group name, querying the input rule list, querying the output rule list, adding rules, deleting rules, and modifying rules.
9. The method according to claim 8, characterized in that The network platform management module is used to manage the default security group rules. You can view the input rule list, view the output rule list, add rules, modify rules, and delete rules. You can add templates according to user needs. After the template is added, it takes effect immediately. It is not allowed to add existing rules of the default security group. The two input rules include the same security group rules that allow IPv4 and IPv6 to pass, and the two output rules include allowing all IPv4 and IPv6 to pass.
10. The method according to claim 8, characterized in that When a tenant accesses the security group list function, it first checks whether the default security group under the user is marked as default. If there is a default mark, it means that the user has synchronized the security group rules and does not need to be synchronized again. The security group list information of the user is directly returned; If the default security group is not tagged with default, you need to compare the rules of the default security group to see if they are the same as the rules used when the security group was created.
Citation Information
Patent Citations
Method and system for realizing security group based on NSX-T
CN116366315A
Method for realizing access control of internal and external network white lists by Redis high-availability instance on cloud
CN117714178A
Network segmentation by automatically generated security groups
US11240203B1
Cited By
Cloud physical host security group management method, device, equipment and medium
CN119996020A
A method, apparatus, device, and medium for managing security groups on cloud physical hosts.
CN119996020B
