Estoy tratando de configurar un S3 Access Setup un poco más complicado en Amazon Web Services S3.
El entorno consta de lo siguiente: Account A - User/Role X Account B - User/Role Y Account C - User/Role Z - Bucket 1
Usuario/Rol X, Y y Z tienen adjunta la política "AdminstratorAccess": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "*", "Resource": "*" } ] }
En el depósito 1 se asigna la siguiente política de depósito: { "Version": "2012-10-17", "Statement": [ { "Sid": "AddPermGet", "Effect": "Allow", "Principal": { "AWS": [ "arn:aws:iam::ACCCOUNT-B:user/someuser" ] }, "Action": [ "s3:PutObject", "s3:PutObjectAcl" ], "Resource": "arn:aws:s3:::s3bucket/*" }, { "Sid": "AddPermGet", "Effect": "Allow", "Principal": { "AWS": [ "arn:aws:iam::ACCCOUNT-A:user/someuser" ] }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::s3bucket/*" }, { "Sid": "AddPermList", "Effect": "Allow", "Principal": { "AWS": [ "arn:aws:iam::ACCCOUNT-A:user/someuser" ] }, "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::s3bucket" } ] }
Definición: la Account C is Owner of Bucket 1
Mis Pruebas:
uploading a file with user/role Z of Account C in Bucket 1 --> accessible for everyone granted in bucket policy --> User X and Z can access the file uploading a file with user/role Y of Account B to Bucket 1 --> accessible only for user/role Y regardles of bucket policy content uploading a file with user/role Y of Account B to Bucket 1 with "bucket-owner-full-control" (as defined in http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) --> accessible only for user/role Y and Z - but X gets: fatal error: An error occured (403) when calling the HeadObject operation: Forbidden. A list bucket works for all Users including X.
Me gustaría llegar a que un archivo cargado por el usuario/función Y de la cuenta B en el depósito 1 tenga el mismo comportamiento que el usuario/función Z de la cuenta C (el propietario del depósito) cargaría el archivo. Claramente: necesito acceso definido por la Política, no por el Archivo en sí. ¿Es posible habilitar la "herencia"?
Saludos, Matías