AWS lake-formation medium security documentation change
Summary
Updated integration process with detailed IAM role creation steps, policy attachments, and expanded CLI commands for S3 Tables catalog registration
Security assessment
Added explicit IAM trust policy with sts:SetContext and sts:SetSourceIdentity actions, which are security-sensitive permissions. Introduced granular s3tables permissions policy and source account condition to limit access. The change demonstrates security hardening through least-privilege IAM roles.
Diff
diff --git a/lake-formation/latest/dg/enable-s3-tables-catalog-integration.md b/lake-formation/latest/dg/enable-s3-tables-catalog-integration.md index 794ae8fae..86d931da6 100644 --- a//lake-formation/latest/dg/enable-s3-tables-catalog-integration.md +++ b//lake-formation/latest/dg/enable-s3-tables-catalog-integration.md @@ -36 +36,26 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - 1. Register the S3 Tables catalog as a Lake Formation data location. +Following the prerequisites section, create an IAM service role that allows Lake Formation to access your table resources. + + 1. Create a file called `Role-Trust-Policy.json` that contains the following trust policy: + + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "LakeFormationDataAccessPolicy", + "Effect": "Allow", + "Principal": { + "Service": "lakeformation.amazonaws.com" + }, + "Action": [ + "sts:AssumeRole", + "sts:SetContext", + "sts:SetSourceIdentity" + ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": "111122223333" + } + } + } + ] + } @@ -38,5 +63,50 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - aws lakeformation register-resource \ - --resource-arn 'arn:aws:s3tables:us-east-1:123456789012:bucket/*' \ - --role-arn 'arn:aws:iam::123456789012:role/LakeFormationDataAccessRole' \ - --with-federation - --with-privileged-access + 2. Create the IAM service role by using the following command: + + aws iam create-role \ + --role-name S3TablesRoleForLakeFormation \ + --assume-role-policy-document file://Role-Trust-Policy.json + + 3. Create a file called `LF-GluePolicy.json` that contains the following policy: + + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "LakeFormationPermissionsForS3ListTableBucket", + "Effect": "Allow", + "Action": [ + "s3tables:ListTableBuckets" + ], + "Resource": [ + "*" + ] + }, + { + "Sid": "LakeFormationDataAccessPermissionsForS3TableBucket", + "Effect": "Allow", + "Action": [ + "s3tables:CreateTableBucket", + "s3tables:GetTableBucket", + "s3tables:CreateNamespace", + "s3tables:GetNamespace", + "s3tables:ListNamespaces", + "s3tables:DeleteNamespace", + "s3tables:DeleteTableBucket", + "s3tables:CreateTable", + "s3tables:DeleteTable", + "s3tables:GetTable", + "s3tables:ListTables", + "s3tables:RenameTable", + "s3tables:UpdateTableMetadataLocation", + "s3tables:GetTableMetadataLocation", + "s3tables:GetTableData", + "s3tables:PutTableData" + ], + "Resource": [ + "arn:aws:s3tables:us-east-1:111122223333:bucket/*" + ] + } + ] + } + + 4. Attach the policy to the role by using the following command: @@ -44 +114,4 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - 2. Create a catalog. + aws iam put-role-policy \ + --role-name S3TablesRoleForLakeFormation \ + --policy-name LakeFormationDataAccessPermissionsForS3TableBucket \ + --policy-document file://LF-GluePolicy.json @@ -46 +119 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - aws glue create-catalog --cli-input-json file://input.json + 5. Create a file called `input.json` that contains the following: @@ -48 +121,16 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - '{ + { + "ResourceArn": "arn:aws:s3tables:us-east-1:111122223333:bucket/*", + "WithFederation": true, + "RoleArn": "arn:aws:iam::111122223333:role/S3TablesRoleForLakeFormation" + } + + 6. Register table buckets with Lake Formation by using the following command: + + aws lakeformation register-resource \ + --region us-east-1 \ + --with-privileged-access \ + --cli-input-json file://input.json + + 7. Create a file called `catalog.json` that contains the following catalog: + + { @@ -52 +140 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - "Identifier": "arn:aws:s3tables:us-east-1:123456789012:bucket/*", + "Identifier": "arn:aws:s3tables:us-east-1:111122223333:bucket/*", @@ -56 +144,3 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - "CreateTableDefaultPermissions": [] + "CreateTableDefaultPermissions": [], + "AllowFullTableExternalDataAccess": "True" + } @@ -58 +147,0 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. - }' @@ -59,0 +149,9 @@ To create multi-level catalogs, see the [Creating a table bucket ](https://docs. + 8. Create the `s3tablescatalog` catalog by using the following command. Creating this catalog populates the AWS Glue Data Catalog with objects corresponding to table buckets, namespaces, and tables. + + aws glue create-catalog \ + --region us-east-1 \ + --cli-input-json file://catalog.json + + 9. Verify that the `s3tablescatalog` catalog was added in AWS Glue by using the following command: + + aws glue get-catalog --catalog-id s3tablescatalog