Home Operation and Maintenance Linux Operation and Maintenance How to properly plan and distinguish different security groups

How to properly plan and distinguish different security groups

Sep 19, 2018 pm 01:23 PM
linux

The content of this article is about how to reasonably plan and distinguish different security groups. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

During the use of security groups, all cloud servers are usually placed in the same security group, which can reduce the initial configuration workload. But in the long run, the interaction of business system networks will become complex and uncontrollable. When performing security group changes, you will not be able to clearly define the scope of adding and removing rules.

Properly planning and distinguishing different security groups will make it easier to adjust your system, organize the services provided by applications, and layer different applications. It is recommended that you plan different security groups for different businesses and set different security group rules.

Distinguish between different security groups

The cloud server and intranet server of the public network service should belong to different security groups as much as possible

Whether public network services are provided to the outside world, including actively exposing certain ports for external access (such as 80, 443, etc.), or passively providing (such as cloud servers with public network IP, EIP, NAT port forwarding rules, etc.) port forwarding rules, will result in Your application may be accessed from the public network.

The security group rules to which the cloud server belongs in the second scenario should adopt the strictest rules. It is recommended to deny priority. By default, all ports and protocols should be closed, and only the ports that provide external services, such as 80, should be exposed. ,443. Since only servers with access to the external public network are grouped, it is easier to control when adjusting security group rules.

The responsibilities for providing server grouping to the outside world should be clear and simple, and avoid providing other services to the outside world on the same server. For example, MySQL, Redis, etc., it is recommended to install these services on a cloud server without public network access, and then access them through group authorization of the security group.

If there is currently a public cloud server that is already in the same security group SG_CURRENT as other applications. You can make changes using the following methods.

Sort out the ports and protocols exposed by the currently provided public network services, such as 80 and 443.

Create a new security group, such as SG_WEB, and then add the corresponding ports and rules.

Description: Authorization policy: Allow, Protocol type: ALL, Port: 80/80, Authorization object: 0.0.0.0/0, Authorization policy: Allow, Protocol type: ALL, Port: 443/443 Authorization object : 0.0.0.0/0.

Select the security group SG_CURRENT, and then add a security group rule to group authorization to allow resources in SG_WEB to access SG_CURRENT.

Description: Authorization policy: Allow, protocol type: ALL, port: -1/-1, authorization object: SG_WEB, priority: customized according to the actual situation [1-100].

Add an instance ECS_WEB_1 that needs to switch the security group to the new security group.

In the ECS console, select Security Group Management.

Select SG_WEB > Manage Instances > Add Instance, select instance ECS_WEB_1 to join the new security group SG_WEB, and confirm that the traffic and network of the ECS_WEB_1 instance are working properly.

Remove ECS_WEB_1 from the original security group.

In the ECS console, select Security Group Management.

Select SG_CURRENT > Manage Instance > Remove the instance, select ECS_WEB_1, remove from SG_CURRENT, test network connectivity, and confirm that the traffic and network are working properly.

If it does not work properly, add ECS_WEB_1 back to the security group SG_CURRENT, check whether the set SG_WEB exposed port is as expected, and then continue to change.

Perform other server security group changes.

Different applications use different security groups

In a production environment, different operating systems will not belong to the same application in most cases Grouped to provide load balancing services. Providing different services means that the ports that need to be exposed and the ports that are denied are different. It is recommended that different operating systems belong to different security groups as much as possible.

For example, for the Linux operating system, you may need to expose the TCP (22) port to implement SSH, and for Windows, you may need to open a TCP (3389) remote desktop connection.

In addition to different operating systems belonging to different security groups, even if the same image type provides different services, if they do not need to be accessed through the intranet, it is best to belong to different security groups. This facilitates decoupling and changes to future security group rules to achieve a single responsibility.

When planning and adding new applications, in addition to considering dividing different virtual switch configuration subnets, you should also plan security groups reasonably. Use network segment security groups to constrain yourself as a boundary between service providers and consumers.

For the specific change process, please refer to the above steps.

The production environment and the test environment use different security groups

In order to better isolate the system, during the actual development process, you Multiple sets of test environments and an online environment may be built. In order to achieve more reasonable network isolation, you need to use different security policies for different environment configurations to prevent changes in the test environment from being refreshed online and affecting online stability.

By creating different security groups, limit the access domain of the application to prevent the production environment and test environment from being connected. At the same time, different security groups can also be assigned to different test environments to avoid mutual interference between multiple test environments and improve development efficiency.

Only allocate public network IP to subnets or cloud servers that require public network access

Whether it is a classic network or a private network (VPC) Among them, reasonable allocation of public network IP can make the system more convenient for public network management and reduce the risk of system attacks. In a private network scenario, when creating a virtual switch, it is recommended that you try to put the IP ranges of the service areas that require public network access into several fixed switches (subnet CIDR) to facilitate auditing and differentiation and avoid accidental exposure. Public network access.

In distributed applications, most applications have different layers and groups. For cloud servers that do not provide public network access, try not to provide public network IP. If there are multiple servers providing public network access, , it is recommended that you configure the load balancing service for public network traffic distribution to serve the public network to improve system availability and avoid single points.

Try not to assign public IP addresses to cloud servers that do not require public network access. When your cloud server needs to access the public network in a private network, it is first recommended that you use a NAT gateway to provide proxy services for accessing the Internet for ECS instances that do not have a public IP in the VPC. You only need to configure the corresponding SNAT rules. It can provide public network access capabilities for specific CIDR network segments or subnets. For detailed configuration, see SNAT. Avoid exposing services to the public network after assigning a public IP (EIP) because you only need the ability to access the public network.

Minimum Principle

The security group should be whitelisted, so it is necessary to open and expose the least ports as much as possible, and at the same time as little as possible Assign a public IP. If you want to access online machines for task logs or error troubleshooting, it is simple to directly assign a public IP or mount an EIP, but after all, the entire machine will be exposed to the public network. A safer strategy is to manage it through a springboard machine. .

Using the springboard machine

The springboard machine has huge authority, in addition to making audit records through tools. In a private network, it is recommended to allocate the springboard machine to a dedicated virtual switch and provide it with the corresponding EIP or NAT port forwarding table.

First create a dedicated security group SG_BRIDGE, such as opening the corresponding port, such as Linux TCP (22) or Windows RDP (3389). In order to limit the network access rules of the security group, you can limit the authorized objects that can log in to the enterprise's public network exit range, reducing the probability of being logged in and scanned.

Then add the cloud server as the springboard machine to the security group. In order to allow this machine to access the corresponding cloud server, you can configure the corresponding group authorization. For example, add a rule in SG_CURRENT to allow SG_BRIDGE to access certain ports and protocols.

When using springboard SSH, it is recommended that you give priority to logging in using an SSH key pair instead of a password.

In short, reasonable security group planning will make it easier for you to expand your application and make your system more secure.

The above is the detailed content of How to properly plan and distinguish different security groups. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Unable to log in to mysql as root Unable to log in to mysql as root Apr 08, 2025 pm 04:54 PM

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

Solutions to the errors reported by MySQL on a specific system version Solutions to the errors reported by MySQL on a specific system version Apr 08, 2025 am 11:54 AM

The solution to MySQL installation error is: 1. Carefully check the system environment to ensure that the MySQL dependency library requirements are met. Different operating systems and version requirements are different; 2. Carefully read the error message and take corresponding measures according to prompts (such as missing library files or insufficient permissions), such as installing dependencies or using sudo commands; 3. If necessary, try to install the source code and carefully check the compilation log, but this requires a certain amount of Linux knowledge and experience. The key to ultimately solving the problem is to carefully check the system environment and error information, and refer to the official documents.

How to solve mysql cannot be started How to solve mysql cannot be started Apr 08, 2025 pm 02:21 PM

There are many reasons why MySQL startup fails, and it can be diagnosed by checking the error log. Common causes include port conflicts (check port occupancy and modify configuration), permission issues (check service running user permissions), configuration file errors (check parameter settings), data directory corruption (restore data or rebuild table space), InnoDB table space issues (check ibdata1 files), plug-in loading failure (check error log). When solving problems, you should analyze them based on the error log, find the root cause of the problem, and develop the habit of backing up data regularly to prevent and solve problems.

Can mysql run on android Can mysql run on android Apr 08, 2025 pm 05:03 PM

MySQL cannot run directly on Android, but it can be implemented indirectly by using the following methods: using the lightweight database SQLite, which is built on the Android system, does not require a separate server, and has a small resource usage, which is very suitable for mobile device applications. Remotely connect to the MySQL server and connect to the MySQL database on the remote server through the network for data reading and writing, but there are disadvantages such as strong network dependencies, security issues and server costs.

Unable to access mysql from terminal Unable to access mysql from terminal Apr 08, 2025 pm 04:57 PM

Unable to access MySQL from the terminal may be due to: MySQL service not running; connection command error; insufficient permissions; firewall blocks connection; MySQL configuration file error.

What is the most use of Linux? What is the most use of Linux? Apr 09, 2025 am 12:02 AM

Linux is widely used in servers, embedded systems and desktop environments. 1) In the server field, Linux has become an ideal choice for hosting websites, databases and applications due to its stability and security. 2) In embedded systems, Linux is popular for its high customization and efficiency. 3) In the desktop environment, Linux provides a variety of desktop environments to meet the needs of different users.

Monitor MySQL and MariaDB Droplets with Prometheus MySQL Exporter Monitor MySQL and MariaDB Droplets with Prometheus MySQL Exporter Apr 08, 2025 pm 02:42 PM

Effective monitoring of MySQL and MariaDB databases is critical to maintaining optimal performance, identifying potential bottlenecks, and ensuring overall system reliability. Prometheus MySQL Exporter is a powerful tool that provides detailed insights into database metrics that are critical for proactive management and troubleshooting.

How to solve the problem of missing dependencies when installing MySQL How to solve the problem of missing dependencies when installing MySQL Apr 08, 2025 pm 12:00 PM

MySQL installation failure is usually caused by the lack of dependencies. Solution: 1. Use system package manager (such as Linux apt, yum or dnf, Windows VisualC Redistributable) to install the missing dependency libraries, such as sudoaptinstalllibmysqlclient-dev; 2. Carefully check the error information and solve complex dependencies one by one; 3. Ensure that the package manager source is configured correctly and can access the network; 4. For Windows, download and install the necessary runtime libraries. Developing the habit of reading official documents and making good use of search engines can effectively solve problems.

See all articles