AWS lake-formation: Update Lake Formation RLS filter expression limitations and INVALID policy handling
Summary
Rewrites the RLS policy filter expression limitations (subqueries/reference tables now allowed with limits, aggregate/window function rules, AttachmentColumns requirement, 2048-char limit before attribute substitution) and adds new sections explaining that policies referencing deleted tables become INVALID, are treated as FALSE, and how to re-activate them via UpdateRLSPolicy.
Security assessment
The change documents row-level security (authorization) behavior, notably the fail-closed semantics that an INVALID policy (e.g., after a referenced table is deleted) is treated as FALSE, plus the IAM/Lake Formation permissions (glue:GetTable, SELECT with grant option) needed to restore a reference table. This is security-relevant guidance for an access-control feature, but there is no evidence of a specific vulnerability, CVE, or incident being fixed.
Evidence
* INVALID policies are treated as FALSE.
Diff
diff --git a/lake-formation/latest/dg/rls-policies-limitations.md b/lake-formation/latest/dg/rls-policies-limitations.md index 501542c..d6b72e8 100644 --- a//lake-formation/latest/dg/rls-policies-limitations.md +++ b//lake-formation/latest/dg/rls-policies-limitations.md @@ -15 +15 @@ The following limitations apply to RLS policy filter expressions. - * Subqueries, joins, and references to external tables are not supported. All filtering logic must use columns within the target table. + * A filter expression can contain at most four subqueries, including derived tables, and at most 10 distinct reference tables. @@ -17 +17 @@ The following limitations apply to RLS policy filter expressions. - * User-defined functions (UDFs) are not supported. + * Reference tables must be in the policy creator's catalog. Each reference table must be a base table registered with Lake Formation. Views and resource links are not supported as reference tables. @@ -19 +19 @@ The following limitations apply to RLS policy filter expressions. - * Only static filter expressions are supported. Dynamic filters that reference user attributes (for example, `table.region = user.region`) are not supported. Create a separate policy for each distinct filter value. + * Aggregate functions other than `MAX` and `MIN` are not supported. Window functions are supported only in a derived table's select list. @@ -21 +21 @@ The following limitations apply to RLS policy filter expressions. - * Column-to-column comparisons are not supported (for example, `column_a = column_b`). Compare columns to constant values instead. + * Every attachment table column referenced in the filter expression must be declared in `AttachmentColumns`. @@ -23,7 +23 @@ The following limitations apply to RLS policy filter expressions. - * Aggregate functions (such as `SUM`, `COUNT`, `AVG`) and window functions are not supported. - - * Every column referenced in the filter expression must be declared in `AttachmentColumns`. - - * The total length of a filter expression must be less than 2048 characters. - - * `IS [NOT] NULL` on partition columns is not supported. + * The total length of a filter expression, including comments, can be at most 2048 characters before dynamic attribute substitution. @@ -41,0 +36,32 @@ Column names in RLS filter expressions are late binding: they are resolved again +###### Invalid RLS policies + + * Tables included in RLS policy filter expressions are referenced by ID. + + * If a table is deleted, the policy is considered INVALID. + + * INVALID policies are treated as FALSE. + + + + +###### Re-activating an INVALID RLS policy + +`UpdateRLSPolicy` fails while a table that the filter expression references doesn't exist. To re-activate the policy, do one of the following: + + * **Restore the referenced table.** + + 1. Re-create the deleted table with the same database and table name. + + 2. Make sure the re-created table meets the reference table requirements: it's registered with Lake Formation, your IAM permissions allow `glue:GetTable` on it, and you have Lake Formation `SELECT` with grant option on it. + + 3. Call `UpdateRLSPolicy` and pass in the same filter expression that you used when you created the policy. + + * **Remove the reference.** Call `UpdateRLSPolicy` with a filter expression that doesn't reference the deleted table. + + + + +After `UpdateRLSPolicy` succeeds, the policy's `Status` returns to `VALID` and it filters rows again. + +For more information, see [Filter expression syntax for RLS policies](./rls-policies-sql-support.html). +