Policy variables in Resource and NotResource are not expanded
Los mantenedores suelen responder en 2 días
Evaluación
Este issue todavía no se ha evaluado.
Descripción
A policy variable in a statement's Resource or NotResource is never expanded. resource_matches in crates/auth/src/policy/evaluator.rs passes each pattern to arn_match as written, so arn:aws:dynamodb:us-east-1:123456789012:table/${aws:PrincipalTag/team} is compared as literal text and matches no table. expand_policy_variables in condition.rs expands variables in condition values only.
On every operation, a Deny written on a variable resource denies nothing, and an Allow written that way grants nothing. With Allow dynamodb:* on * and Deny dynamodb:GetItem on table/${aws:PrincipalTag/team}, a caller tagged team=blue can read table blue.
IAM's rule, measured with aws iam simulate-custom-policy on 2026-10-24 (action dynamodb:GetItem, Allow dynamodb:* on * beside the statement under test):
| Statement | Context | Resource | IAM |
|---|---|---|---|
Deny table/${aws:PrincipalTag/team} |
team=blue |
table/blue |
explicitDeny |
| same | team=blue |
table/red |
allowed |
| same | no team tag |
table/blue |
allowed |
Deny table/${aws:PrincipalTag/team}* |
team=blue |
table/blue-x |
explicitDeny |
Allow only table/${aws:username} |
aws:username=alice |
table/alice |
allowed |
| same | aws:username=alice |
table/bob |
implicitDeny |
Deny table/${aws:PrincipalTag/team}, Version 2008-10-17 |
team=blue |
table/blue |
allowed |
same, no Version |
team=blue |
table/blue |
allowed |
Deny with NotResource table/${aws:PrincipalTag/team} |
team=blue |
table/blue |
allowed |
| same | team=blue |
table/red |
explicitDeny |
Deny table/${aws:PrincipalTag/team, 'none'} |
no team tag |
table/none |
explicitDeny |
IAM expands variables in Resource and NotResource for a 2012-10-17 document and leaves them literal for 2008-10-17 or no Version; a wildcard after a variable still matches; a variable whose key the request does not carry makes the pattern match nothing; and the ${key, 'default'} form expands to its default when the key is absent. expand_policy_variables does not read the default form either, so a condition value written that way has the same gap.
Fix: expand variables in Resource and NotResource patterns for 2012-10-17 documents before arn_match, with an unresolved variable making that pattern match nothing, and read the ${key, 'default'} form in both places. Tests for each row above.
- Lenguaje dominante
- Rust
- Estrellas
- 517
- Forks
- 60
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 25
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ExtendDB/extenddb
-
backend:mongodb bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 2 días
-
backend:cassandra bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
backend:cassandra bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
[storage.cassandra] accepts unknown keys silentlyPosiblemente ocupada @LeeroyHannigan la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ExtendDB/extenddb#540 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de ExtendDB/extenddb
Issues similares
-
documentation enhancement SIEM
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ADORSYS-GIS/wazuh-agent-status#265 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
manuscript-lang/manuscript#1629 ·
Los mantenedores suelen responder en 1 día
-
autofixer: follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
tursodatabase/turso#10885 ·
Los mantenedores suelen responder en 1 día
-
🐞 bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
nannou-org/gantz#475 ·
Los mantenedores suelen responder en 1 día