Policy variables in Resource and NotResource are not expanded
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 517
- Fork
- 60
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ExtendDB/extenddb
-
backend:mongodb bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 2 ngày
-
backend:cassandra bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
backend:cassandra bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[storage.cassandra] accepts unknown keys silentlyCó thể đã có người làm @LeeroyHannigan đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ExtendDB/extenddb#540 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của ExtendDB/extenddb
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
status:untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
midnightntwrk/midnight-zk#592 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
QuartoHub: have the Document name before the filename in the browser tabCó thể đã có người làm @cscheid đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
quarto-dev/q2#930 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
muse P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
HerringtonDarkholme/hd-lang#923 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày