-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
🚨 Add ability to enforce SSL in MongoDB source connector #17590
Conversation
NOTE
|
/test connector=connectors/source-mongodb-v2
Build FailedTest summary info:
|
/test connector=connectors/source-mongodb-strict-encrypt
Build FailedTest summary info:
|
/test connector=connectors/source-mongodb-v2
Build FailedTest summary info:
|
/test connector=connectors/source-mongodb-strict-encrypt
Build FailedTest summary info:
|
/test connector=connectors/source-mongodb-v2
Build PassedTest summary info:
|
NOTE
|
/test connector=connectors/source-mongodb-strict-encrypt
Build PassedTest summary info:
|
NOTE
|
...encrypt/src/main/java/io.airbyte.integrations.source.mongodb/MongodbSourceStrictEncrypt.java
Outdated
Show resolved
Hide resolved
...rs/source-mongodb-v2/src/main/java/io.airbyte.integrations.source.mongodb/MongoDbSource.java
Outdated
Show resolved
Hide resolved
/** | ||
* Determines whether TLS/SSL should be enabled for a standalone instance of MongoDB. | ||
*/ | ||
public static boolean tlsEnabledForStandaloneInstance(final JsonNode config, final JsonNode instanceConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should both the javadoc comment and the method name be more generalized? It seems you're passing in an instanceConfig
so it appears this can be extended in the future to handle other instance
types yet this method is specifically for Standalone instances, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually specifically for Standalone instances actually. For Atlas and replica set deployments, we are overrwriting the arguments to always have tls/ssl=true in the parames (see MONGODB_SERVER_URL
and MONGODB_CLUSTER_URL
above. I was essentially duplicating the logic in the source-mongodb-strict-encrypt's check() method, so pulled it out here. The naming is specifically a warning to not rely on this method for non-standalone instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nits, overall looks good. One thing that would be useful is the bullet point that Liren mentioned which is just updating docs to reflect that users are encouraged not to turn off TLS
and that can be in the docs since it applies generally to both OSS and Cloud users
…hkulkar/mongo-ssl
NOTE
|
Thanks Ryan - it seems that the existing documentation mentions this, so will leave this unchanged for now. This is more of a defensive change for the Cloud side of things |
NOTE
|
NOTE
|
/test connector=connectors/source-mongodb-v2
Build FailedTest summary info:
|
NOTE
|
NOTE
|
/test connector=connectors/source-mongodb-strict-encrypt
Build PassedTest summary info:
|
/test connector=connectors/source-mongodb-v2
Build PassedTest summary info:
|
/publish connector=connectors/source-mongodb-v2 run-tests=false
if you have connectors that successfully published but failed definition generation, follow step 4 here |
NOTE
|
/publish connector=connectors/source-mongodb-strict-encrypt run-tests=false
if you have connectors that successfully published but failed definition generation, follow step 4 here |
NOTE
|
NOTE
|
…7590) * Check and test for if we are disabling SSL/TLS in source-mongodb-strict-encrypt * Update docs * Address comments * auto-bump connector version [ci skip] Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
What
Currently, the cloud version of MongoDB enforces SSL for Atlas + Replica Set. However, for standalone deployments we can potentially get into a state where SSL could be disabled.
Closes #16278
How
In the check() method of the source-mongodb-strict-encrypt, we enforce tls/ssl param to be true.
Recommended reading order
MongodbSourceStrictEncrypt.java
MongodbSourceStrictEncryptTest.java
MongodbSourceUtils.java
🚨 User Impact 🚨
This can potentially break cloud users that somehow got to a stage where "use SSL" was disabled. This is quite hard as the UI stands today, as that is disabled in cloud. However, this could be a problem going forward if the UI were to change or a CLI was exposed which allows the user to do so.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.