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?
AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.
When you use a role, you don't have to distribute long-term credentials (such as a user name and password or access keys) to an Amazon EC2 instance. Instead, the role supplies temporary permissions that applications can use when they make calls to other AWS resources.
IAM database authentication works with MariaDB, MySQL, and PostgreSQL. With this authentication method, you don't need to use a password when you connect to a DB instance. Instead, you use an authentication token. An authentication token is a unique string of characters that Amazon RDS generates on request.
You can assign an existing IAM role to an AWS Directory Service user or group. The role must have a trust relationship with AWS Directory Service. For more information, see Editing the trust relationship for an existing role. In the AWS Directory Service console navigation pane, choose Directories.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With