If you are deploying Security Monkey on GCP and decide to use Cloud SQL, it's recommended to run Cloud SQL Proxy to connect to Postgres. To use Postgres on Cloud SQL, create a new instance from your GCP console and create a password for the postgres
user when Cloud SQL prompts you. (If you ever need to reset the postgres
user's password, refer to the Cloud SQL documentation.)
After the instance is up, run Cloud SQL Proxy:
$ ./cloud_sql_proxy -instances=[INSTANCE CONNECTION NAME]=tcp:5432 &
You can find the instance connection name by clicking on your Cloud SQL instance name on the Cloud SQL dashboard and looking under "Properties". The instance connection name is something like [PROJECT_ID]:[REGION]:[INSTANCENAME].
You'll need to run Cloud SQL Proxy on whichever machine is accessing Postgres, e.g. on your local workstation as well as on the GCE instance where you're running Security Monkey.
Connect to the Postgres instance:
$ sudo -u postgres psql -h 127.0.0.1 -p 5432
After you've connected successfully in psql, follow the instructions in Setup Postgres_ to set up the Security Monkey database.