Comment by d_watt

Comment by d_watt 10 months ago

7 replies

Interesting project, I could see a use case for emerging markets where people don't have laptops. Maybe also include a local PG like https://supabase.com/blog/postgres-wasm for being able to play around with PG educationally with no required remote server?

For professional use cases, maybe if you're on call and need to access the DB over your phone (though I hope I'm never in that spot). Having documentation around network model - do you relay queries through your own backend - and the security model for data and credentials. Do you support any secure connection methods, like SSH tunnel, or does the PG need to be facing the public internet?

yen223 10 months ago

> Maybe also include a local PG like https://supabase.com/blog/postgres-wasm for being able to play around with PG educationally with no required remote server?

I did not know about wasm-postgres, thanks!

> Having documentation around network model - do you relay queries through your own backend - and the security model for data and credentials. Do you support any secure connection methods, like SSH tunnel, or does the PG need to be facing the public internet?

There's no backend, the app opens a connection directly to the database. Credentials are stored on-device. No data will ever be shipped to a third-party without user consent, and I will never change this. (This is a large part of why I haven't put in any "AI" features yet.)

The app currently does not support SSH tunneling. This is something I will be working on soon.

Also fair point on the documentation. There's currently 0 docs around the app, and I'm not proud of that.

zie 10 months ago

Postgres has secure connection methods, including client and server TLS cert authentication.

You could also hide it behind tailscale/nebula or some other VPN thing.

  • aborsy 10 months ago

    I’m curious how secure is TLS client authentication if the database is exposed to the internet?

    • zie 10 months ago

      What are you talking about?

      public key cryptography is well understood and used everywhere: HTTPS, SSH, Signal, etc.

      See: https://en.wikipedia.org/wiki/Public-key_cryptography

      In postgres specifically: https://www.postgresql.org/docs/16/ssl-tcp.html and https://www.postgresql.org/docs/16/runtime-config-connection...

      You can enforce TLSv1.3 on all network connections using `ssl_min_protocol_version`(postgres.conf) and `hostssl`(in pg_hba.conf)

      This puts you ahead of most web servers which often still allow TLSv1.1.

      You can make Postgres secure or not, your call. Just like with everything else.

      • aborsy 10 months ago

        I would note that, although obviously the confidentiality in TLS is based on public key cryptography, authentication by mTLS doesn’t reach the cryptography part.

        The process starts with a client and server hello. Then the server sends its certificate to the client, and the client sends its certificate to the server. The server verifies that the client’s certificate is signed by a certificate authority in its trust store. That’s the authentication part. The client’s private key is not used.

        The confidentiality comes next if authentication is successful.

        I asked because X509 certificates are complex and difficult to securely parse. Also mTLS is rarely used.