-
Notifications
You must be signed in to change notification settings - Fork 22
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
Manage Access to credentialed-access projects Using Access Point Policies #2293
base: dev
Are you sure you want to change the base?
Conversation
First observation: the name of the class should probably be Second: we want to associate access points with particular Users, not particular AWS principals. Because:
We could define
Which is essentially the same thing as ManyToManyField at the database level, but at the Python level it gives more flexibility for the future. |
Now, I say this, but to be fair, there is still an open question of whether we want to allow one person to use multiple AWS principals. Doing that, however, could be quite messy UX-wise (we'd either have to tell people "use access point X if you're using principal A, use access point Y if you're using principal B"... or else we'd have to tell people that every time they add a new principal they might be bumped to a different AP.) Anyway, I think if we want to add that feature down the road, we can define new models at that point to support it. |
I don't like having "aws_id" as an argument to To obtain the S3 URI for a particular authorized user, we might end up doing something like
If the region and account ID are required as part of the S3 URI for the access point, those things should be stored in the |
The basic concept here, I think, is to automatically grant access to everyone who has a linked AWS account and has permission to access the project. Still some details need working out, but is that broadly how we want this to work? Or should we instead grant access only to people who request it? I don't think it makes a huge difference, but doing the latter has some advantages: fewer APs to manage, and we get some feedback about how many people are using the feature. |
|
…ring projects with a 'RESTRICTED/CREDENTIALED' access policy.
…s being created for the open data bucket or the controlled data bucket. This update also changes how we grant access to users for the controlled-access dataset by using Access Points (APs). It includes creating and listing APs, creating and updating AP policies, and associating AWS users with APs.
… view to use update_data_access_point_policy instead of the old bucket policy update method. Ensure the S3 credentials exist before updating the data access point policy.
…play the AWS sync command.
…PointUser. Associate access points with specific users instead of AWS principals. Modify the s3_uri() method to retrieve the AWS ID from the cloud information associated with the logged-in user. This information is used to properly display the AWS sync command for the logged-in user.
…ormation to be compatible with the changes made in the AWSAccessPoint and AWSAccessPointUser models.
…ged-in user in the AWS model.
729aa5d
to
e7a527e
Compare
93b7cc5
to
ed5c551
Compare
@bemoody This is a list of the changes addressed in this current PR:
|
@bemoody These are the issues created to address the next features to be implemented as enhancements (a new label, "enhancement," has been created) as new PRs: Issue #2330
Issue #2332
|
@bemoody The PR is now ready for review. |
This should be:
|
Just write
(or maybe the check for sent_files should be in the view) |
|
Just write:
Then |
|
@bemoody Your last review comments have been addressed. |
In project/cloud/s3.py
In project/views.py
|
703eaa5
to
1d25b61
Compare
1d25b61
to
08fbcd6
Compare
@bemoody Your last review comments have been addressed. |
In the
Should be:
Trying to create two objects with the same name should be an error. Also, it's important to be aware of the maximum length, and it's useful to add a comment to explain this for future maintainers. |
In
userid is not the same as the AWS username; we literally just want to use the userid here. (The userid has the person's account number encoded in it, which is why |
As I've said before, there needs to be a restriction on ListBucket operations. This code allows anyone who is authorized to access any one published project to view the metadata of every published file in every published project. It would probably be sufficient to do this
but that should still be tested. |
Instead of writing this:
Write this:
If you expect to retrieve exactly one object (or zero), don't use |
Here's an example of where
Here, you're trying to retrieve the CloudInformation associated with a particular person (the person who signed the DUA.) You think you know which CloudInformation you're looking for - the one that has a particular But your assumption is incorrect. In fact, (Now, in this case, the query is completely unnecessary. You have the CloudInformation object already - it's |
8bdb305
to
15b9363
Compare
@bemoody I have made the changes to generate the access point policy with AWS user IDs (aws_userid) in the "Principal" field. I have tested their insertion, and they are working properly. |
@bemoody I've also finished addressing the other comments. I'd appreciate it if you could take a look at it again. |
This Pull Request implements the use of AWS S3 Access Point policies to manage access to restricted-access projects stored in S3 buckets.
The key change in this code is to ensure scalability, enabling access management as the number of projects and users grows.