-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: ability to turn off SSL required #34
Comments
Do you think instead using the flag using the |
|
Exactly. This isn't really a product requirement as much as it is a "nice to have" to lower the bar abit so people don't have to setup a postgres cluster with SSL. I could also see the argument that there shouldn't be the ability to turn off SSL (since it makes the security story abit worse here). But generally, OpenSauced wouldn't ship a database without SSL turned on so this microservice would fail to start for our use cases if we tried deploying it in that way. |
@jpmcb regarding lowering the bar a bit, I started some work on my fork for spinning up Postgres, migrations, and the application via Docker compose. Branch is still pretty rough, but it works. Let me know if I ought to create an issue for this to discuss further. |
A docker compose file would be useful for contributors although it wouldn't be the full picture (since the database is really a database from the API which we have some steps for setting up: https://github.com/open-sauced/api#%EF%B8%8F-setting-up-a-postgresql-database-locally). It could be very cool to have a docker compose that captures more of the stack to give a full local development experience. |
Got it. I created the separate issue and linked a draft PR for it. Regarding the change for this issue, it'd be easy enough to create a map that we could use to validate against reasonable values (e.g. "require", "disable", etc) and warn if we don't see a value specified, or if it's invalid. e.g. validSSLModes := map[string]bool {
"require": true,
"disable": true,
// ...
}
sslMode, sslModeSet := os.LookupEnv("SSLMODE")
if !sslModeSet {
// log warning about variable being unset
sslMode = "require"
} else if _, valid := validSSLMode[sslMode]; !valid {
// log warning about variable being invalid
sslMode = "require"
}
// work with sslMode from here |
Type of feature
🍕 Feature
Current behavior
Currently, this microservice only can make connections to postgres over ssl:
pizza/pkg/database/handler.go
Line 28 in 65f6e18
Suggested solution
We should consider having a flag / config that disables ssl being required in order to connect. Ideally, this would flip to some "auto" mode that can connect to any postgres.
This should also log a warning if this setting has been turned on so administrators can be assured the configuration that's being run.
Additional context
No response
Code of Conduct
Contributing Docs
The text was updated successfully, but these errors were encountered: