Questions tagged [aws-policies]

223 questions
0
votes
0 answers

AWS S3 restrict access to dated files

I'm using AWS S3 component to store and distribute files. I have a bucket called "mybucket" and with a single folder where each file has a daily iso date in…
pyCthon
  • 11,746
  • 20
  • 73
  • 135
0
votes
0 answers

Understanding the AWS policy

I have the below customer managed AWS policy which I am finding trouble understanding the iamPassRole and iam:PassedToService section { "Version": "2022--10-17", "Statement": [ { "Effect": "Allow", "Action": [ "eks:*" …
zilcuanu
  • 3,451
  • 8
  • 52
  • 105
0
votes
0 answers

AWS ECR Lifecycle policy is not showing in Amazon Elastic Container Registry

I have in my repo a yaml file template.yaml where I have the sam template that defines all the infrastructure for a lambda function in it and it works perfectly. I wanted to add the following lifecycle policy to keep only 200 images on…
WiseUser
  • 23
  • 3
0
votes
1 answer

Is there any way to update SNS Topic policy through Java SDK?

I do have an SNS Topic in my AWS account, which I created through Java SDK, hence the policies attached are default policies. Is there any way to update the policy through java SDK itself?
Sonu
  • 179
  • 1
  • 11
0
votes
1 answer

Data Type Mismatch and Policies must be valid JSON and the first byte must be '{'

I need to make a CORS Policy for my S3 Bucket. In the console, it says the policy has to be valid JSON. I copy and paste their examples and immediately it errors stating they're formatted improperly. This is basically what I'm trying: [ { …
David
  • 7,028
  • 10
  • 48
  • 95
0
votes
0 answers

AWS IAM. How allow all resources with some tag?

I need to write policy to allow see all Secrets with some tag. But when I use condition, user with this policy loses all access. What am I doing wrong? Here is my policy: { "Version": "2012-10-17", "Statement": [ { "Sid":…
0
votes
1 answer

Do AWS IAM policies need to be "reciprocal" for API Gateway?

Do policies need to be defined on both sides of a relationship? For example, suppose I have a Lambda with a policy that allows every principal on the account to invoke it. If I create an API Gateway that needs to invoke that Lambda, do I need to…
0
votes
1 answer

aws terraform policy returns 'malformed' although it looks right

I'm following these instructions from AWS to try to add access logs to my application load balancer. Precisely the policies described at the Bucket permissions -> To prepare an Amazon S3 bucket for access logging -> point 5 Unfortunately when I add…
0
votes
1 answer

Restrict push action without pull request

Is there any way to make IAM policy where user should not be allowed to push the code to the branch directly? They should only do it through pull request.
0
votes
1 answer

AWS trusted entity with multiple principal types and condition

I have a Terraform code that generates a trusted entity like this that is attached to a role for cross-account access: { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", …
0
votes
1 answer

S3 Bucket upload restriction based on file name and extension

Please check this JSON code and let me know what is wrong? All files gets denied. I need code where certain types of files can be uploaded by the users in the console. { "Version": "2012-10-17", "Id": "Policy1657799010112", "Statement": [ { …
0
votes
1 answer

AWS SCP , enforce tagging for EC2 and allow specific AWS Backup service role to restore

I have a tag enforcement scp that deny ec2 creation without CodeDomaine Tag except for AWS Backup service: "Statement": [ { "Sid": "DenyEC2CreationSCP1", "Effect": "Deny", "Action": [ "ec2:RunInstances" ], …
0
votes
1 answer

Prevent user to push changes to named-like branch on CodeCommit

I try to limit possibility to push changes to release branch on CodeCommit repository on AWS. The problem is that release branch has subbranches like releases/3.4.1 or releases/4.1.4 and i want to prevent from push changes to any subbranch. I wrote…
0
votes
1 answer

Enforce tags for S3-bucket creation

I have been trying to create an IAM policy to enforce tagging for S3 resources. The policy: { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Deny", "Action": [ "s3:CreateBucket" …
gromyk
  • 570
  • 5
  • 17
0
votes
1 answer

Which is the correct way to configure IpAddress condition in Policy document for REST API?

I'm trying to allow only specific IP addresses to access my API Gateway REST API without success. I configured the following resource policy: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", …