Security in db

Putting this up as a PR so that it lives on.