Skip to content
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

Postgres/MySQL Source Strict Encrypt: stop enforce SSL if ssl mode disabled #19025

Merged
merged 13 commits into from
Nov 9, 2022

Conversation

VitaliiMaltsev
Copy link
Contributor

@VitaliiMaltsev VitaliiMaltsev commented Nov 7, 2022

What

Fix for #18992

How

Stop enforce ssl=true if ssl mode disabled or disable for MySQL Strict Encrypt and Postgres Strict Encrypt

🚨 User Impact 🚨

none

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@VitaliiMaltsev VitaliiMaltsev temporarily deployed to more-secrets November 7, 2022 13:10 Inactive
@VitaliiMaltsev VitaliiMaltsev temporarily deployed to more-secrets November 7, 2022 14:15 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Nov 7, 2022
@VitaliiMaltsev VitaliiMaltsev marked this pull request as ready for review November 7, 2022 14:17
@VitaliiMaltsev VitaliiMaltsev temporarily deployed to more-secrets November 7, 2022 14:19 Inactive
Copy link
Contributor

@bleonard bleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jsut confirming: This is still enforcing SSL for our strict-encrypt CHECKs right?

@grishick
Copy link
Contributor

grishick commented Nov 7, 2022

@VitaliiMaltsev once this is published and merged, please don't forget to unpin connector version in cloud

@VitaliiMaltsev
Copy link
Contributor Author

Jsut confirming: This is still enforcing SSL for our strict-encrypt CHECKs right?

All of jdbc strict encrypt connectors will still enforce SSL except postgres and mysql in case of customer choose ssl mode disabled during connection setup

@ryankfu
Copy link
Contributor

ryankfu commented Nov 7, 2022

@VitaliiMaltsev Can we add a test case that specifically tests for ssl_mode: disabled and SSH_TUNNEL succeeds check within both source-postgres-strict-encrypt and source-mysql-strict-encrypt? Currently neither of those integration tests have this scenario covered

@@ -114,7 +115,13 @@ public static Map<String, String> parseJdbcParameters(final String jdbcPropertie
* @return true: if ssl has not been set or it has been set with true, false: in all other cases
*/
public static boolean useSsl(final JsonNode config) {
return !config.has(SSL_KEY) || config.get(SSL_KEY).asBoolean();
if (!config.has(SSL_KEY)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update the javadoc description to update what this method now does so it's not de-synced from what this method originally did?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update the javadoc description to update what this method now does so it's not de-synced from what this method originally did?

updated javadoc

@@ -210,6 +210,42 @@ void testUssSslWithSslSetAndValueIntegerTrue() {
assertTrue(sslSet);
}

@Test
void testUseSslWithEmptySslKeyAndSslModeVerifyFull() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are good, let's also add an integration test for both source-mysql-strict-encrypt and source-postgres-strict-encrypt that cover the scenario that was failing for the customer which is when SSH tunnel was set and their ssl_mode: disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are good, let's also add an integration test for both source-mysql-strict-encrypt and source-postgres-strict-encrypt that cover the scenario that was failing for the customer which is when SSH tunnel was set and their ssl_mode: disabled

@ryankfu i added a couple of tests for postgres and mysql in order to cover such a case that the user encountered (when SSH tunnel was set and ssl_mode: disabled)

Copy link
Contributor

@ryankfu ryankfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just want to specifically cover scenario that the user fails on. Currently neither the strict encrypt versions of these source connectors have this test case covered so this change cannot be conclusive that it resolves the user's issue

@VitaliiMaltsev VitaliiMaltsev requested a review from a team as a code owner November 8, 2022 15:30
@github-actions github-actions bot added the area/connectors Connector related issues label Nov 8, 2022
@VitaliiMaltsev VitaliiMaltsev temporarily deployed to more-secrets November 8, 2022 15:32 Inactive
@VitaliiMaltsev VitaliiMaltsev requested review from ryankfu and removed request for tuliren November 8, 2022 15:39
@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 8, 2022

/test connector=connectors/source-postgres-strict-encrypt

🕑 connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/3420964945
✅ connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/3420964945
No Python unittests run

Build Passed

Test summary info:

All Passed

@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 8, 2022

/test connector=connectors/source-mysql

🕑 connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/3422601480

@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 8, 2022

/test connector=connectors/source-mysql

🕑 connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/3422833697
✅ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/3422833697
No Python unittests run

Build Passed

Test summary info:

All Passed

@VitaliiMaltsev VitaliiMaltsev temporarily deployed to more-secrets November 8, 2022 20:10 Inactive
@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 8, 2022

/test connector=connectors/source-postgres

🕑 connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3423449486
✅ connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3423449486
No Python unittests run

Build Passed

Test summary info:

All Passed

@VitaliiMaltsev VitaliiMaltsev temporarily deployed to more-secrets November 8, 2022 21:47 Inactive
@grishick
Copy link
Contributor

grishick commented Nov 9, 2022

/test connector=connectors/source-postgres-strict-encrypt

🕑 connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/3424337017
✅ connectors/source-postgres-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/3424337017
No Python unittests run

Build Passed

Test summary info:

All Passed

@ryankfu
Copy link
Contributor

ryankfu commented Nov 9, 2022

/test connector=connectors/source-mysql-strict-encrypt

🕑 connectors/source-mysql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/3430450858
✅ connectors/source-mysql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/3430450858
No Python unittests run

Build Passed

Test summary info:

All Passed

Copy link
Contributor

@ryankfu ryankfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for adding these tests to the strict-encrypt variant of each source. Should be good pending integration tests for source-mysql-strict-encrypt passes

@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 9, 2022

/publish connector=connectors/source-mysql-strict-encrypt

🕑 Publishing the following connectors:
connectors/source-mysql-strict-encrypt
https://github.com/airbytehq/airbyte/actions/runs/3431460199


Connector Did it publish? Were definitions generated?
connectors/source-mysql-strict-encrypt

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 9, 2022

/publish connector=connectors/source-mysql

🕑 Publishing the following connectors:
connectors/source-mysql
https://github.com/airbytehq/airbyte/actions/runs/3431460775


Connector Did it publish? Were definitions generated?
connectors/source-mysql

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 9, 2022

/publish connector=connectors/source-postgres-strict-encrypt

🕑 Publishing the following connectors:
connectors/source-postgres-strict-encrypt
https://github.com/airbytehq/airbyte/actions/runs/3431462939


Connector Did it publish? Were definitions generated?
connectors/source-postgres-strict-encrypt

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2022

Affected Connector Report

NOTE ⚠️ Changes in this PR affect the following connectors. Make sure to do the following as needed:

  • Run integration tests
  • Bump connector version
  • Add changelog
  • Publish the new version

⚠ Sources (5)

Connector Version Changelog Publish
source-alloydb 1.0.17
source-alloydb-strict-encrypt 1.0.17
(not in seed)
source-mysql 1.0.12
source-mysql-strict-encrypt 1.0.12
(not in seed)
source-postgres-strict-encrypt 1.0.23
(not in seed)
  • See "Actionable Items" below for how to resolve warnings and errors.

✅ Destinations (0)

Connector Version Changelog Publish
  • See "Actionable Items" below for how to resolve warnings and errors.

Actionable Items

(click to expand)

Category Status Actionable Item
Version
mismatch
The version of the connector is different from its normal variant. Please bump the version of the connector.

doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.
Changelog
doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.

changelog missing
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog.
Publish
not in seed
The connector is not in the seed file (e.g. source_definitions.yaml), so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that it is not a bug.

diff seed version
The connector exists in the seed file, but the latest version is not listed there. This usually means that the latest version is not published. Please use the /publish command to publish the latest version.

@VitaliiMaltsev
Copy link
Contributor Author

VitaliiMaltsev commented Nov 9, 2022

/publish connector=connectors/source-postgres

🕑 Publishing the following connectors:
connectors/source-postgres
https://github.com/airbytehq/airbyte/actions/runs/3431463635


Connector Did it publish? Were definitions generated?
connectors/source-postgres

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@VitaliiMaltsev VitaliiMaltsev temporarily deployed to more-secrets November 9, 2022 20:07 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets November 9, 2022 21:20 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets November 9, 2022 22:01 Inactive
@VitaliiMaltsev VitaliiMaltsev merged commit c72b75e into master Nov 9, 2022
@VitaliiMaltsev VitaliiMaltsev deleted the 18992/vmaltsev-postgres-source-mandatory-ssl branch November 9, 2022 22:59
akashkulk pushed a commit that referenced this pull request Dec 2, 2022
…sabled (#19025)

* Postgres/MySQL Source Strict Encrypt: stop enforce SSL if ssl mode disabled

* fixed checkstyle

* updated changelog

* add tests

* replaced MySQL test to mysql-strict-encrypt module

* fixed Connection Refused for mysql test

* replaced Postgres Source strict-encrypt tests into new class

* bump version

* auto-bump connector version

* auto-bump connector version

Co-authored-by: Octavia Squidington III <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants