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

[Bugfix] - Changes in logic to delete share db #1706

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TejasRGitHub
Copy link
Contributor

Feature or Bugfix

  • Bugfix

Detail

  • Additional locking when revoking a dataset with the same database shared across various datasets
  • Modifications in checks to see if the principal / database combo is still shared else where

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)? N/A
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume? N/A
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization? N/A
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features? N/A
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?
  • Are you introducing any new policies/roles/users? N/A
    • Have you used the least-privilege principle? How?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@TejasRGitHub
Copy link
Contributor Author

TejasRGitHub commented Nov 19, 2024

Test cases:

Onboarded two dataset ( D1, D2 ) with the same common_db. Onboarded a consumption role ( C1 ). Environment has two roles ( Scientist, Engineers )

Scenerio 1:

  1. Created a share S1 with table from C1 to D1 ✅ ( Checked if the tables are accessible via Athena )
  2. Created a share S2 with table from C1 to D2 ✅ ( Checked if the tables are accessible via Athena )
  3. Revoked share S2 and checked if the common_db_shared still exists in the account ✅
  4. Queried tables from S1 to validate access and also checked if LF permissions for the principal exists ✅

Scenario 2:

  1. Repeated steps 1 and 2.
  2. Created another share S3 with D1 from environment role : Scientist
  3. Checked if access to the table exists for this role ✅
  4. Now revoked S1 and check if the access in S3 and S2 are intact ✅ ( Checked that the permission to the principals exists and Athena query works)
  5. Revoked S3 and checked if the access to S2 is present ✅ ( Checked that the permission to the principals exists and Athena query works)
  6. Revoked S2 and checked now that the shared database is deleted ✅

TODO
Scenario 3:

  1. Repeat steps 1 and 2,
  2. Onboard another dataset (D3) in another enviironment where the database name is the same i.e. common_db
  3. Now make a share S1 from C1 to this dataset ( D3 ) and also make a share S2 with D2 or D1
  4. Revoke share items in share S2 and check if the common_shared db is still present ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant