Database Sign-In with AWS IAM

People who sign in to Simcha DB Studio with OpenID Connect can connect from the IDE to Amazon RDS and Aurora databases (PostgreSQL, MySQL, MariaDB) as their own database user with no database password stored: the IDE makes a short-lived RDS authentication token from their sign-in each time it opens a connection. SAML and LDAP sign-ins carry no token AWS accepts, so they use passwords.

How it works

  1. At OpenID Connect sign-in the server keeps the person's ID token, encrypted, until it expires. Signing out forgets it.
  2. The DB DevOps connection to the database allows it: IDE Sign-In set to AWS IAM, with the Role People Assume and, when the host is not an RDS host name, the AWS Region. Its own deployment login is unchanged and is never used by the IDE.
  3. The person adds the connection in the IDE and, in Edit Connection, picks Sign In With: My single sign-on identity (AWS IAM) and enters their database user name. No password is kept.
  4. On connect the server assumes the role with the person's ID token (AssumeRoleWithWebIdentity, session name the person's email) and signs an RDS authentication token for their database user, over TLS. A PostgreSQL pool asks for a fresh token for each new connection; other engines reopen within 15 minutes.
  5. When the ID token has expired, connecting answers IDENTITY_SIGN_IN_NEEDED: sign in again with single sign-on.

AWS setup

The Audit Log records each IDE query with the person and the database user (databaseLogin); the database's own logs show the same user.