aws-sts

Amazon Bucket Policy for only mobile app access

夙愿已清 提交于 2021-02-18 13:51:54
问题 I have a bucket in Amazon S3 and I set data inside read only for everyone. However, this is not what I want. I would like that data to be accessible only from my mobile application and restrict it to download by url. Is that possible? if so how to implement such bucket policy? 回答1: Traditionally, access to a mobile app is done this way: The mobile app user authenticates to your back-end (through your mobile app). This could be done with Amazon Cognito or with your own database of username

How to copy files between S3 buckets in 2 different accounts using boto3

女生的网名这么多〃 提交于 2020-12-01 15:08:53
问题 I'm trying to files from a vendors S3 bucket to my S3 bucket using boto3. I'm using the sts service to assume a role to access the vendor s3 bucket. I'm able to connect to the vendor bucket and get a listing of the bucket. I run into CopyObject operation: Access Denied error when copying to my bucket. Here is my script session = boto3.session.Session(profile_name="s3_transfer") sts_client = session.client("sts", verify=False) assumed_role_object = sts_client.assume_role( RoleArn="arn:aws:iam:

How to copy files between S3 buckets in 2 different accounts using boto3

岁酱吖の 提交于 2020-12-01 15:06:28
问题 I'm trying to files from a vendors S3 bucket to my S3 bucket using boto3. I'm using the sts service to assume a role to access the vendor s3 bucket. I'm able to connect to the vendor bucket and get a listing of the bucket. I run into CopyObject operation: Access Denied error when copying to my bucket. Here is my script session = boto3.session.Session(profile_name="s3_transfer") sts_client = session.client("sts", verify=False) assumed_role_object = sts_client.assume_role( RoleArn="arn:aws:iam:

unable to assume role after enforcing MFA policy

回眸只為那壹抹淺笑 提交于 2019-12-25 01:38:39
问题 I created a new policy to enforce IAM user to setup MFA using the policy in this link https://docs.aws.amazon.com/en_pv/IAM/latest/UserGuide/reference_policies_examples_aws_my-sec-creds-self-manage.html Now the IAM user has AdministratorAccess already..so now with applying this force MFA policy now the user has 2 policies attached. The AWS managed policy AdministratorAccess and the new Managed policy i created Force_MFA now when i try to run ansible iwth module https://docs.ansible.com

How to increase the duration of STS credentials validity from one hour?

…衆ロ難τιáo~ 提交于 2019-12-13 03:57:22
问题 I am going through this AWS doc about temporary credentials, and I have come across this, about the duration of them: The GetSessionToken action must be called by using the long-term AWS security credentials of the AWS account or an IAM user. Credentials that are created by IAM users are valid for the duration that you specify, from 900 seconds (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default of 43200 seconds (12 hours); credentials that are created by using account

Using AWS (S3) via jclouds - how to assume role

不羁的心 提交于 2019-12-12 20:38:24
问题 When using plain auth credentials I can do: ContextBuilder.newBuilder("aws-s3").credentials(keyId, key).buildView(BlobStoreContext.class); ... to access BlobStoreContext for S3. In native Amazon java api I can use Security Token Service (STS) to assume role and use temporary credentials to access S3 or any other AWS service. How do I do this in jclouds? 回答1: I figured it out. This code snippet allows to assume role and use temp credentials to access S3: STSApi api = ContextBuilder.newBuilder(