Skip to main content
Version: 97.1

AWS S3 and KMS

Factor House reads Apache Iceberg table metadata, manifests and data files from Amazon S3. Data inspect reads the data files, so the IAM principal that Factor House runs as needs permission to read your table data, and to decrypt it if it is encrypted with AWS KMS.

This page describes how to give Factor House an IAM role, and the permissions the role needs.

IAM access control​

Factor House authenticates with AWS by using the AWS SDK. You can configure authentication using one of the following methods, which determine the IAM principal that Factor House uses to make API calls.

Factor House only reads from your catalogs and buckets. It does not create, commit to, or delete Iceberg tables or S3 objects, so none of the policies on this page grant write access.

Default credentials provider chain​

When you do not configure explicit credentials, Factor House uses the AWS SDK's default credentials provider chain. This is the recommended approach for resources running within AWS, as Factor House can automatically and securely inherit permissions from an attached IAM role, for example an EC2 instance profile or an IAM role for a Kubernetes service account.

Amazon EKS (IAM roles for service accounts)​

On Amazon EKS, use IAM roles for service accounts to give the Factor House pod an IAM role.

Create an IAM role with the policies described below, and a trust policy that allows your cluster's OIDC provider to assume it for Factor House's Kubernetes service account:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<account-id>:oidc-provider/oidc.eks.<region>.amazonaws.com/id/<oidc-id>"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"oidc.eks.<region>.amazonaws.com/id/<oidc-id>:aud": "sts.amazonaws.com",
"oidc.eks.<region>.amazonaws.com/id/<oidc-id>:sub": "system:serviceaccount:<namespace>:<service-account-name>"
}
}
}
]
}

Annotate the service account that the Factor House Helm chart creates with the role ARN:

serviceAccount:
create: true
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::<account-id>:role/<factor-house-role>

The service account name is set by serviceAccount.name in the chart's values. Use the same name in the sub condition of the trust policy.

note

EKS Pod Identity also supplies credentials through the default credentials provider chain. The permissions policies are the same.

Kubernetes outside AWS and on-premises​

If you run Factor House in a Kubernetes cluster outside AWS, or in your own data center, the pod has no IAM role attached to it. You can still read Iceberg tables stored in Amazon S3 with one of the following methods.

Static credentials. Create a dedicated IAM user for Factor House, attach the policies described below, and configure its access keys for each catalog.

# Credentials for reading table data from S3
ICEBERG_CATALOG_S3_ACCESS_KEY_ID_<NAME>=AKIAIOSFODNN7EXAMPLE
ICEBERG_CATALOG_S3_SECRET_ACCESS_KEY_<NAME>=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

# Credentials for signing catalog requests (catalogs that use SigV4, such as AWS Glue and Amazon S3 Tables)
ICEBERG_CATALOG_REST_ACCESS_KEY_ID_<NAME>=AKIAIOSFODNN7EXAMPLE
ICEBERG_CATALOG_REST_SECRET_ACCESS_KEY_<NAME>=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

# AWS region. Outside AWS there is no default region, so set it explicitly
ICEBERG_CATALOG_S3_REGION_<NAME>=us-east-1
ICEBERG_CATALOG_REST_SIGNING_REGION_<NAME>=us-east-1
ICEBERG_CATALOG_CLIENT_REGION_<NAME>=us-east-1

Set ICEBERG_CATALOG_S3_REGION_<NAME> to the region of your S3 bucket. Set ICEBERG_CATALOG_REST_SIGNING_REGION_<NAME> for catalogs that use SigV4, and ICEBERG_CATALOG_CLIENT_REGION_<NAME> when you use the AWS clients for assume role or AWS Glue.

Store the secret access keys in a Kubernetes Secret rather than in plain text. See Manage sensitive environment variables. Use a dedicated IAM user with only the permissions on this page, and rotate its access keys regularly.

Assume a role. Instead of giving the IAM user permissions to your data directly, give it permission to assume an IAM role that has them. See Cross-account access.

Web identity federation. If your cluster can issue OpenID Connect tokens, you can register it as an OIDC identity provider in IAM and have the AWS SDK exchange the pod's token for role credentials by setting the standard AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE environment variables. Also set AWS_REGION and the region properties above.

tip

Factor House needs network access to the AWS endpoints for the services you use: Amazon S3, your catalog (for example AWS Glue), AWS STS and AWS KMS. If your data center reaches AWS over AWS Direct Connect or a VPN, you can use VPC endpoints for these services.

