-
Notifications
You must be signed in to change notification settings - Fork 82
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
Clean up S3 Buckets in integration test #1603
Conversation
self._resource = session.resource('s3', region_name=region) | ||
self._region = region | ||
|
||
def delete_bucket(self, bucket_name): |
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.
you need to account for access points as well (if bucket have them it will fail)
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.
In a happy path world, we should not run into that situation because a dataset can only be deleted if all shares are revoked and if shares are revoked the access points are deleted. However, if the tests for revoking access points fail, then we would face this situation when tearing down resources. It is easy enough to implement, so I am adding it to the PR
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.
Tested! Now it is ready to be merged. Do you want to have a final look @petrkalos ?
…n-up-buckets-integration-test # Conflicts: # tests_new/integration_tests/core/environment/global_conftest.py
Not merging yet because while testing the code for access points a small error appeared. Wait for updates on this PR |
5421146
to
e014991
Compare
### Feature or Bugfix - Bugfix ### Detail This PR fixes a mismatch between the #1607 and #1603 where get_environment_aws_session is no longer used. In this PR we obtain the session from the new STSClient refreshable token functions introduced in #1607 ### Relates - #1603 - #1607 ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). - 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)? - Is the input sanitized? - What precautions are you taking before deserializing the data you consume? - 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? - 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? - 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? - 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.
Feature or Bugfix
Detail
Environment and Dataset stacks leave S3 Buckets to be deleted even when the CloudFormation stack is deleted.
This PR deletes the S3 Buckets when the session and temp fixtures for datasets and environments are deleted.
Testing
Tested that environment and dataset buckets are all deleted - in real AWS CICD pipeline with NOT-empty buckets.
Tested that dataset buckets with some manually created access points succeed.
Relates
Security
Please answer the questions below briefly where applicable, or write
N/A
. Based onOWASP 10.
fetching data from storage outside the application (e.g. a database, an S3 bucket)?
eval
or similar functions are used?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.