Seperate AWS IAM users resources - amazon-web-services

I have 5 IAM users under my root account, and I want to let each user to display only his resources not all the resources from the main account.
I need this for S3 service, I want each user to list his own buckets only. not all the buckets
I tried IAM policies but non of them worked for me.
I tried few instructions from the AWS documentation but it didn't work too

You want to create separate accounts for your users to access.
Creating multiple sub accounts in IAM AWS

Related

What AWS IAM Policy to grant Admin right only on ressources created by your Identity?

I have an AWS account used by different people.
I want to give access to IAM Users in the IAM User Group Developer to only the resources they created. They should be able to create any resources and read and write all the resources they created.
So, when you logged as IAM User A part of IAM User Group Developer, you can read and edit all the resources IAM User A has created since the beginning. Also, you will be able to create any other resources.
I prefer to avoid using AWS Organisations. Moreover, there are resources shared across the account. There is already an Admin role and a ReadOnly role for these resources.
One solution would be to ask developers to use their AWS Accounts and permit them to access the main one with IAM Roles. However, I would like your help with a solution using only one AWS Account.

AWS IAM Policy for specific subaccount(s)

I have one organization with multiple sub accounts. I would like to create IAM Policies that grant users full administrator access to any resources in specific sub account (or sub accounts). How can this be achieved?
From an AWS Organization perspective, you have control over the accounts and resources via Service Control policies (SCPs).
"However, an SCP never grants permissions. Instead, SCPs are JSON policies that specify the maximum permissions for the affected accounts."
With that in mind, you can't grant users full administrator access to any resources in a specific subaccount(s) using AWS Organization and AWS IAM Policies only.
This leads us to (roughly) 3 paths:
By default, if you create a member account as part of your organization, AWS automatically creates a role in the account that grants administrator permissions to IAM users in the management account who can assume the role.
The IAM Role in question is OrganizationAccountAccessRole. You can customize its name and use it to grant your users full administrator access across all the resources inside the AWS account.
See: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html
Observations: Since this IAM Role is created in every account. You would need to intervene and limit the IAM Cross-Account access manually in each sub-account.
You can use AWS CloudFormation StackSets to deploy across multiple AWS accounts a list of IAM Roles your users could use for admin purposes (eg RoleFullAdmin, RoleReadOnly, RoleDevOps), and AWS Organizations enables you to create stack sets with service-managed permissions, using a service-linked role that has the relevant permission in each member account.
From your AWS Organizations management account (or delegated administrator account) you can deploy Stack Sets to current accounts and they are automatically deployed to every new account your create, keeping your resources in sync.
You can target accounts via account ID or organizational units (OUs).
See: https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-cloudformation.html
Observations: Similar to 1, since you are using IAM Role Cross-Account access, you need to manually intervene in the policy trust relationship.
Add AWS IAM Identity Center (successor to AWS Single Sign-On) to your AWS Organizations
What you are looking for can be achieved by Permission Sets in the AWS IAM Identity Center.
You can customize the access per user and have a many-to-many relationship between User <-> Accounts <-> Roles. You can define one or more IAM Policies in the Permission Set.
AWS provides predefined permissions that you can use too.
See: https://docs.aws.amazon.com/singlesignon/latest/userguide/permissionsetsconcept.html and https://docs.aws.amazon.com/singlesignon/latest/userguide/permissionsetpredefined.html
Observations: You need to add an extra resource to your AWS Organization and configure the identity source of your users. This also requires a change in the process of "how to login to our aws account". Now you need to use the AWS SSO etc.

How to create S3 Bucket for three different environments using single root account?

I've one AWS root account, if I need to grant the S3 bucket access to our application resides in Dev, Test and Prod environments. These S3 bucket will be accessed only by application and not by individual / manual user. I can refer multiple approaches, not sure which one is best approach here? Could you pls suggest on this?
Option-1: Create IAM user account for each environment with programmatic access only. Provide the Access KeyId and Secret Access key to respective environment(Dev, Test and Prod) to access the S3 resource. Separate S3 bucket will be created for each environment, S3 bucket policy will only allow the access to specific IAM user account only.
Option-2: Three separate AWS accounts. Not sure how to proceed on this further, will be having three root accounts to manage and separate billing, one S3 bucket for each AWS account.
Option-3: I can refer the landing zone concepts that comes with AWS organization account, Shared Services account, Log Archive Account and Security Account. Not sure where to specify / create the resources and IAM user account.

AWS IAM Policy to allow full access to services, but only on the instances this user created

I would like to write a policy for a new IAM user so that he can have a full access to AWS Services such as EC2, RDS, Cloud Front, S3, etc. However he should be only able to view (describe) and manage the instances/services that he launches. He can't see other existing/future instances/services created by other users.
This case happens in a company that wants to outsource some projects to an outsourced company. So the new IAM user is for giving access to the outsourced company to setup the staging & production environments in AWS that belongs to the company. How can I achieve this?
Thanks.
Best Regards,
Mark
AFAICT there are no conditions on creator.
One obvious alternative is having a separated dependent and linked account with consolidated billing. You can find some detail in the third scenario of this paper
https://media.amazonwebservices.com/AWS_Setting_Up_Multiuser_Environments_Education.pdf
[...] an administrator creates separate AWS accounts for each user who
needs a new AWS account. These accounts can optionally be linked
together and a single AWS account can be designated as the paying
account using consolidated billing, which provides a single bill for
multiple AWS accounts. The administrator then creates an IAM user in
each AWS account and applies an access control policy to each user.
Users are given access to the IAM user within their AWS account, but
do not have access to the root credentials of the AWS account.
Users can log into the AWS Management Console with their IAM
credentials and then they can launch and access different AWS
services, subject to the access control policies applied to their
account. Users have direct control over the access credentials for
their resources and they can also share these resources with other
users as necessary.

Creating multiple sub accounts in IAM AWS

I have a parent IAM account and I have multiple clients. I want to have multiple child account in AWS. I dont want the child account to see the resources in parent account and other child account.
How can I implement this?
Thanks
You can create multiple AWS accounts, and link them. You will have to do this with the master account root credentials, not an IAM account.
Full details are here:
Update, Q1 2017:
AWS has introduced Organizations, which lets you create a new account linked to your payer account. Organizations is also supported by the AWS CLI, so you can create new accounts programmatically, without needing the root credentials.
You can assume roles with temporary credentials to grant access between accounts, see http://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html