Cross-account access (STS AssumeRole)​

If your Iceberg catalog and S3 data are in a different AWS account than the credentials Factor House runs with, create an IAM role with the policies below in the data account, and a trust policy that allows the Factor House principal to assume it.

Then configure Factor House to assume that role for the catalog:

ICEBERG_CATALOG_CLIENT_FACTORY_<NAME>=org.apache.iceberg.aws.AssumeRoleAwsClientFactory
ICEBERG_CATALOG_CLIENT_ASSUME_ROLE_ARN_<NAME>=arn:aws:iam::<data-account-id>:role/<factor-house-role>
ICEBERG_CATALOG_CLIENT_ASSUME_ROLE_REGION_<NAME>=us-east-1
ICEBERG_CATALOG_CLIENT_ASSUME_ROLE_SESSION_NAME_<NAME>=factor-house
ICEBERG_CATALOG_CLIENT_ASSUME_ROLE_EXTERNAL_ID_<NAME>=<external-id>
ICEBERG_CATALOG_CLIENT_ASSUME_ROLE_TIMEOUT_SEC_<NAME>=900

For AWS Glue, also set ICEBERG_CATALOG_GLUE_ACCOUNT_ID_<NAME> to the account that owns the Glue Data Catalog. See AWS Glue cross-account access for a complete example.

Example IAM policies for Factor House​

caution

The policies below list the permissions needed to read Iceberg tables with Factor House. Validate them in your own environment before using them in production, for example with the IAM policy simulator, and tighten the resources to match your buckets and catalogs.

Amazon S3​

Factor House needs to read the objects in your table locations: table metadata, manifest lists, manifests and data files. It does not need write access.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadIcebergObjects",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<bucket>/<table-location-prefix>/*"
},
{
"Sid": "ListIcebergBucket",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::<bucket>",
"Condition": {
"StringLike": {
"s3:prefix": "<table-location-prefix>/*"
}
}
}
]
}

Add a statement for each bucket that holds Iceberg tables you want to inspect. If your tables are in a different account than the role, the bucket policy in that account must also allow the role to read the objects.

Set ICEBERG_CATALOG_S3_REGION_<NAME> or ICEBERG_CATALOG_CLIENT_REGION_<NAME> to the region of your bucket if it differs from the region Factor House is running in.

AWS KMS​

If your S3 buckets encrypt objects with server-side encryption with AWS KMS keys (SSE-KMS), Amazon S3 decrypts the objects for the caller, and the caller must be allowed to use the key. Without this permission, reads fail with an access denied error, even though the S3 permissions above are in place.

Add kms:Decrypt on the key that encrypts your tables:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DecryptIcebergObjects",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:<region>:<account-id>:key/<key-id>",
"Condition": {
"StringEquals": {
"kms:ViaService": "s3.<region>.amazonaws.com"
}
}
}
]
}

The condition restricts the role to using the key through Amazon S3. Remove it if you do not want to apply that restriction.

The key policy must also allow the role to use the key. This is the case by default when the key policy delegates access to IAM policies in the account. For a key in a different account, the key policy in the key's account must explicitly allow the Factor House role.

note

These permissions apply to objects encrypted with SSE-KMS. Iceberg table encryption (the encryption.kms-impl property) is not supported in this release.

AWS Glue​

For an AWS Glue Data Catalog, Factor House lists the databases and tables in the catalog and loads their definitions. Add the following alongside the Amazon S3 and AWS KMS policies:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadGlueCatalog",
"Effect": "Allow",
"Action": [
"glue:GetCatalog",
"glue:GetDatabase",
"glue:GetDatabases",
"glue:GetTable",
"glue:GetTables"
],
"Resource": [
"arn:aws:glue:<region>:<account-id>:catalog",
"arn:aws:glue:<region>:<account-id>:database/*",
"arn:aws:glue:<region>:<account-id>:table/*/*"
]
}
]
}

Restrict database/* and table/*/* to specific databases and tables to limit what Factor House can see.

If you use AWS Lake Formation to manage access to your tables, the role also needs lakeformation:GetDataAccess, and must be granted DESCRIBE on the databases and SELECT on the tables in Lake Formation.

Configure the catalog with the Glue Iceberg REST endpoint and SigV4 signing:

