-
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
827 share verify and reapply fix #1062
Conversation
# Conflicts: # backend/dataall/modules/datasets/api/table/resolvers.py # backend/migrations/versions/4f3c1d84a628_modify_notifications_column_types.py # deploy/stacks/backend_stack.py # deploy/stacks/ses_stack.py # frontend/src/modules/Environments/views/EnvironmentCreateForm.js # template_cdk.json
…nto bucket_share_anushka
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.
There are a lot of formatting changes making it a bit hard to track what changed (#1076 )
backend/dataall/modules/dataset_sharing/db/share_object_repositories.py
Outdated
Show resolved
Hide resolved
backend/dataall/modules/dataset_sharing/db/share_object_repositories.py
Outdated
Show resolved
Hide resolved
revoked_tables, | ||
source_environment, | ||
target_environment, | ||
env_group, | ||
).process_revoked_shares() | ||
log.info(f'revoking tables succeeded = {revoked_tables_succeed}') | ||
log.info(f"revoking tables succeeded = {revoked_tables_succeed}") |
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.
nit: Why switching those to double-quotes? I noticed that in other files you used single-quotes for strings.
Also generally speaking and especially in large PRs (like this) I'd refrain including unrelated changes in the same PR (i.e reformatting)
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.
Ran black formatter on this file to quickly fix the linting errors I was receiving from code changes I introduced - ended up re-formatting a lot of the file
To standardize formatting in the backend post this PR - for now I will leave the changes as such if okay with you
backend/dataall/modules/dataset_sharing/services/data_sharing_service.py
Outdated
Show resolved
Hide resolved
...end/dataall/modules/dataset_sharing/services/share_managers/s3_access_point_share_manager.py
Outdated
Show resolved
Hide resolved
...end/dataall/modules/dataset_sharing/services/share_managers/s3_access_point_share_manager.py
Show resolved
Hide resolved
backend/migrations/versions/af702716568f_add-share_health_columns.py
Outdated
Show resolved
Hide resolved
...d/dataall/modules/dataset_sharing/services/share_processors/s3_access_point_process_share.py
Show resolved
Hide resolved
...end/dataall/modules/dataset_sharing/services/share_managers/s3_access_point_share_manager.py
Show resolved
Hide resolved
...end/dataall/modules/dataset_sharing/services/share_managers/s3_access_point_share_manager.py
Show resolved
Hide resolved
...d/dataall/modules/dataset_sharing/services/share_processors/s3_access_point_process_share.py
Show resolved
Hide resolved
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.
Mostly minor things except for the default value of Healthy that I think it might be a tiny bug. I also reviewed the test cases, they look great. One curiosity, have you tested more than one error at the same time? From the code I think it will work fine
Yup have tested multiple at the same time as well! No errors seen so far with that either |
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.
lgtm, approving
### Feature or Bugfix - Bugfix ### Detail For S3 bucket shares and for S3 access point shares (folder sharing) - In share-verify workflow add a check to verify the managed policy for shares is attached to the target role. Log the error and raise an unhealthy status - In share-approve workflow add a check to verify the managed policy for shares is attached to the target role and attach the policy if the requester is a Group or a data.all Managed Consumption role ### Relates - #1062 - #1068 ### 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. --------- Co-authored-by: Noah Paige <noahpaig@amazon.com>
Feature or Bugfix
Detail
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?Pending TODO
Things to Consider
ECS Scheduled Task to be Weekly (default)
config.json
Currently shareitem health columns (
healthStatus
,healthMessage
,lastVerifiedTimestamp
) are a part of the sameshare_object_item
table - makes it very easy to get the latest health of each share itemshare_object_item_health
table that tracks every verify attempt and a column inshare_object_item
to point to the primary key of the record inshare_object_item_health
with the latest health information (updated for each verification run) - would persist each verification run for auditability / traceabilityBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.