Simple Application Server uses firewalls instead of ECS security groups to control network access. A firewall controls inbound traffic to your Simple Application Server instances through firewall rules. You can add, modify, disable, enable, and delete firewall rules to secure your instances.
How it works
By default, the firewall for each Simple Application Server instance allows traffic on specific ports based on the operating system. All other ports are disabled. You can add firewall rules to allow traffic on additional ports as needed.
-
TCP protocol:
-
Windows: Ports 3389, 80, and 443 are allowed by default for the TCP protocol.
-
Linux: Ports 22, 80, and 443 are allowed by default for the TCP protocol.
-
-
ICMP protocol: All ports are allowed by default (port range set to -1), permitting access from any source IP address.
If you delete or disable these default rules in the console, a message such as You disabled or deleted the default allow rule for port 22, which affects the remote connection feature appears on the firewall page. You can add or enable the corresponding rules as needed.
Limitations
-
You can create a maximum of 50 firewall rules for a single Simple Application Server instance.
-
Port 25 is the default email service port. For security reasons, port 25 is restricted by default on Simple Application Server instances. If you need to send emails, use port 465.
-
The firewall can control only the inbound traffic of a Simple Application Server instance. All outbound traffic is allowed by default.
Note-
Inbound traffic: Data transmitted to an instance from the public network or an internal network.
-
Outbound traffic: Data transmitted from an instance to the public network or an internal network.
-
Firewall settings
If you have a firewall template, you can use it to quickly configure firewall rules. For more information, see Set firewall rules by using a firewall template.
-
Go to the Servers page in the Simple Application Server console.
-
Find the target Simple Application Server instance and click its ID on the instance card.
-
Click the Firewall tab.
-
In the upper-left corner of the Firewall page, click Add Rules.
-
In the Add Firewall Rule dialog box, configure the parameters and click Confirm.
Warning-
When adding a firewall rule, configure the port range and allowed source IP addresses based on the principle of least privilege to prevent network attacks.
-
If you add a firewall rule with the same port, protocol, and source IP address as an existing rule, the new rule overwrites the existing one, regardless of whether the existing rule is enabled or disabled.
Preset rules
Select a preset rule to add it quickly.
Parameter
Description
Application type
Select an application type based on your needs, such as RDP, FTP, TELNET, MYSQL, All TCP, All UDP, or All TCP+UDP. For more information, see Preset ports.
Protocol
Displays the default protocol, which cannot be changed.
Port range
Displays the default port, which cannot be changed.
Source IP address
The default value is 0.0.0.0/0, which allows access from all IPv4 addresses.
ImportantConfigure this parameter based on the principle of least privilege to prevent network attacks.
Description
Enter a description to help you identify and manage the rule.
Custom rules
If preset rules do not meet your needs, you can create custom firewall rules.
Parameter
Description
Application type
Custom is selected by default.
Protocol
Select TCP, UDP, or ICMP.
Port range
The valid port range is 1 to 65535. The following formats are supported:
-
Single port
Enter a single port number. For example, to allow traffic on the MySQL database listening port, set the port range to
3306. -
Port range
Specify a range of ports separated by a forward slash (/). For example, to allow traffic on a custom port range of 20000 to 30000 for an FTP configuration, set the port range to
20000/30000.
The start port of a port range must be smaller than the end port. For example,
20000/30000is valid, while3000/3000(start port equal to end port) is invalid and the system reports that the port range is invalid. To allow a single port, use the single-port format, for example,3000.Source IP address
The default value is 0.0.0.0/0, which allows access from all IPv4 addresses. You can also specify custom allowed IPv4 addresses:
-
Single IPv4 address
Enter a single IPv4 address. For example: 192.168.0.100.
-
Allow access from all IPv4 addresses in a CIDR block
Enter an IPv4 CIDR block, for example: 192.168.0.0/24.
Description
Enter a description for the firewall rule to help identify and manage it.
You can click Add Rule or the
icon to add or delete firewall rules as needed. -
Manage firewall rules
After you add a firewall rule, you can modify, disable, enable, or delete it.
|
Actions |
Description |
Procedure |
|
Modify a firewall rule |
Modify any rule that no longer meets your requirements. |
|
|
Disable a firewall rule |
To temporarily close a port, disable its rule instead of deleting it. Important
Disabling a firewall rule may cause the corresponding port to become inaccessible, which can affect your services. Use this feature with caution and only after confirming it will not impact your business operations. |
|
|
Enable a firewall rule |
Re-enable a previously disabled firewall rule when needed. |
|
|
Delete a firewall rule |
Delete a firewall rule that is no longer needed. Note
Instead of deleting a rule, consider disabling it, especially if you have not reached the 50-rule limit. This makes re-enabling the rule easier. |
Single rule
Bulk delete
|
Preset ports
Simple Application Server provides preset rules for common applications. The following table lists the details. For more information about common ports, see Common ports.
|
Application type |
Protocol |
Port range |
Source IP |
Description |
|
HTTP |
TCP |
80 |
0.0.0.0/0 Important
|
The default port for the HTTP protocol, used for web services such as IIS, Apache, and Nginx. For more information, see Quickly create a Linux instance by using a system image. |
|
HTTPS |
TCP |
443 |
The default port for the HTTPS protocol. For more information, see Install an SSL certificate in a Node.js environment (Linux). |
|
|
RDP |
TCP |
3389 |
The default port for Remote Desktop Protocol (RDP), used to connect to Windows instances. For more information, see Connect to a Windows instance. |
|
|
FTP |
TCP |
21 |
The default port for the FTP protocol, used for uploading and downloading files. For more information, see Build an FTP server on a Linux instance. |
|
|
SSH |
TCP |
22 |
The SSH port, used to connect to Linux instances from the command line or with remote connection software such as PuTTY, Xshell, and SecureCRT. For more information, see Connect to a Linux instance. |
|
|
TELNET |
TCP |
23 |
The default Telnet port. |
|
|
MySQL |
TCP |
3306 |
The default port for MySQL databases. For more information, see Use DMS to connect to a database on an instance. |
|
|
SQLServer |
TCP |
1433 |
The default SQL Server port. |
|
|
All Use TCP |
TCP |
1-65535 |
All TCP ports. |
|
|
All Use UDP |
UDP |
1-65535 |
All UDP ports. |
|
|
All Use TCP and UDP |
TCP+UDP |
1-65535 |
All TCP and UDP ports. |
|
|
Specify a custom value |
TCP, UDP, or ICMP |
1-65535 |
A custom port range. |
FAQ
Related topics
If you experience connection failures after configuring the firewall, or if the firewall does not meet your needs, see the following topics: