fix(s3control): take TagResource and UntagResource tag condition keys from generated data (#6677)

The Service Authorization Reference lists aws:RequestTag/${TagKey} and
aws:TagKeys as condition keys for s3:TagResource, and aws:TagKeys for
s3:UntagResource. botocore's s3control model says where the request
carries them: TagResource's Tags list in the body, UntagResource's
TagKeys in the tagKeys query parameters.

With IAM enforcement on, Floci checked both S3 Control actions with no
request tag keys. A policy that allows TagResource only for certain tag
values, or UntagResource only for certain keys, matched no request, so
a request it allows was denied, and a ForAllValues condition on
aws:TagKeys allowed UntagResource whatever keys it named.

tools/aws/regen_s3control_tag_condition_keys.py now generates
s3control-tag-condition-keys.json from the two sources, as the DynamoDB
condition key table is generated: every s3 action the reference gives
either key, and every S3 Control operation's request members that feed
them, found as the tag-on-create table finds tag members.
IamConditionContextResolver reads it for a request on an S3 Control
route. The make targets check the members offline against the pinned
botocore in CI and the actions online against AWS in the IAM data drift
workflow. S3's own bucket and object tag keys stay as written, since
they were measured against AWS and do not all match the reference.
This commit is contained in:
galsuchetzky-act authored and GitHub committed 2026-10-28 10:14:26 -04:00
1 parent 8ad890148a
commit f926968167
11 files changed
+853 -9

No files matched your search

+7 -3
View File
@@ -1,12 +1,13 @@
name: IAM Data Drift
# Checks the nine vendored files that come from AWS's live service reference rather than from a
# Checks the ten vendored files that come from AWS's live service reference rather than from a
# pinned dependency: the IAM service namespace list, the map of which resource each IAM action is
# authorized against, the map of operations AWS authorizes as an action of another name, the
# table of the operations that pass a role and the services they pass it to, the table of the
# operations that pass a Lambda network connector, the table of the
# tagging actions operations that tag what they create need, and the table of the resources each
# operation's request names, the DynamoDB condition key table, and the IAM condition key table. That
# tagging actions operations that tag what they create need, the table of the resources each
# operation's request names, the DynamoDB condition key table, the IAM condition key table, and
# the S3 Control tag condition key table. That
# needs the live service reference index, so unlike every other check here it can
# fail without anything in the repository having changed: an AWS outage, or a namespace AWS has
# retired. It therefore runs on its own, never as part of a job that ordinary changes trigger.
@@ -62,6 +63,9 @@ on:
- 'src/main/resources/aws/iam-condition-keys.json'
- 'tools/aws/regen_iam_condition_keys.py'
- 'tools/aws/test_regen_iam_condition_keys.py'
- 'src/main/resources/aws/s3control-tag-condition-keys.json'
- 'tools/aws/regen_s3control_tag_condition_keys.py'
- 'tools/aws/test_regen_s3control_tag_condition_keys.py'
- 'tools/aws/regen_partitions.py'
- 'tools/aws/regen_query_services.py'
- '.github/workflows/iam-data-drift.yml'
+2
View File
@@ -105,6 +105,8 @@ jobs:
- name: Check IAM condition key request members
run: make iam-condition-keys-check
- name: Check S3 Control tag condition request members
run: make s3control-tag-condition-keys-check
- name: Check partitions.json against a fresh generation
run: make aws-data-check