# Ensure database ports are not open to the internet

- Source: https://support.icompaas.com/support/solutions/articles/a_1796390895141747-ensure-database-ports-are-not-open-to-the-internet
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Hostinger](https://support.icompaas.com/support/solutions/c_1796390637084781) › [Hostinger Checks](https://support.icompaas.com/support/solutions/folders/f_1796390648370879)
- Last updated: 2026-12-04
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Description**

This check ensures that no Hostinger VPS firewall rule accepts traffic to common database ports from any source: MySQL/MariaDB (3306), PostgreSQL (5432), MongoDB (27017) and Redis (6379). Rules using the MySQL or PostgreSQL applications, and port ranges or all-port rules that include these ports, are also counted. Each firewall in the account is evaluated separately.

**Rationale**

Databases hold application and personal data and are frequent targets of automated scanning, brute-force and ransom attacks. A database reachable from the whole internet can be attacked directly, bypassing the application. Database ports should be reachable only from the application servers or administrators that need them.

**Impact**

-   Remote tools and servers that connect to the database directly must be listed as trusted sources, or connect through an SSH tunnel or VPN
    
-   Applications on the same VPS that use localhost are not affected
    
-   Also bind the database to localhost or a private address in its own configuration (for example bind-address in MySQL) as a second layer of protection
    

**Default Value**

A new firewall has no rules and drops all incoming traffic. Database ports are open only if such a rule is added.

**Pre-Requisites**

-   Access to hPanel for the account that owns the VPS
    
-   The IP addresses of servers or administrators that need direct database access
    

**Remediation**

**Test Plan**

1.  Log in to hPanel at https://hpanel.hostinger.com.
    
2.  Go to VPS and click Manage next to the server.
    
3.  In the left sidebar, select Security → Firewall.
    
4.  Click the ⋯ button next to the firewall and select Edit.
    
5.  Review the rules. If an accept rule for MySQL, PostgreSQL or ports 3306, 5432, 27017 or 6379 (including ranges or all ports) has the source Anywhere, the check fails.
    
6.  Repeat for each firewall in the account.
    

**Implementation Steps**

1.  Log in to hPanel at https://hpanel.hostinger.com.
    
2.  Go to VPS and click Manage next to the server.
    
3.  In the left sidebar, select Security → Firewall.
    
4.  Click the ⋯ button next to the firewall and select Edit.
    
5.  If remote database access is needed, add an accept rule for the database (for example MySQL) with Traffic source Custom and the trusted IP in Source details. Click Add rule.
    
6.  In the rule list, remove the rule that allows the database port from Anywhere.
    
7.  Click Apply changes.
    
8.  Confirm that the application and any trusted remote clients can still connect.
    

**Backout Plan**

1.  Log in to hPanel at https://hpanel.hostinger.com.
    
2.  Go to VPS and click Manage next to the server.
    
3.  In the left sidebar, select Security → Firewall.
    
4.  Click the ⋯ button next to the firewall and select Edit.
    
5.  Add back an accept rule for the database port with the source that needs it, then click Apply changes.
    

**Note:** Opening database ports to the internet exposes stored data to direct attack; restore access only for specific trusted sources.

**Reference**

-   [https://www.hostinger.com/support/8172641-how-to-use-a-managed-vps-firewall-at-hostinger/](https://www.hostinger.com/support/8172641-how-to-use-a-managed-vps-firewall-at-hostinger/)
    
-   [https://www.hostinger.com/tutorials/how-to-grant-remote-access-mysql/](https://www.hostinger.com/tutorials/how-to-grant-remote-access-mysql/)
