Foreman does not verify CA on postgres DB connections with SSL
|Assigned To:||Martin Bacovsky|
|Target version:||Foreman - Team Ivan Iteration 16|
|Found in release:||nightly||Pull request:||https://github.com/theforeman/puppet-foreman/pull/571|
|Velocity based estimate||-|
The default sslmode is 'prefer' which allows SSL connection to DB server, but CA of the DB server is not verified.
When using --foreman-db-sslmode 'verify-full' to enforce the CA cert verification there is no way to configure the root cert for the connection.
System CA trust is not supported by libpg and the cert is expected at '/usr/share/foreman/.postgresql/root.crt'.
Add an installer option to setup the root cert and consider if 'prefer' is the right and secure default option.
Fixes #20079 - SSL secured and verified PGSQL connection
To setup DB with SSL and verification use params:
db_sslmode => 'verify-full',
db_root_cert => 'ca_bundle.pem'
Default DB sslmode is 'prefer' - non-verified SSL with fallback to
non-SSL. To use SSL secured connection with CA verification sslmode
needs to be set to either 'verify-ca' or 'verify-full'. Underlying libpg
uses DB root cert stored at '~/.postgresql/root.crt' which is in case of
Foreman at '/usr/share/foreman/.postgresql/root.crt'. There is no way to
setup different path (besides using env vars). System CA trust is not
supported. The cert needs to be real file as links are not allowed too.
For more details see SSL support in libpg:
#3 Updated by Martin Bacovsky 3 months ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset puppet-foreman|a8297636bf9d38f34f519cf4e13793d2dd472868.