Files
floci/tools/aws
Priamo Germosen 46252ae13e fix(iam): read an S3 bucket's tags once ABAC is enabled, and give its objects them (#9920)
The request-resources table gives aws:ResourceTag keys to S3's bucket and object types, but S3 gave IAM no tags, so an
aws:ResourceTag condition on an S3 action never matched. The S3 User Guide says "you can control access to S3 resources
based on the bucket's tags", that S3 "evaluates this condition key only after you enable ABAC on your bucket", and its
example bucket policy conditions s3:GetObject on a bucket's objects on the bucket's tag.

tools/aws/fetch_s3_tag_inheritance.py vendors those sentences and the example's object resource and condition key into
tools/aws/sources/s3-tag-inheritance.json, refusing a reworded page. TAG_INHERITANCE_SOURCES grants it for s3, beside
API Gateway, and tag_parents gives the object type, whose path continues the bucket's past a '/', the bucket as its tag
parent.

S3StoredResourceArns reads S3Service.storedTags: the tags of the general purpose bucket the ARN names, only while its
ABAC status is Enabled, read in place with no legacy entry moved (the caller's bucket, or with the global bucket
namespace the one of that name another account owns, one get per owning account), copied under the lock its tag writes
hold, and none for an object or no bucket. Bucket names are one namespace here, a request signed for any partition
reaching the same bucket, so the ARN's partition is not matched against the bucket's. IamConditionContextResolver gives
an object its bucket's tags from tagParents, and no longer gives s3:GetBucketTagging, s3:DeleteBucket and
DeleteBucketTagging the bucket's tags itself, ABAC or not. S3's own bucket policy check reads the same tags, so a bucket
policy conditioned on aws:ResourceTag grants a caller from another account what it says. s3:BucketTag/<key> is not read:
the generator's resource-tag key reading takes ResourceTag keys alone.

The Service Reference and the IAM identifiers page changed upstream, and the IAM data drift gate this change runs reads
both: tools/aws/sources/iam-identifiers.json and the table are synced, adding IAM's workload identity provider and
template types and their operations, Bedrock's and Redshift Serverless's new types, and new Athena, Budgets and STS
operations. The generator took a type of no variables of its own for the account's one, which every request names, even
where its format lies within another type's the action acts on: Redshift Serverless's expressConfiguration,
workgroup/express/express-default, is a workgroup of a fixed name, and GetCredentials was checked on it beside the
workgroup its workgroupName names. Such a type is now named only by a request naming it, which leaves GetCredentials
checked on the named workgroup alone.

S3BucketTagIamEnforcementIntegrationTest checks that a caller allowed s3:GetObject, s3:ListBucket and the bucket's
tagging actions only on resources tagged team=blue reads and lists a blue bucket with ABAC enabled and reads its tags,
and is refused a red one and a blue one whose ABAC is off, its tagging actions included; and that a bucket policy
granting another account s3:GetObject on blue buckets lets that account read the blue one and not the red.
S3BucketStoredTagsTest checks the read and its refusals; IamConditionContextResolverTest that an object has its bucket's
tags and that a bucket action's request context leaves the bucket's tags to its stored tags;
test_fetch_s3_tag_inheritance.py the fetcher; test_regen_iam_request_resources.py the object's parent and the fixed-name
type; IamRequestResourceEnforcementIntegrationTest that a caller allowed GetCredentials on one workgroup gets its
credentials and is refused another's.
2026-12-01 15:31:15 -04:00
..