Subchapter 46.2
references/permission-debugging.mdMarkdown9 KBView on GitHub
Systematic diagnostic procedure for permission and access errors in AWS Clean Rooms.
aws cleanrooms list-memberships --status ACTIVE --region ${region} and filter by collaborationId.You MUST ask for all required parameters upfront. You MUST NOT block on optional parameters.
aws sts get-caller-identityClassify the error: result writing failure (result receiver role), data access failure (data access service role), table association failure, or cross-account failure.
aws cleanrooms get-membership --membership-identifier ${membership_id} --region ${region}collaboration_id was not provided, extract it from the get-membership responseaws cleanrooms get-collaboration --collaboration-identifier ${collaboration_id} --region ${region}aws cleanrooms list-protected-queries --membership-identifier ${membership_id} --status FAILED --region ${region}protectedQueryId. If multiple, ask the user to confirm.aws cleanrooms get-protected-query --membership-identifier ${membership_id} --protected-query-identifier ${query_id} --region ${region}defaultResultConfiguration in the get-membership response. If a protected query is involved, also check its outputConfiguration as it may override the membership default.aws cleanrooms list-configured-table-associations --membership-identifier ${membership_id} --region ${region}configuredTableAssociationIdentifier. If multiple, ask the user to confirm.aws cleanrooms get-configured-table-association --membership-identifier ${membership_id} --configured-table-association-identifier ${association_id} --region ${region}configuredTableIdentifier and the service role ARN.aws cleanrooms get-configured-table --configured-table-identifier ${configured_table_id} --region ${region}databaseName and tableName from tableReference.glue.aws glue get-table --database-name ${database_name} --name ${table_name} --region ${region}Table.StorageDescriptor.Locationsearch_documentation for that source’s access requirements.role_name from the role ARN (segment after the last /). Retain the full ARN as role_arn for policy resource checks.aws iam get-role --role-name ${role_name}aws iam list-role-policies --role-name ${role_name}aws iam list-attached-role-policies --role-name ${role_name}aws iam get-role-policy --role-name ${role_name} --policy-name ${policy_name}aws iam get-policy --policy-arn ${policy_arn} then aws iam get-policy-version --policy-arn ${policy_arn} --version-id ${version_id}cleanrooms.amazonaws.comglue:GetDatabase, glue:GetTable, glue:GetPartitions, glue:BatchGetPartition, glue:GetSchema, glue:GetSchemaVersion, s3:GetObject, s3:GetBucketLocation, s3:ListBucket. For other data source types, use search_documentation for current requirements.s3:PutObject, s3:GetBucketLocation, s3:ListBucketcleanrooms:StartProtectedQuery):
StartProtectedQuery: cleanrooms:GetCollaborationAnalysisTemplate, cleanrooms:GetSchema, s3:GetBucketLocation, s3:ListBucket, s3:PutObjectStartProtectedJob: cleanrooms:GetCollaborationAnalysisTemplate, cleanrooms:GetSchemaCreateConfiguredTableAssociation / UpdateConfiguredTableAssociation: iam:PassRoleCreateMembership / UpdateMembership: iam:PassRole, s3:GetBucketLocation; also logging actions if query logging is configured: logs:CreateLogDelivery, logs:CreateLogGroup, logs:DeleteLogDelivery, logs:DescribeLogGroups, logs:DescribeResourcePolicies, logs:GetLogDelivery, logs:ListLogDeliveries, logs:PutResourcePolicy, logs:UpdateLogDeliveryCreateConfiguredTable: glue:GetDatabase, glue:GetDatabases, glue:GetTable, glue:GetTables, glue:GetPartition, glue:GetPartitions, glue:BatchGetPartition, glue:GetSchema, glue:GetSchemaVersioniam:PassRole failures, verify the policy includes iam:PassRole with iam:PassedToService restricted to cleanrooms.amazonaws.com. Reference: IAM troubleshooting (opens in a new tab)AWSCleanRoomsFullAccessNoQuerying is attached — this policy explicitly denies cleanrooms:StartProtectedQuery and cleanrooms:UpdateProtectedQuery and cannot be overridden by adding permissions. Reference: AWS managed policies (opens in a new tab)aws:PrincipalOrgID, VPC endpoint, or IP restriction conditions)aws s3api get-bucket-policy --bucket ${bucket_name}aws s3api get-bucket-encryption --bucket ${bucket_name} — if SSEAlgorithm is aws:kms, extract the KMS key ARN from KMSMasterKeyIDaws kms get-key-policy --key-id ${key_id} --policy-name defaultkms:Decrypt and kms:DescribeKeykms:GenerateDataKey (required to write new objects to an SSE-KMS bucket)You MUST perform this step for Glue/S3-backed data sources if IAM and S3 policies appear correct, as multiple issues may exist simultaneously. Lake Formation settings apply account-wide to all Glue catalog access.
aws lakeformation get-data-lake-settings --region ${region}CreateDatabaseDefaultPermissions or CreateTableDefaultPermissions is empty, Lake Formation enforces fine-grained access — IAM Glue permissions alone are not sufficientaws lakeformation list-permissions --resource-type TABLE --resource '{"Table":{"DatabaseName":"${database_name}","Name":"${table_name}"}}' --region ${region}IAM_ALLOWED_PRINCIPALS granted, Lake Formation is not blocking — look elsewhereaws lakeformation list-permissions --principal DataLakePrincipalIdentifier=${role_arn} --region ${region}AssumeRolePolicyDocument from the aws iam get-role output in Step 3"Principal": {"Service": "cleanrooms.amazonaws.com"} and "Action": "sts:AssumeRole"Condition block for overly restrictive keys:
aws:SourceArn — must match the collaboration or membership ARN patternaws:SourceAccount — must include the collaborating account ID(s)aws cleanrooms list-members --collaboration-identifier ${collaboration_id} --region ${region}Identify the root cause, provide the exact policy fix with CLI commands. Warn the user about security implications of permission changes and suggest least-privilege policies. Reference service role setup docs (opens in a new tab).
Expected output format:
## Error Classification
- Type: [result writing | data access | table association | caller IAM | iam:PassRole | cross-account]
- Role: [role ARN]
## Diagnostic Results
1. [PASS/FAIL] IAM Role Policies
2. [PASS/FAIL] S3 Bucket Policy
3. [N/A/PASS/FAIL] KMS Key Policy
4. [N/A/PASS/FAIL] Lake Formation
## Root Cause
[One-paragraph explanation]
## Fix
[Exact policy statement + CLI command]