PecanProject / bety

Web-interface to the Biofuel Ecophysiological Traits and Yields Database (used by PEcAn and TERRA REF)
https://www.betydb.org
BSD 3-Clause "New" or "Revised" License
16 stars 38 forks source link

Remaining steps for UA bety setup #616

Open dlebauer opened 5 years ago

dlebauer commented 5 years ago

@Chris-Schnaufer a few things to finish up the production BETYdb at UA:

serbinsh commented 5 years ago

And then we need to make sure that anything that needed to be done that wasn’t in the documentation makes it into the docs. Might be good to regularly try to build the dockerized PEcAn+BETY to make sure the instructions make sense. Perhaps we can try building some automated build environments?

S

dlebauer commented 5 years ago

For documentation:

gsrohde commented 5 years ago

Also for documentation: Fill in the remaining columns in the table at https://github.com/PecanProject/betydb-documentation/blob/bookdown/distributed_betydb.md.

Chris-Schnaufer commented 5 years ago

Where in the documentation would the '... machines table' and '... cron job ..' additions go? The References section appears to be a good place since it has the docker information, but none of the sub categories look right.

dlebauer commented 5 years ago

@Chris-Schnaufer this gets a bit confusing, but the documentation for how to sync instances of betydb is in the PEcAn documentation.

I'm not sure if this should be combined with or linked to from the BETYdb distributed_betydb.md documentation (@robkooper ?).

dlebauer commented 5 years ago

@robkooper do you have a recommended set of steps for making the database secure?

E.g.

dlebauer commented 5 years ago

Also customize web home pages

gsrohde commented 5 years ago

@dlebauer , @robkooper Regarding the carya:illinois user: This is created when the -u flag is used with load.bety.sh. To my understanding, this flag should never be used on production systems. It was intended for developers so that users of all combinations of permission levels would be created so that permission-related issues could more easily be tested.

Chris-Schnaufer commented 5 years ago

Thank you @gsrohde. Are you aware of procedures for handling the postgresql administrator accounts of 'postgres' and 'bety' as well?

gsrohde commented 5 years ago

@Chris-Schnaufer I'm not aware of any set procedures regarding PostgreSQL administrator accounts. But here are a few things to keep in mind: The PostgreSQL account that the BETYdb app uses (often called bety but sometimes called something else—bety_ebi, for example) needs to have Create DB permission, I think. The password for this account is usually listed in the config/database.yml configuration file, so if data security is a concern, access to this file should be restricted. (Alternatively, I think it should be possible to give password-less access to this PostgreSQL account to the machine account that Rails runs as.) Access to the postgres account should of course be tightly controlled as well.

Chris-Schnaufer commented 5 years ago

This is great information! Thanks

robkooper commented 5 years ago

Some notes of the top of my head:

Chris-Schnaufer commented 5 years ago

@gsrohde @robkooper @dlebauer Rob or Scott, it looks like the instance of postgres used in the Pecan installation allows all hosts from anywhere to connect as trusted users. It is the last line in the pg_hba.conf file is host all all all trust which allows this. One command that shows this is psql -U postgres -qAt -c "show hba_file" | xargs grep -v -E '^[[:space:]]*#'. This means that setting passwords on any database account is useless as that check is bypassed; their permissions are still in effect fortunately. Note that the postgres user is available on all postgresql instances as a superuser and in this case a password is irrelevant.

Is this something that would be desirable to change for all instances, not just in our case (at UA)?

In the same vein, he local access allows all users as well. Perhaps this can be restricted to only bety and postgres users?

More information on the pg_hbe.config file can be found on the Postgresql documentation site (for example, https://www.postgresql.org/docs/10/auth-pg-hba-conf.html)