-
My end goal was to set the following in the environment: (notice the userid and password are missing in the url) and then configure the user id and password in a ~.pgpass file as described in https://www.postgresql.org/docs/9.1/libpq-pgpass.html When I do this - the first hurdle I meet is an error from this code:
The error originates from The suggestion is to downgrade to 0.36.7 - which I did but now leads to a different error from I was able to reproduce this issue in my own test program using v0.36.7 of sqlalchemy_utils.
Strangely enough even though
BTW, none of these issues occur with v0.36.7 of sqlalchemy_utils if I set the user id and password explicitly in the environment variable.
While this is a workaround for the moment - My app cannot pass a security review. I think this is more of an issue with the BentoML's depedencies - but I want to know if others also face similar issues - and what they are doing about this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
@jiyer2016 I think you raised a really good point on not expose the user and password as part of the environment variables for the Postgres database. I think there are a couple of things we can do to make BentoML a little bit smarter and adopt the best practices.
|
Beta Was this translation helpful? Give feedback.
-
@jiyer2016 I create a PR to lock the I also tested the yatai service with For my
I used a local Postgres docker container with the same user and password values from the $ docker run --rm -e POSTGRES_PASSWORD=my_password -e POSTGRES_USER=my_user -p 5432:5432 postgres For my yatai service command, I am now able to pass in the Postgres URL without user/password. $ bentoml yatai-service-start --db-url postgresql://localhost:5432/bentoml If you are running Postgres on ubuntu, the error you encountered |
Beta Was this translation helpful? Give feedback.
@jiyer2016 I create a PR to lock the
sqlalchemy-utils
version at #1078I also tested the yatai service with
.pgpass
file. This is what I have to make it work.For my
.pgpass
file, I created it in the location suggested in the Postgres documentation,~/.pgpass
\
or:
..pgpass
file's permission to0600
I used a local Postgres docker container with the same user and password values from the
.pgpass
fileFor my yatai service command, I am now able to pass in the Postgres URL without user/password.