Skip to main content

Trusted sources (database IP allowlist and firewall)

Trusted sources are a Cloider database's firewall: the list of places allowed to open a connection to it. A connection from anywhere else is dropped before it reaches the database, even with the right password. You can trust the whole internet, single IPv4 addresses, IPv4 ranges in CIDR notation, and your own Cloider apps and Kubernetes clusters.

At a glance​

What it filtersNew connections to the database's port, on both the public and the private host
Source typesAnywhere (*), My IP, an IPv4 address or CIDR range, a Cloider app, a Cloider Kubernetes cluster
DefaultAnywhere, when created from the dashboard, CLI, Terraform or MCP
Empty listNobody can connect over the network
Not filteredThe browser terminal, cloider db shell, cloider db exec and backups
IPv6Not supported. Use IPv4 addresses and ranges
Restart neededNo, changes apply without restarting the database
Where to change itThe Settings tab, cloider db trusted-sources, Terraform trusted_sources, the API and the update_database_trusted_sources MCP tool

Types of trusted source​

TypeWhat it allowsDashboardCLI, MCPTerraform
AnywhereAny IP address, plus all your apps and clustersAllow Everything* (also 0.0.0.0/0 or anywhere)*
My IPThe public IPv4 address of the browser or machine you are using, as a /32Allow My IP--add-my-ip, --allow-my-ip, add_my_ipWrite the address as a CIDR
IPv4 address or rangeOne address or a CIDR range, on the public hostType it, for example 203.0.113.0/24, and press Enter203.0.113.7 or 203.0.113.0/24203.0.113.0/24 or 198.51.100.7/32
AppOne of your Cloider apps, on the private hostPick the app by nameapp:<name>, for example app:apiapp:<id>
ClusterOne of your Cloider Kubernetes clusters, on the private hostPick the cluster by namecluster:<name>, for example cluster:productioncluster:<id>

The CLI and MCP accept an app or cluster by its name, label or id. Terraform takes the id, which is the id attribute of a cloider_cluster resource. App and cluster sources match connections that arrive on the database's private host, which is how your apps and clusters should connect.

What is CIDR notation?​

CIDR notation writes a range of IP addresses as an address, a slash and a prefix length: 203.0.113.0/24. The prefix length says how many leading bits are fixed. The larger the number after the slash, the smaller the range.

CIDRAddressesCovers
198.51.100.7/321Exactly 198.51.100.7
203.0.113.0/2816203.0.113.0 to 203.0.113.15
203.0.113.0/24256203.0.113.0 to 203.0.113.255
10.20.0.0/1665,53610.20.0.0 to 10.20.255.255
0.0.0.0/0AllEvery IPv4 address. Cloider stores it as Anywhere

The dashboard only accepts ranges written with a prefix, so type 198.51.100.7/32 for a single address. The CLI adds /32 to a bare address for you, and stores a range as the network it covers: 10.0.0.7/24 becomes 10.0.0.0/24.

How the list behaves​

  • Anywhere replaces everything else. Choosing Anywhere (*) removes every other entry, because it already allows them.
  • Anything else replaces Anywhere. Adding an address, a range, an app or a cluster to a list that contains Anywhere removes Anywhere, so the list becomes restrictive. The dashboard and the CLI both do this.
  • Entries add up. A connection is allowed when it matches any entry.
  • An empty list allows nobody. With no trusted sources, no connection over the network reaches the database. The dashboard shows the warning "No trusted sources added. This database will be completely unreachable from anywhere. Add at least one source to allow connections." The CLI refuses to save an empty list, and Terraform requires at least one entry. Only the API accepts an empty list.

What trusted sources don't block​

Trusted sources only filter network connections to the database's host and port. These keep working whatever the list says, because they run next to the database inside Cloider:

This makes a fully locked down database practical: keep only your apps and clusters in the list, and use the terminal or cloider db exec for admin work.

