mirror of
https://github.com/floci-io/floci.git
synced 2026-12-02 17:58:05 -05:00
Under enforcement a REST route no vendored model names runs unchecked, and Amazon MSK was among them: any caller could
create, describe, update or delete a cluster or a configuration. MSK's model routes are vendored
(regen_rest_routes.MODELS), so each request is checked as its operation's action, and kafka joins the generated tables
of request resources, passed roles and tags on create: a cluster, configuration, replicator, VPC connection or topic by
the ARN its path or body gives, CreateReplicator's and CreateChannel's service execution roles passed to kafka, and the
tags a create carries.
A JSON request carries a body member by its botocore locationName where one renames it, as MSK's do (Name is name on the
wire, ConfigurationInfo.Arn is configurationInfo.arn), and MSK's handler reads that name, so regen_iam_request_resources
names each body member path it reads as the request carries it (wire_named): a create is checked on the configuration or
cluster of the name MSK makes, and a body naming another under the botocore spelling too is checked on the one MSK
reads. GuardDuty's CreateFilter name and UpdatePublishingDestination destinationProperties, and API Gateway v2's portal
members, are read as their requests carry them too.
CreateClusterV2 names the configuration its brokers start from two structures deep (provisioned.configurationInfo.arn),
of a type the Service Reference lists for it, and the table read ARN members at most one structure deep, so
regen_iam_request_resources._nested_arns now reads too the members ending in Arn or Arns, holding a string, of a
top-level structure's structures, from botocore alone. 107 operations of other namespaces gain such a row; each ARN is
checked as one of the operation's types where it fits one and dropped where it does not, as one level deep already is,
so most (a KMS key, a role or a bucket naming no type of the action) change nothing. Those that do: Glue's CreateCatalog
and UpdateCatalog on their target catalog, EC2's RunInstances on the resource group a capacity reservation target names,
and Amazon Managed Service for Prometheus' CreateScraper on its workspace and EKS cluster and UpdateScraper on its
workspace. A create checks the tags it carries on what it makes alone, which the table marks by the type its name gives
past its verb; CreateClusterV2's subject, ClusterV2, names no type, so with_made now reads a subject named with a
version that names none without it, and CreateClusterV2 makes a cluster as CreateCluster does: a tagged create needs
kafka:TagResource on the new cluster, not on the configuration it names. A resource the request names by its ARN, or the
service's default a row stands for, exists already, so with_made never counts it as one the create makes, as no such row
of the table was: Glue's tagged CreateCatalog needs glue:TagResource on the catalog it makes, not on the Redshift
catalog it targets. That marks the created row of 95 creates across 38 namespaces; where the created row does not
resolve, the tag check still falls back to every resource the request names, so only a create naming an existing
resource of one of its types by ARN checks its tags on less.
MskStoredResourceArns answers the tags MSK holds on a cluster, read in place in the ARN's account, which an
aws:ResourceTag condition reads where the Service Reference gives the key (a cluster, not a configuration); a tag MSK
keeps with no value is read as an empty one, so it never fails the check.
AWS tags no MSK configuration: CreateConfiguration takes no tags, AWS::MSK::Configuration has none, the Service
Authorization Reference gives a configuration no aws:ResourceTag key and TagResource only assessment, cluster and
vpc-connection, and AWS's evaluation suite notes that TagResource rejects a configuration ARN ("Invalid input resource
arn"). Floci tagged them since #2366, so TagResource, UntagResource and ListTagsForResource now refuse a configuration's
ARN with that BadRequestException, as AWS does, and floci.services.msk.configuration-tags
(FLOCI_SERVICES_MSK_CONFIGURATION_TAGS, off by default) keeps the earlier tagging for state or scripts relying on it;
IAM checks those calls on '*', as no type of the action fits a configuration.
A namespace the table reads is served on its tag routes only at the ARN its path encodes, as Backup's and the others'
are, so MskControllerIntegrationTest's tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw.
The tables also take the RDS cluster group types (cluster-group, cluster-group-snapshot, cluster-group-auto-backup) AWS
added to the Service Reference on 2026-12-02, on its tagging and restore actions, which the online verify gate reads.
IamRestRouteEnforcementIntegrationTest checks that with no grant a configuration's read is refused, that a grant on one
configuration reads it and refuses another, that an aws:ResourceTag condition reads a cluster's tags, that a cluster
holding a tag with no value is refused rather than answered with a 500, and that CreateConfiguration is checked on the
configuration of the name MSK reads, a body naming another under the botocore spelling too included; that a deny on the
configuration CreateClusterV2 names refuses the create, and that a tagged one needs kafka:TagResource on its new cluster
alone; MskServiceTest and MskControllerIntegrationTest check that a configuration's tag calls are refused unless
configuration-tags is on; IamRequestResourceEnforcementIntegrationTest checks that a deny on the catalog Glue's
CreateCatalog targets refuses it and a deny on tagging that catalog does not refuse a tagged one;
test_regen_iam_request_resources checks the wire names a JSON body path is read by the path read two structures deep,
the type a create named with a version makes, and that no resource named by ARN is made.