-
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
Scope down dataset sharing requester IAM role managed IAM policy S3 permissions #1280
Scope down dataset sharing requester IAM role managed IAM policy S3 permissions #1280
Conversation
… read only for consumption role
This is an extension of #1262 to add s3:GetObject permissions and remove s3:* permissions |
@mourya-33 while teting I found the following issues:
|
@SofiaSazonova , this also seem to require a change in the test assertions. I am testing this locally and will push the changes early next week. |
@mourya-33 Sorry for not writing all at once, but I just realised: |
@dlpzx @noah-paige I need your advice here: is it ok to put the backfilling of iam policies in migration scripts? |
### Feature or Bugfix - Feature ### Detail During the work on #1280 we encountered a problem: we need to revise all share-policies in already existed AWS deployments (remove s3:* permissions and add appropriate ones). It sounds like "migration", but has nothing to do with database, so it doesn't belong to alembic migrations module. As a general solution to such problems, we introduced 'dataall migrations' -- a module, that is called in lambda function, triggered by update of backend stack, after DB-migrations. This module has the same logic of migrations, which are executed one by one. Current revision uid is stored in SSM Parameter store. Module contains:| - BaseDataAllMigration -- python class -- a base for future migrations - Herder -- python class, that handles migrations - folder "versions", where python files are stored with subclasses of BaseDataAllMigration. Each subclass has parameters - uid of the revision `key = '51132fed-c36d-470c-9946-5164581856cb' - name ` name = 'Remove Wildcard from Sharing Policy' - short description `description = 'Remove Wildcard from Sharing Policy' - uid of previous migration, to specify the order `previous_migration = '0' # initial migration` - possible methods `up` and `down` for upgrade and downgrade respectively In order to add new migration, developer needs to create a python class in folder "versions" (folder name is hardcoded by now) and specify the parameters described above. Right now it can be done only manually. ### 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: Sofia Sazonova <sazonova@amazon.co.uk>
Feature or Bugfix
Detail
This PR will address the issue - 1226
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)? N/A
eval
or similar functions are used? N/ABy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.