I have a Postgres database containing public information that I'd like to expose to the internet, for anyone to use. What steps can I take to prevent:
- Excessively expensive queries that could hog resources, preventing access by others
- Queries that return too much data, using up too much bandwidth, causing harm to the server owner.
- The server itself being compromised and used for bad things.
I'm not worried about any data on the server being exposed, and I'm not especially worried about the server being crashed - it's trivial to rebuild.
It's PostgreSQL 9.1 with PostGIS extensions, containing OpenStreetMap data and a few other things. It's currently running on an Ubuntu (Quantal) VM, on OpenStack infrastructure.
The database is currently configured so that the only account that can connect over a network has read access to the necessary tables, and nothing more. It has a trivial password, and is running on the default port (5432), to simplify use. Shell access is only by public key. I'm not using a firewall, other than that provided by the OpenStack infrastructure. (All of these decisions are fair game for discussion...)