Policy variables in Resource and NotResource are not expanded
I maintainer di solito rispondono entro 2 giorni
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 517
- Fork
- 60
- Merge medio
- 2g 23h
- PR unite (30g)
- 25
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ExtendDB/extenddb
-
backend:mongodb bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 2 giorni
-
backend:cassandra bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
backend:cassandra bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni
-
[storage.cassandra] accepts unknown keys silentlyForse già presa @LeeroyHannigan l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ExtendDB/extenddb#540 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di ExtendDB/extenddb
Issue simili
-
component:benchmark
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
agentic-os-org/ANOLISA#9177 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oracle/rust-oracledb#61 ·
-
bug priority-medium to-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
Databricks tool-only response crashes in resolve_reasoning_and_content with KeyError: contentForse già presa @1divyanshdev l’ha presa oggi. Apertallm translation
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
BerriAI/litellm#48637 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno