Skip to content

🐛Destination-dynamodb: enforce ssl connection #18672

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

Merged

Conversation

etsybaev
Copy link
Contributor

@etsybaev etsybaev commented Oct 30, 2022

What

Users are able to use a non-secure connection

How

Updated check method to enforce SSL connection.

Selection_032

🚨 User Impact 🚨

No breaking changes expected

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.

@github-actions
Copy link
Contributor

NOTE ⚠️ Changes in this PR affect the following connectors. Make sure to run corresponding integration tests:

  • destination-dynamodb

@etsybaev etsybaev linked an issue Oct 30, 2022 that may be closed by this pull request
@etsybaev etsybaev changed the title [16283] Destination-dynamodb: enforce ssl connection 🐛Destination-dynamodb: enforce ssl connection Oct 30, 2022
@etsybaev
Copy link
Contributor Author

etsybaev commented Oct 30, 2022

/test connector=connectors/destination-dynamodb

🕑 connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3356926115
✅ connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3356926115
No Python unittests run

Build Passed

Test summary info:

All Passed

@suhomud suhomud self-assigned this Nov 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

NOTE ⚠️ Changes in this PR affect the following connectors. Make sure to run corresponding integration tests:

  • destination-dynamodb

@etsybaev
Copy link
Contributor Author

etsybaev commented Nov 1, 2022

/test connector=connectors/destination-dynamodb

🕑 connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3370301467
✅ connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3370301467
No Python unittests run

Build Passed

Test summary info:

All Passed

Copy link
Contributor

@suhomud suhomud left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 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 (0)

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

✅ Destinations (1)

Connector Version Changelog Publish
destination-dynamodb 0.1.7
  • 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.

@etsybaev
Copy link
Contributor Author

etsybaev commented Nov 1, 2022

Selection_033

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Nov 1, 2022
@etsybaev
Copy link
Contributor Author

etsybaev commented Nov 1, 2022

/publish connector=connectors/destination-dynamodb

🕑 Publishing the following connectors:
connectors/destination-dynamodb
https://github.com/airbytehq/airbyte/actions/runs/3372319361


Connector Did it publish? Were definitions generated?
connectors/destination-dynamodb

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

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets November 1, 2022 20:00 Inactive
Copy link
Contributor

@grishick grishick left a comment

Choose a reason for hiding this comment

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

If I am reading the code correctly, this change will always enforce HTTPS for DynamoDB. However, we only need this to happen in Airbyte Cloud and we want to continue allowing non-SSL connections in Open Source. @ryankfu could you walk @etsybaev through how to introduce strict encrypt variant to an existing destination connector w/o creating a new image and how to add the check only in Airbyte Cloud scope (what you did for destination-S3)?

@ryankfu
Copy link
Contributor

ryankfu commented Nov 2, 2022

Hi @etsybaev, in case you weren't aware there's a PR that captures a very similar change here. Basically the main pieces that would help to separate this functionality so that it only affects cloud is to:

  • create a new DynamoDestinationRunner and DynamoDestinationStrictEncrypt in the same package as DynamoDestination
  • update dynamo destination's build.gradle to point to the DynamoDestinationRunner

If you have any questions regarding the work, let's set up a quick 1:1 to knowledge share. For most context the Runner class will act similar to a case scenario where it will run a different class based on the environment variable

Also note that you'd probably want to create a new StrictEncryptTest so that it only tests for this behavior in an isolated manner

@etsybaev etsybaev temporarily deployed to more-secrets November 2, 2022 10:26 Inactive
@etsybaev etsybaev requested a review from ryankfu November 2, 2022 10:43
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.

minor code reusability changes but overall looks good

@etsybaev etsybaev temporarily deployed to more-secrets November 2, 2022 23:08 Inactive
@etsybaev etsybaev requested a review from ryankfu November 2, 2022 23:08
}

/**
* Test that check failes if user is using a non-secure (http) connection
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: type for fails

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks

build.gradle Outdated
@@ -156,7 +156,7 @@ spotless {
format 'styling', {
target createSpotlessTarget(['**/*.yaml', '**/*.json'])

prettier()
// prettier()
Copy link
Contributor

Choose a reason for hiding this comment

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

How come you've commented out the prettier() method? presume this is simply pretty printing but regardless doesn't seem relevant to this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Accidentally committed. Already rolled back.
How this could come? There was a version bumping change in check-style some time ago. Since then some linux users started seeing issues with importing and refreshing project in IntellijIdea but still works when executing build from console. I raised that issue but it seems like the author was busy with other tasks and wasn't going to switch back to his changes. I tried to check it in my free time and found that the issue comes from "prettier" and then stuck. Also found a few similar issues raised on the internet but without answers. So since then every time I have to comment it while working with code and then uncomment from time to time to run "./gradlew --no-daemon format --scan" command to format code and then comment it back.
Here is what the issue looks like for me in IntellijIdea when I refresh gradle project with uncommented Prettier
Selection_035

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.

Overall looks good, there's a minor nit and a question regarding a prettier() method getting commented out in build.gradle

@etsybaev etsybaev temporarily deployed to more-secrets November 3, 2022 06:42 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets November 3, 2022 08:14 Inactive
@etsybaev
Copy link
Contributor Author

etsybaev commented Nov 3, 2022

/test connector=connectors/destination-dynamodb

🕑 connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3384239320
✅ connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3384239320
No Python unittests run

Build Passed

Test summary info:

All Passed

@etsybaev etsybaev temporarily deployed to more-secrets November 3, 2022 08:55 Inactive
@etsybaev etsybaev requested review from grishick November 3, 2022 09:30
Copy link
Contributor

@grishick grishick left a comment

Choose a reason for hiding this comment

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

@etsybaev now that you've made the changes to enforce SSL only in Cloud you also need to bump the version again and publish the newer version before merging

@etsybaev etsybaev temporarily deployed to more-secrets November 3, 2022 17:07 Inactive
Copy link
Contributor

@grishick grishick left a comment

Choose a reason for hiding this comment

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

Approved assuming you'll bump the connector version and publish ;)

@etsybaev
Copy link
Contributor Author

etsybaev commented Nov 3, 2022

/test connector=connectors/destination-dynamodb

🕑 connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3388504702
✅ connectors/destination-dynamodb https://github.com/airbytehq/airbyte/actions/runs/3388504702
No Python unittests run

Build Passed

Test summary info:

All Passed

@etsybaev
Copy link
Contributor Author

etsybaev commented Nov 3, 2022

Selection_038

@etsybaev etsybaev temporarily deployed to more-secrets November 3, 2022 19:46 Inactive
@etsybaev
Copy link
Contributor Author

etsybaev commented Nov 3, 2022

/publish connector=connectors/destination-dynamodb

🕑 Publishing the following connectors:
connectors/destination-dynamodb
https://github.com/airbytehq/airbyte/actions/runs/3388820224


Connector Did it publish? Were definitions generated?
connectors/destination-dynamodb

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

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets November 3, 2022 20:12 Inactive
@etsybaev etsybaev merged commit 5c870c1 into master Nov 3, 2022
@etsybaev etsybaev deleted the etsybaev/16283-destination-dynamodb-enforce-ssl-connection branch November 3, 2022 20:15
@grishick grishick added the team/destinations Destinations team's backlog label Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/destination/dynamodb team/destinations Destinations team's backlog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to enforce SSL in DynamoDB Destination connector
6 participants