Cascading cross-account permissions
Follow these steps to set up and test cross-account permission cascading:
-
Create an LF-Tag using the Lake Formation console:
Tag Key:
c175912681300719Tag Values:
[all,public]
-
Associate a table with the tag and value:
Key:
c175912681300719Value:
all
-
Grant cross-account tag policy permission. Grant
SELECTpermission on tag policy from accountto account111122223333:444455556666aws lakeformation grant-permissions \ --cli-input-json '{ "Principal": { "DataLakePrincipalIdentifier": "444455556666" }, "Resource": { "LFTagPolicy": { "CatalogId": "111122223333", "ResourceType": "TABLE", "Expression": [{ "TagKey": "c175912681300719", "TagValues": [ "all" ] }] } }, "Permissions": [ "SELECT" ] }'The consumer account (
444455556666) admin can access tables tagged with the tag. The consumer account can't cascade permission grants to other users with either of the tag values.c175912681300719:all -
Grant
DESCRIBEpermission. The producer account admin grantsDESCRIBEon the tag key and both values to the consumer account:aws lakeformation grant-permissions \ --cli-input-json '{ "Principal": { "DataLakePrincipalIdentifier": "444455556666" }, "Resource": { "LFTag": { "CatalogId": "111122223333", "TagKey": "c175912681300719", "TagValues": ["all","public"] } }, "Permissions": [ "DESCRIBE" ] }'The consumer account admin tries to cascade the permission to other users using the tag
and value "c175912681300719all" (identical policy):aws lakeformation grant-permissions --region us-east-1 --cli-input-json '{ "Principal": { "DataLakePrincipalIdentifier": "arn:aws:iam::444455556666:role/AccessAnalyzerTrustedService" }, "Resource": { "LFTagPolicy": { "CatalogId": "111122223333", "ResourceType": "TABLE", "Expression": [ { "TagKey": "c175912681300719", "TagValues": [ "all" ] } ] } }, "Permissions": [ "SELECT" ] }'Result: AccessDeniedException
The grant fails because Lake Formation detects that the LF-Tag policy is exactly the same as the LF-Tag policy used by the producer account to share resources with the consumer account, and only checks if the user has grantable permissions, not Rule #2 (DESCRIBE permissions).
Grant with multiple tag values:
aws lakeformation grant-permissions --region us-east-1 --cli-input-json '{ "Principal": { "DataLakePrincipalIdentifier": "arn:aws:iam::444455556666:role/AccessAnalyzerTrustedService" }, "Resource": { "LFTagPolicy": { "CatalogId": "111122223333", "ResourceType": "TABLE", "Expression": [ { "TagKey": "c175912681300719", "TagValues": [ "all","public" ] } ] } }, "Permissions": [ "SELECT" ] }'Result – Success – Policy is not identical, so Rule #2 applies and DESCRIBE permissions are sufficient.
Consumer attempts single
publicvalue – Succeeds:aws lakeformation grant-permissions --cli-input-json '{ "Principal": { "DataLakePrincipalIdentifier": "arn:aws:iam::444455556666:role/AccessAnalyzerTrustedService" }, "Resource": { "LFTagPolicy": { "CatalogId": "111122223333", "ResourceType": "TABLE", "Expression": [ { "TagKey": "c175912681300719", "TagValues": [ "public" ] } ] } }, "Permissions": [ "SELECT" ] }'Policy is not identical, so Rule #2 applies.