Reputation: 89
I've read lots and lots of posts that touch on what I think should be a very common use case - but without finding exactly what I want, or a simple reason why it can't be done.
I have some files on S3. I want to be able to grant certain users access to certain files, via a front end that I build.
So far, I've made it work this way:
This works, but isn't ideal, and also just doesn't feel right. I've got to keep a mirror of the buckets, and I also have to maintain my own list of user/passwords and permissions, when AWS already has all that built in.
What I really want is to simply create the users in IAM and use group permissions in IAM to control access to the S3 buckets. No duplication of data or function. My app would request a UN/PW from the user and use that to connect to IAM/S3 to pull the list of buckets and files, then display links to the user. Simple.
How can I, or why can't I?
Am I looking at this the wrong way?
What's the "right" way to address this (I assume) very common use case?
Upvotes: 5
Views: 2700
Reputation: 163
You should consider using Amazon Cognito(released 2014) to create unique identities for your users and authenticate them for secure access to your AWS resources like Amazon S3 or DynamoDB.
You can leverage AWS IAM identities, Custom developers identity, public identity providers like Amazon IAM, Facebook, Twitter, Google, or any OpenID Connect-compatible provider.
Here is a high-level architecture of how Amazon Cognito can be used
FAQs here - https://aws.amazon.com/cognito/faqs/
Upvotes: 1
Reputation: 1145
Your line of thoughts is correct, let's take a look at alternatives:
Your app store the api keys and secrets of all the users and delegate everything to AWS IAM permissions system. While being architecturally simpler solution, the details can kill it. Your app should be really secured, and host the secret api keys in a very secured way. This actually depends on the use-cases:
Your app connects to AWS with a single 'strong' api key - but queries AWS API if the specific user is allowed for that action on that resource. Sadly, I'm not familiar with similar AWS api - so maybe some of the other reader would like to comment on that. This(if possible) will be the most simple and secured solution.
Grow your exiting solution to use the data stored at AWS : users, groups, user->groups assignment and use the user/group policies as the data source for your permissions checks. This way, you'll have some logic duplication with AWS (which is fine) but will not have data duplication which is the real pain.
Upvotes: 1