View and change trusted sources​

  1. Open the database and go to the Settings tab.
  2. In Trusted Sources, open the Select trusted sources list:
    • pick Allow Everything to allow anywhere,
    • pick Allow My IP to add your current public IP,
    • pick one of your clusters or apps by name,
    • or type an IPv4 range such as 203.0.113.0/24 and press Enter.
  3. Remove an entry with its x.
  4. Click Apply changes. The button shows Saved once the list is stored.
The Settings tab of orders-db with the Trusted Sources picker and its Apply changes button, the SSL Mode switch and the Delete database section
Trusted sources, SSL mode and deletion are on the Settings tab.

The same picker appears when you create a database.

SituationTrusted sources
Production database used by a Cloider appapp:<name> only. Admin work through the Terminal tab or cloider db exec
Database used by a Cloider Kubernetes clustercluster:<name> only
Database used from another cloud or a VPSThat server's static IPv4 address as a /32
Developer access from an officeThe office's public range, for example 203.0.113.0/24
Local development with a hobby databaseAllow My IP, refreshed when your IP changes
Quick test or demoAllow Everything, with SSL on and a short life
Allow Everything is convenient, not private

With Allow Everything, anyone on the internet can reach the database's port and try to log in. The password is 32 random characters, so guessing it isn't practical, but a leaked password is then enough to get in. For production data, list only the sources that need access.

Troubleshooting​

My connection times out​

A connection from a source that isn't trusted is dropped silently, so the client waits until it times out instead of getting an error. Typical messages are Connection timed out (psql and redis-cli), Can't connect to MySQL server ... (110) (mysql) and Server selection timed out (mongosh). Add your address with Allow My IP or cloider db trusted-sources <database> --add-my-ip, then try again.

Allow My IP added the wrong address​

Allow My IP and --add-my-ip add the public IPv4 address that a lookup service sees for your browser or machine. Behind a VPN, a corporate proxy or a mobile hotspot, that address can differ from the one your database client uses, or change often. Check the address with curl -4 https://api.ipify.org, and add the range of your network instead of a single address if it changes.

Invalid IPv4 subnet. Use CIDR format (e.g., 192.168.1.0/24).​

The dashboard only accepts IPv4 ranges with a prefix length. Write a single address as 198.51.100.7/32.

The CLI says a source is not an IPv4 address or CIDR​

The CLI answers "<value>" is not '*', an IPv4 address or CIDR, cluster:<name> or app:<name> when it couldn't read a source. IPv6 addresses and host names aren't accepted. Use an IPv4 address or range, *, app:<name> or cluster:<name>.

The CLI says that leaves nobody able to connect​

The CLI answers that leaves nobody able to connect; use '*' to allow anywhere because it won't save an empty list. Add at least one source, or use --set '*' to allow anywhere.

My app can't connect even though it is trusted​

App and cluster sources only match connections to the private host (<name>-<id>.db.cloider.internal). Check that the app's connection string uses the private host, not the public one. See connect from a Cloider app.

Next steps​

Frequently asked questions

What happens if a database has no trusted sources?

Nobody can connect to it over the network, from the internet or from your apps and clusters. The browser terminal, cloider db shell and cloider db exec still work, because they run next to the database.

Does Allow Everything also allow my Cloider apps and clusters?

Yes. Allow Everything (*) allows connections from any address, on the public host, and from all your apps and clusters, on the private host.

Can I use IPv6 addresses in trusted sources?

No. Trusted sources accept IPv4 addresses and IPv4 CIDR ranges, plus your Cloider apps and clusters.

Do I need to restart the database after changing trusted sources?

No. Trusted sources are applied in front of the database, without a restart.

Why does my client hang instead of showing an error when my IP is not trusted?

Connections from untrusted sources are dropped without an answer, so the client waits until its connect timeout. A timeout from a database that otherwise works usually means your IP is not in its trusted sources.