mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
CloudFront's REST routes were not in the vendored route table and its namespace's resources were not read, so under IAM enforcement no CloudFront request was checked: a caller with no permissions could create, change and delete distributions, cache policies, functions and the rest. Its botocore model is now in regen_rest_routes.MODELS and its namespace in regen_iam_request_resources.NAMESPACES, so each request is checked as the action of the operation its route names, on the resources the request names. regen_iam_request_resources read requests of the JSON, Query, CBOR and REST-JSON protocols only, so a REST-XML request named no resource. It now reads a REST-XML request's path labels and query parameters, which RequestResources reads whatever the protocol, and not its body, which is not one it reads. Creation tags stay unread: CloudFront wraps them in a Tags structure holding Items, which regen_iam_tag_on_create does not read yet. Three CloudFront operation shapes were still checked on `*` or as no IAM action: - `stem` drops a trailing `config`, so a bare `Id` names the resource whose config an operation reads (GetDistributionConfig and the other ...Config reads, and GetFieldLevelEncryption, whose type is field-level-encryption-config). - A member whose pattern takes only an ARN counts as an ARN when it is named `Resource`, as well as when it is an identifier, so the tagging calls are checked on the resource their ?Resource names. Members naming another resource (a role, a monitor, a target) still do not. - An operation whose own name is no action, and which several actions authorize, is the one its name starts with as a word: CreateDistributionWithTags is checked as cloudfront:CreateDistribution. The same rule maps Keyspaces' CreateKeyspace, CreateTable, CreateType and RestoreTable to cassandra:Create and cassandra:Restore, and QuickSight's CreateTopicV2 and UpdateTopicV2 to quicksight:CreateTopic and quicksight:UpdateTopic. A plural is no such word: S3's DeleteObjects is checked for each object it deletes.