ICEBERG_CATALOG_NAMES=glue
ICEBERG_CATALOG_URI_GLUE=https://glue.<region>.amazonaws.com/iceberg
ICEBERG_CATALOG_IO_IMPL_GLUE=org.apache.iceberg.aws.s3.S3FileIO
ICEBERG_CATALOG_REST_SIGV4_ENABLED_GLUE=true
ICEBERG_CATALOG_REST_SIGNING_REGION_GLUE=<region>
ICEBERG_CATALOG_REST_SIGNING_NAME_GLUE=glue

Amazon S3 Tables​

For Amazon S3 Tables, table data lives in a table bucket and is read through the S3 Tables service, so no Amazon S3 bucket policy is required. Grant the following instead:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadS3Tables",
"Effect": "Allow",
"Action": [
"s3tables:ListNamespaces",
"s3tables:GetNamespace",
"s3tables:ListTables",
"s3tables:GetTable",
"s3tables:GetTableMetadataLocation",
"s3tables:GetTableData"
],
"Resource": [
"arn:aws:s3tables:<region>:<account-id>:bucket/<table-bucket>",
"arn:aws:s3tables:<region>:<account-id>:bucket/<table-bucket>/table/*"
]
}
]
}

If the table bucket is encrypted with a customer managed KMS key, also add the AWS KMS permissions for that key.

ICEBERG_CATALOG_NAMES=s3tables
ICEBERG_CATALOG_URI_S3TABLES=https://s3tables.<region>.amazonaws.com/iceberg
ICEBERG_CATALOG_WAREHOUSE_S3TABLES=arn:aws:s3tables:<region>:<account-id>:bucket/<table-bucket>
ICEBERG_CATALOG_REST_AUTH_TYPE_S3TABLES=sigv4
ICEBERG_CATALOG_REST_AUTH_SIGV4_DELEGATE_AUTH_TYPE_S3TABLES=none
ICEBERG_CATALOG_REST_SIGNING_NAME_S3TABLES=s3tables

Confluent Tableflow​

Confluent Tableflow can expose your tables in two ways, and the permissions Factor House needs depend on which you use.

Tableflow Iceberg REST catalog. Factor House authenticates to the catalog with an API key, and asks the catalog to sign its S3 requests (s3.remote-signing-enabled). Factor House does not need an IAM role for S3 in this case. See Confluent Tableflow for the configuration.

Tableflow with AWS Glue as the external catalog. Tableflow publishes the tables to your AWS Glue Data Catalog, and the data files live in the Amazon S3 bucket you configured for Tableflow. Factor House then connects to AWS Glue directly, and needs the permissions described for Amazon S3, AWS KMS if the bucket is encrypted with a KMS key, and AWS Glue. Configure the catalog as shown for AWS Glue.

Unity Catalog on AWS​

For Unity Catalog open source deployed on AWS, Factor House authenticates to the catalog with a token, and reads the table data directly from the Amazon S3 bucket that Unity Catalog manages.

Grant the role the Amazon S3 permissions on the bucket that holds your tables, and the AWS KMS permissions if the bucket is encrypted with a KMS key.

ICEBERG_CATALOG_NAMES=unity
ICEBERG_CATALOG_URI_UNITY=http://unity:8080/api/2.1/unity-catalog/iceberg
ICEBERG_CATALOG_TOKEN_UNITY=<token>
ICEBERG_CATALOG_TOKEN_REFRESH_ENABLED_UNITY=false
ICEBERG_CATALOG_IO_IMPL_UNITY=org.apache.iceberg.aws.s3.S3FileIO
ICEBERG_CATALOG_CLIENT_REGION_UNITY=<region>

Verify access​

If Data inspect fails to read a table, check the following:

  1. Confirm the identity that Factor House is using. From the Factor House pod, aws sts get-caller-identity shows the role or user, if the AWS CLI is available in your environment.
  2. Confirm that the identity can read the table's data. For example, aws s3 ls s3://<bucket>/<table-location-prefix>/ and aws s3 cp s3://<bucket>/<table-location-prefix>/metadata/<metadata-file> -.
  3. Check the Factor House logs for AccessDenied or AccessDeniedException errors. An error that names an AWS KMS key means the role is missing the AWS KMS permissions or the key policy does not allow it.
  4. Check that the region of the bucket matches the ICEBERG_CATALOG_S3_REGION_<NAME> or ICEBERG_CATALOG_CLIENT_REGION_<NAME> setting.