Skip to content

Handle S3 access policy for group team without IAM user

0

I have an antivirus solution hosted on AWS, where the core component is a Node.js application running inside an AWS Fargate cluster. This application downloads a file from an S3 bucket, scans it, and then moves the clean file to a secondary bucket, while transferring any infected file to a quarantine bucket. When a file is quarantined, the application sends an email notification to the IT Security team for further investigation.

My main concern is how to mange access control for the quarantine bucket and its objects.

In our AWS account:

  • We cannot create IAM users.
  • We use AWS SSO.
  • We have federated users (e.g., email @ ab.onmicrosoft.com).
  • We have a distribution list email to notify the IT Security team.

We need to determine how to handle IAM access control for the quarantine bucket, specifically how to restrict access to the IT Security team, considering that I can't create IAM users (and the team may not have direct access to the AWS account where the application an the bucket is in and can access the bucket from another account => not sure about those constraint).

3 Answers
3

Hello,

You could create a role allowing federated users (via SSO) to assume it:

  • Create an IAM role for the IT team that allows federated users from your SSO provider to assume it. The trust policy should specify that only users authenticated via SSO can access the role
  • Attach an S3 access policy to this IT role, granting permissions to your quarantine bucket to retrieve objects inside it
  • Configure a bucket policy on the quarantine bucket to restrict access exclusively to this role, ensuring that no other identities can access the quarantined files
  • If the IT Security team needs access from another AWS account, update the trust policy of the IT role to allow cross-account access by specifying their AWS account ID

Hope it helps 😊

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • thank you for your response, could you please provide me with an example to help me understand better the policy. According to the email we use to login to our AWS accounts, looks like the organization uses Azure as AD.

    so how can it team use that role? by switch role via the console?

1

If you already connect to your AWS accounts using IAM Identity Center with your SSO (Azure AD), you basically just need to create or update your permission sets in IAM Identity Center.

Enter image description here For example, here there are 3 permission sets associate with this account : One for Billing Access Only, one for Read Only Access, and one for Administrator Access.

To create a specific quarantine bucket S3 access permission set named S3QuarantineBucketAccess, you need to attach a policy that grants the required permissions.
After that, you must associate the permission set with the necessary AWS accounts.
Create a permission set
Create a IAM Policy

If you prefer to use a bucket policy instead, create a permission set with no permissions (or use an existing one) and specify the ARN of the permission set in your bucket policy.
Referencing permission sets in resource policies

answered 2 years ago

  • Thank you for you answer this is helpful,

    how can i use this if the persons how want to access the quarantine bucket if are in one account and the quarantine bucket is on another account how can we use this technique to access the quarantine bucket from their account?

    Thank you!

0

Given your constraints and requirements, there are several approaches you can consider to manage access control for the quarantine bucket without creating IAM users:

  1. S3 Access Grants: This is a good option for granting granular access to specific S3 prefixes or buckets for users or groups from your corporate directory. When integrated with AWS IAM Identity Center (which works well with your SSO setup), you can grant read-only, write-only, or read-write access to the quarantine bucket directly to your IT Security team's group in your corporate directory. This approach eliminates the need to map users to IAM principals and simplifies auditing.

  2. Cross-account access with AWS Organizations: If the IT Security team needs to access the quarantine bucket from another AWS account, you can use a combination of bucket policies and IAM roles. Create an IAM role in the account where the quarantine bucket resides, and use a bucket policy that allows access only to principals from your AWS Organization. The IT Security team can then assume this role from their account to access the quarantine bucket.

  3. S3 Access Points: Create an S3 Access Point for the quarantine bucket with a policy that restricts access to specific federated identities or roles associated with your IT Security team. This provides a distinct network endpoint with its own access policy, allowing for more granular control.

  4. VPC Endpoint Policy: If access to the quarantine bucket should only be allowed from specific VPCs, you can use a VPC Endpoint for S3 with a policy that restricts access to buckets within your organization. This can be combined with other access control methods for added security.

For any of these approaches, you'll want to use the principle of least privilege, granting only the necessary permissions (e.g., s3:GetObject, s3:PutObject) on the specific bucket or prefix required.

Remember to also implement additional security measures such as enabling S3 Versioning, using server-side encryption, and setting up access logging for the quarantine bucket to maintain a strong security posture.

Given that your team uses federated identities, you'll need to work with your identity provider to map the appropriate groups or roles to the AWS permissions. This mapping can be done through IAM Identity Center or your federated identity solution.

Lastly, consider implementing a notification system using Amazon SNS or Amazon EventBridge to alert the IT Security team when new objects are added to the quarantine bucket, rather than relying solely on email notifications from your application.
Sources
Managing access with S3 Access Grants - Amazon Simple Storage Service
Examples of Amazon S3 bucket policies - Amazon Simple Storage Service
Access control in Amazon S3 - Amazon Simple Storage Service
Secure access to S3 buckets outside an AWS Organization from VPCs | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.