Commit Graph
364 Commits
Author SHA1 Message Date
thejrose1984 3a37423474 fix(apigateway): send WebSocket AWS integrations with an sqs:path URI to SQS (#9860) 2026-12-02 21:59:55 -04:00
Priamo Germosen 7efb8cef00 fix(iam): check Amazon MSK by its generated routes, resources and passed roles (#9973)
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.
2026-12-02 16:20:07 -04:00
Priamo Germosen 253e988b63 feat(cloudwatch): serve PromQL instant queries (#9990)
Part 2 of #7030. QueryMetrics (/api/v1/query) evaluates a PromQL
expression at one time over the stored OTLP metrics: a Prometheus 3.0
parser and a float engine with selectors, range selectors, subqueries,
the offset and @ modifiers, operators with vector matching, aggregations
and every non-experimental function but those of native histograms.

A result holds at most 500 series, truncated with the user guide's
warning, and every selector must name a metric. The guide's scan limits
and execution timeout bound the read, now shared with discovery, and a
query holds at most Prometheus's default 50,000,000 samples in memory.
2026-12-02 11:54:35 -04:00
Priamo Germosen e0254217be feat(cloudwatch): serve PromQL series and label discovery (#9984)
Part 1 of #7030. GetSeries (/api/v1/series) and GetLabels (/api/v1/labels,
/api/v1/label/<name>/values) answer over the metrics the OTLP endpoint
ingests, with the labels, selector syntax, limits and Prometheus envelope
the CloudWatch user guide's PromQL pages give. Regular expressions are
RE2's, as Prometheus's are.

The guide's "IAM permissions for PromQL" table is vendored by a new fetcher
and read by the authorized-actions generator, so the operations are checked
as cloudwatch:ListMetrics, and QueryMetrics carries cloudwatch:ListMetrics
as a companion every request needs, which the enforcement filter checks.
@IamOperation can name a method's operation.

The OTLP 40 KB metadata limit counts the resource and scope schema URLs,
which PromQL reads as labels of the series.
2026-12-02 08:40:21 -04:00
Priamo Germosen 03e1a53d2e fix(iam): read the passed roles and creation tags of REST services Floci already routes (#9962)
regen_iam_passed_roles.py left Access Analyzer, Bedrock, CloudFront, FIS, GuardDuty and Macie out as "REST routes no
rule maps yet", and regen_iam_tag_on_create.py Inspector2 the same, but the request-resources table has read their
vendored REST routes since Floci began routing their requests by operation, so the reason no longer held: a request
passing a role to one of them needed no iam:PassRole, and an Inspector2 create's tags needed no inspector2:TagResource.

They move into each generator's NAMESPACES, and the generic rules read them with no correction: 23 role-passing
operations (Bedrock's model customization, evaluation, import and invocation jobs, agents, flows and knowledge bases;
FIS's experiment templates; GuardDuty's malware protection plans and scans; CloudFront's realtime log configs, from the
RoleARN of each endpoint in the XML body; Access Analyzer's policy generation and Macie's reveal configuration) and five
Inspector2 creates. Each operation is read whether or not Floci serves it, so one Floci adds is checked from the start.
No entry moves.

Floci's CloudFront parser took the first EndPoints anywhere in a realtime log config's body, and every child of it as an
endpoint, while the role is read from the request's own EndPoints, at the <member> botocore serializes each as, so an
<EndPoint>, or an EndPoints nested in another element ahead of the request's own, passed a role unchecked; the parser
now reads the <member> elements of the request's own EndPoints alone, as AWS's deserializer reads no other. IAM reads
the role of every KinesisStreamConfig's every RoleARN and none from a body where one holds elements, so an endpoint
holding more than one KinesisStreamConfig, or a config more than one RoleARN or StreamARN, or an ARN holding elements,
is refused with InvalidArgument rather than saved from one the check did not read. The request-resources table, which
leaves a passed role's member out of the resources a request names, is regenerated with the new passed roles: Bedrock's
evaluation, customization and invocation jobs, agents, flows and knowledge bases and FIS's experiment templates no
longer take their role's ARN as one of their resources.

OpenSearch stays out: AssociatePackage's role is AssociationConfiguration.KeyStoreAccessOption.KeyAccessRoleArn of the
opensearch client's request, while the Service Reference lists only the es client for it, so the generic rule finds no
role member; its reason now says so.

The Service Reference now also lists operations pinned botocore 1.44.14 does not model yet (SageMaker's model monitor
configs, IAM's workload identity creates); both tables are synced with them unread, as the generators record such an
operation.

IamPassRoleEnforcementIntegrationTest checks that creating and updating an FIS experiment template, a GuardDuty malware
protection plan and a CloudFront realtime log config each needs iam:PassRole on its role for the service it is passed
to, and that a realtime log endpoint under another element than <member>, or in an EndPoints nested ahead of the
request's own, saves no role, that a RoleARN holding an element, or doubled ahead of one, is refused, and that a body in
another charset than the UTF-8 both the check and the handler read saves no role.
2026-12-02 02:24:34 -04:00
Priamo Germosen 2e1f9d2ffc feat(iam): build access denied messages from the decision record (#9964)
The last step of #7887. A request a policy refused was answered with
"User is not authorized to perform: <action>" for every service but S3,
and the services that did name the policy type (S3, Athena's statements,
Lambda's network connectors) asked a second path, firstRefusal, which
re-ran the evaluation one policy type at a time.

The evaluator's DecisionRecord now carries the refusal an access denied
message names, worked out in the same decide() pass: the first policy
type that refuses, by its explicit deny or the allow it lacks, in the
order AWS was recorded naming them for lambda:PassNetworkConnector
(#6699): organization levels, identity policies, permissions boundary,
session policy. A resource policy's explicit deny comes first and its
missing allow across accounts last, as S3 names them (#9281). The SCP walk
keeps the first level that refuses.

AccessDeniedMessages.reason builds the phrase from that refusal, naming
the managed policy that holds the denying statement, or the boundary, by
its ARN. firstRefusal is gone. The enforcement filter explains each
decision instead of only evaluating it, and every policy refusal now
answers in the IAM User Guide's format, "User: <caller> is not
authorized to perform: <action> on resource: <resource> because no
identity-based policy allows the <action> action", in each protocol's
envelope. Refusals no policy made keep the old sentence.

Closes #7887
2026-12-01 23:49:10 -04:00
Priamo Germosen 6b0f628760 fix(iam): read the tags of IAM's resource types beyond roles and users (#9946)
The request-resources table gives aws:ResourceTag keys to eight IAM resource types and Floci stores the tags of all
eight, but IAM's tag reader answered for roles and users alone, and regen_iam_condition_keys.py listed every resource
tag pair no RoleName or UserName names as notRead ("no member names a stored role or user whose resource tags can be
read"), which IamConditionKeys strips from the request's context. A condition on aws:ResourceTag for a customer managed
policy, an instance profile, an OpenID Connect or SAML provider, a server certificate or a virtual MFA device was
dropped.

The condition-key generator now puts such a pair in a new fromResourceTags section when iam-request-resources.json
resolves the action's request to a resource of one of the pair's types that it gives the key's prefix (resourceTagKeys):
the condition resolver reads it through its generic resource tag reading, from what IAM holds on the resource the
request names. A create the generated tag-on-create table lists (iam-tag-on-create.json) acts on a resource that does
not exist yet and stays notRead, with the reason a role's or a user's create has. 59 pairs move; none keeps the old
reason. --check re-derives the section from the two tables, and the IAM data drift gate checks the condition keys when
either changes.

IamService.heldTags reads a policy's, instance profile's, OpenID Connect provider's, server certificate's or virtual MFA
device's tags, and SAMLProviderService.heldTags a SAML provider's, each read in place in the ARN's account, a
pre-multi-account entry of the default account included; an instance profile or a server certificate, stored by its
name, only when its ARN, path included, is the one named. IamStoredResourceArns answers them.

The Service Reference now lists IAM's workload identity actions, which pinned botocore 1.44.14 does not model yet, and
the generator stopped on their tagging actions' request tags. Like classify's "no SDK operation of this name",
request_tag_context now skips an action botocore does not model, which no request Floci receives names; the table is
synced with their pairs in notRead.

IamResourceScopedPolicyEnforcementIntegrationTest checks that a caller allowed the read of each of five types only on
resources tagged team=blue reads the blue one and is refused the red one, and
ServerCertificateIamEnforcementIntegrationTest the same of certificates; IamStoredResourceArnsTest the reads and an
instance profile named by another path; test_regen_iam_condition_keys.py the new routing, the create kept unread and the
skipped tagging action.
2026-12-01 19:33:08 -04:00
Priamo Germosen fe03f90e5e fix(iam): read the bucket tag keys S3, S3 Tables and S3 Vectors name after a type (#9937)
The Service Reference gives S3's bucket and object s3:BucketTag/${TagKey}, which "Filters access by the tags associated
with the bucket", S3 Tables' table bucket and table s3tables:TableBucketTag/${TagKey}, S3 Vectors' vector bucket and
index s3vectors:VectorBucketTag/${TagKey}, and S3's access point s3:AccessPointTag/${TagKey}. The generator read
resource-tag keys only as <namespace>:ResourceTag/ and RDS's <namespace>:<type>-tag/, so none of them was read and a
condition on one never matched.

A key named after its own type, <namespace>:<Type>Tag/ (condition key names are not case-sensitive), now joins that
type's resourceTagKeys as RDS's do: the bucket's s3:BucketTag/. One named after another type whose resource path the
type's continues goes into a new containerTagKeys section, with that type's format in the type's variables
(parent_format, as tagParents builds a parent's): an S3 object's s3:BucketTag/ reads its bucket's tags, an S3 Tables
table's s3tables:TableBucketTag/ its table bucket's and an S3 Vectors index's s3vectors:VectorBucketTag/ its vector
bucket's, while their aws:ResourceTag/ keeps the table's and the index's own. The S3 User Guide says so of each: the S3
Tables key "acts on the tags applied to the table bucket that contains that table", the S3 Vectors key "references tags
associated with the vector bucket containing that index, while the aws:ResourceTag/tag-key will reference the tags of
the index itself", and s3:BucketTag is "applicable only after ABAC is enabled on your bucket", which S3's reader already
holds to. s3:BucketTag on an access point's object, whose ARN names no bucket, is not read. --check validates each entry
against the formats, --verify against the reference; the table changes in those entries alone.

IamConditionContextResolver.resourceTags adds the container keys, read from the stored tags of the container's ARN, and
S3's bucket policy checks read them with the bucket's ABAC tags: a request's own and a copy's of its source (CopyObject,
UploadPartCopy), which read no bucket tags before, aws:ResourceTag included. Floci does not model S3 access points, so
their s3:AccessPointTag and aws:ResourceTag read nothing, as before.

The Service Reference now gives athena:GetQueryResultStream the workgroup type, which the IAM data drift gate this
change runs reads: the table is synced, and no request member names the workgroup. docs/services/iam.md no longer lists
s3:GetBucketTagging, s3:DeleteBucket and DeleteBucketTagging as reading the bucket's tags apart, which #9920 removed.

S3BucketTagIamEnforcementIntegrationTest runs each of its checks with aws:ResourceTag/team and s3:BucketTag/team, a
cross-account copy among them; S3TablesIamIntegrationTest and S3VectorsIamIntegrationTest check that an allow on the
bucket's team reads that bucket and a table or index of it tagged otherwise, and refuses another bucket and its table or
index tagged with the team; IamConditionContextResolverTest that a table's two keys hold its bucket's and its own tags;
RequestResourceMembersTest the section's parse, lookup and refusals; test_regen_iam_request_resources.py the reading,
the vendored entries and the validation.
2026-12-01 18:11:34 -04:00
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
Priamo Germosen 8b29f0fe10 fix(iam): read the stored tags of Rekognition collections and Macie members (#9908)
The request-resources table gives resource-tag keys to Rekognition's collection type and Macie's member type, and both
services keep the tags those resources are created with, but neither gave IAM them, so an aws:ResourceTag condition on
one of their actions never matched.

RekognitionStoredResourceArns now reads RekognitionCollectionService.storedTags: the tags of the caller's collection the
ARN names, in its Region, read in place with no legacy entry moved. MacieStoredResourceArns, new, reads
MacieService.storedTags: the tags of the member the caller's administrator account holds that the ARN names. Each read
answers only an ARN equal to the stored resource's own, so another partition's ARN of the same Region and name has none.
Floci serves no Macie operation on an existing member yet (only CreateMember and ListMembers), so Macie's reader is
ready for GetMember, DeleteMember and the tag operations rather than read today.

StoredResourceTagIamIntegrationTest checks that a caller allowed rekognition:DescribeCollection only on collections
tagged team=blue describes the blue one and is refused the red one; RekognitionCollectionServiceTest and
MacieServiceTest check each read, its copy, and the ARNs that name nothing (another account, partition, Region or kind,
or a resource no longer held). Each fails without its reader.
2026-12-01 11:06:50 -04:00
Priamo Germosen 1a52438dbc fix(iam): read API Gateway's stored tags and the tags its V1 resources inherit (#9903)
The request-resources table gives resource-tag keys to 66 API Gateway types, but API Gateway gave IAM no tags, so an
aws:ResourceTag condition on an apigateway action never matched. Its Developer Guide also says that in the V1 API "child
resources inherit the tags that are set on parent resources", naming RestApi, DomainName and UsagePlan as the parents,
and that a stage's own tag "takes precedence" over the one it inherits.

ApiGatewayStoredResourceArns reads ApiGatewayService.storedTags and ApiGatewayV2Service.storedTags: the tags of the
caller's REST API, stage, custom domain name, API key, usage plan or VPC link, and of an HTTP or WebSocket API and its
stages, by the first segment of the ARN's resource path, in its Region, read in place from each store with
readInAccount, no legacy entry moved. The REST API's tag writes and the V2 service's now hold the service's monitor and
replace the tag map instead of changing it in place, as the custom domain's, VPC link's, API key's and usage plan's
already did, so a read copies a map no writer changes.

tools/aws/fetch_apigateway_tag_inheritance.py vendors the guide's sentences into
tools/aws/sources/apigateway-tag-inheritance.json, refusing a reworded page. The generator gives each type whose
resource path continues a parent the page names past a '/' that parent, with the parent's format in the type's variable
names (tagParents), from the formats alone: 27 types under RestApi, the 5 under DomainName the guide lists and 4 under
UsagePlan; the V2 API's are under none. RequestResourceMembers reads it, and IamConditionContextResolver lays an ARN's
own tags over its parent's, the parent's ARN filled from the ARN.

The regeneration also takes the Service Reference's new ec2:FailoverVolumes.

test_fetch_apigateway_tag_inheritance.py checks the fetcher's copy and refusals; test_regen_iam_request_resources.py the
parent formats, the parents given and the check of them; RequestResourceMembersTest the read and refusals;
IamConditionContextResolverTest that a method has its REST API's tags under its own and a V2 route none;
ApiGatewayStoredResourceArnsTest each kind's read, a custom domain name and a VPC link of either API, a legacy usage
plan read in place, and its copy; ApiGatewayPathArnEnforcementIntegrationTest that a caller allowed apigateway:GET on
team=blue reads the blue REST API, its resources and a blue HTTP API, and is refused the red REST API, its resources and
the HTTP API's routes.
2026-12-01 09:29:43 -04:00
Priamo Germosen 368488cd5b fix(iam): read the stored tags of SageMaker and BCM Data Exports resources (#9872)
The request-resources table gives resource-tag keys to SageMaker's model, endpoint configuration, endpoint and
training job types and to BCM Data Exports' export type, but neither namespace gave IAM the tags it stores, so an
aws:ResourceTag condition on one of their actions never matched.

SageMakerStoredResourceArns reads SageMakerService.storedTags: the tags of the caller's model, endpoint configuration,
endpoint or training job the ARN names, in its Region, by the resource part the ARN starts with, read in place and
copied under the monitor AddTags and DeleteTags change them under. BcmDataExportsStoredResourceArns reads
BcmDataExportsService.storedTags: the ResourceTags an export's create gave it, read in place under its ARN.

StoredResourceTagIamIntegrationTest checks a caller allowed sagemaker:DescribeModel and bcm-data-exports:GetExport
only on resources tagged team=blue reaches the blue one and is refused the red one; both fail without the readers.
SageMakerServiceTest checks the read, its copy, the ARNs that name nothing, and that a model, an endpoint
configuration, an endpoint and a training job of one name answer their own tags by their own ARNs.
2026-11-30 21:07:38 -04:00
XuJian fbe6adbb67 feat(iam): fix the default account's outbound federation issuer to a configured UUID (#9853)
FLOCI_SERVICES_IAM_OUTBOUND_FEDERATION_ISSUER_ID fixes the default
account's outbound web identity federation issuer to
https://<uuid>.tokens.sts.global.<suffix>, so a stack can name that URL,
and the key set route the same UUID keys, before the feature is enabled.
Unset, the issuer is minted as before. Other accounts always mint their
own, since an issuer resolves back to its account by that UUID alone.

The value must be the lowercase 8-4-4-4-12 form the discovery routes
match, or Floci refuses to start. An issuer already minted outlives a
disable, so the setting takes hold only on a volume that has not enabled
the feature yet. When a stored issuer overrides it, at the start or on a
re-enable, that is logged at debug with both values.
2026-11-30 20:42:02 -04:00
Priamo Germosen 4d0287e6dc fix(iam): check DMS requests on the resources they name, from the DMS User Guide's ARN syntax (#9857)
The Service Reference ends every DMS resource type's ARN format in a wildcard where the resource goes
(arn:${Partition}:dms:${Region}:${Account}:endpoint:*), which the table reader matches as written, so no DMS request
was checked on the resource it names: one naming an endpoint, an instance or a task by its ARN stayed on *, and no
aws:ResourceTag condition on a DMS resource could match.

The DMS User Guide gives what goes there: "An ARN for an AWS DMS resource uses the following syntax:
arn:aws:dms:region:account number:resourcetype:resourcename". tools/aws/fetch_dms_arn_formats.py vendors that page
(the syntax, the sentence saying what its resource name is, and its table of formats) into
tools/aws/sources/dms-arn-formats.json, pairs the syntax with each Service Reference DMS format ending in a wildcard
by its resource type, and writes that format with the page's placeholder where the wildcard was
(arn:${Partition}:dms:${Region}:${Account}:endpoint:${resourcename}). A reworded page, or a table row whose type no
such format has, is refused. regen_iam_request_resources.py takes those formats as they stand (ARN_FORMAT_SOURCES,
granted for dms alone), each checked to differ from the Service Reference's only where its wildcard was, and verifies
the source against the live pages beside the other vendored sources.

The generator's existing machinery then names a DMS resource by the ARN a request passes, or fills the format from
the identifier a request names it by. DmsStoredResourceArns finds such an identifier, or an ARN DMS holds, as DMS
stores it (an endpoint's, an instance's or a task's ARN ends in the id DMS minted, not in its identifier; one stored before keys carried the account is the default account's and found too), and reads
the tags of an endpoint, instance, task or subnet group for aws:ResourceTag, both in place. A subnet group's ARN
ends in its identifier as DMS stores it, in lower case ("This value is stored as a lowercase string"), so the reader
resolves an ARN naming one in another case to that one (resolveStoredArn). A request leaving out
an optional ARN names the resource DMS uses for one naming none, of which it has none. A replication instance whose create
names no subnet group goes into the account's default replication subnet group, so the reader answers that group as
the one such a create acts on (findImplicitDefault), and the create is checked on subgrp:default.

The fetcher also copies what AWS answers each DMS create with, from AWS's recorded exchanges with DMS (the AWS
Emulator evaluation suite's wire tests, "a recorded exchange with AWS") and botocore's examples: whether the ARN of
what the create makes ends in a member of its request (a subnet group's in its ReplicationSubnetGroupIdentifier, an
event subscription's in its SubscriptionName) or in a value the request does not give (an endpoint's, an instance's,
a task's, a certificate's: botocore's example answers EndpointIdentifier "test-endpoint-1" with
endpoint:RAAR3R22XSH46S3PWLC3NJAWKM). The generator's rule for a variable a create's response answers, which stays open
whatever member a rule would fill it from, reads that too (with_recorded_mints), both for what a create is checked
on and for what its tags are checked on: CreateEndpoint, CreateReplicationInstance and ImportCertificate are checked on
what they make with its id open (rep:*), the tags of CreateReplicationTask, CreateDataProvider and
CreateInstanceProfile on what they make likewise, and no other row of the table changes. The creates of data
migrations, migration projects, replication configs and assessment runs have no recorded answer and keep their
fills. A modify renaming an instance is still checked on rep:<new name> beside its own ARN, nothing
being recorded for it.

The regeneration also takes the Service Reference's new SageMaker candidate, leaderboard and model monitor config
actions.
2026-11-30 19:32:58 -04:00
XuJian 5eebe2f708 fix(iam): check the ses v2 legacy GET list routes as their actions (#9826)
The sesv2 model moved ListEmailIdentities and ListConfigurationSets to the
POST /v2/email/list-* routes between botocore 1.43.104 and 1.43.105. SDKs built
before that move still send GET /v2/email/identities and
GET /v2/email/configuration-sets, which matched no route of the model, so those
requests were allowed whatever the caller's SES grants were, an explicit Deny
included.

The REST route generator now reads those routes from botocore 1.43.104's own
model: LEGACY names the release, and build_legacy vendors, for an operation both
models hold on another route, the older route as an alternative checked as the
operation's action. A regeneration carries them over offline, --fetch-legacy
(make legacy-routes-sync) reads them again, and --verify compares the vendored
block against the release. carried_legacy checks the vendored block.

Closes #9818
2026-11-30 13:38:40 -04:00
Priamo Germosen 1b5c862c2f fix(iam): read the stored tags of ElastiCache resources (#9839)
The request-resources table gives resource-tag keys to ElastiCache's user, user group, replication group, cluster,
snapshot, subnet group, parameter group and serverless cache types, but ElastiCache gave IAM none of the tags it
stores, so an aws:ResourceTag condition on one of its actions never matched: an Allow scoped to a tag never applied
and a Deny scoped to one never refused.

ElastiCacheStoredResourceArns reads ElastiCacheService.storedTags, and ElastiCacheServerlessService.storedTags for a
serverless cache. A resource stored with its ARN is matched on its kind and id, as the handlers find it: those that change or delete
a user, user group, replication group, cluster or snapshot find it by its id whatever Region a request is signed
for, so IAM checks the one they act on; a subnet group,
stored by name alone, only in the request's Region, where ListTagsForResource reads it; a parameter group in the
ARN's Region. A user group's id and a serverless cache's name are read in lower case, as the handlers find them,
so a request spelling one in another case is checked with its tags. Each is read in place (AccountAwareStorageBackend.readInAccount): the handlers' lookups move a
pre-multi-account entry into the caller's account, which a read made before the request is allowed must not do. Each
kind's tags change in place under its own lock, so the read copies them under that lock, taken
only once the resource is found (an ARN naming nothing leaves no lock behind) and finding it again under it. A
serverless cache's tags are replaced whole on each change, so its copy needs no lock.

ElastiCacheResourceTagIamIntegrationTest checks a caller allowed elasticache:DeleteUser and
elasticache:DeleteCacheParameterGroup only on resources tagged team=blue deletes the blue one and is refused the red
one, and the same for elasticache:DeleteUserGroup with the group's id in upper case, and that a Deny on
team=red refuses a delete of the red user signed for another Region; ElastiCacheServiceTest and ElastiCacheServerlessServiceTest check the reads, their copies, the ARNs that name
nothing, that reading those leaves the lock count as it was, and that a legacy user is read where it is.
2026-11-30 10:30:23 -04:00
Priamo Germosen cd7017c6a5 fix(iam): read the stored tags of Transfer Family servers and users and SES resources (#9832)
The request-resources table gives resource-tag keys to Transfer Family's server and user types and to SES's
identity, configuration set, template, contact list, custom verification email template, dedicated IP pool and
tenant types, but neither namespace gave IAM the tags it stores, so an aws:ResourceTag condition on one of their
actions never matched: an Allow scoped to a tag never applied and a Deny scoped to one never refused.

TransferStoredResourceArns reads TransferService.heldTags: the tags the server or user the ARN names holds, in the
ARN's account and Region, read in place under every key the handlers find it under (its Region's, or one from
before keys named the Region or the account), matched on the whole ARN, and copied. AccountAwareStorageBackend gains
getForAccountWithLegacyKeys for that: the value getForAccountMigratingLegacyKeys returns, under the same keys and
owner check and the same monitor, with nothing moved. It writes nothing: the handlers' lookups move a resource under an old
key to its Region's key, and the tag read stores the tags it merges, neither of which a read made for IAM may do.

SesStoredResourceArns reads SesService.storedTags: the tags ListTagsForResource reads for the resource of each
taggable kind, in the ARN's account and Region; none for an ARN of another account, with no Region, or naming no
resource SES holds. Each domain reads it in place (SesTaggable.storedTags, through
AccountAwareStorageBackend.readInAccount): the lookup the tag operations make moves a pre-multi-account entry into the
caller's account, which a read made before the request is allowed must not do. Each tag change stores a new list, so
the copy is of one whole set. A tenant's ARN ends in the id SES mints, which a request naming the tenant by its name
(GetTenant, DeleteTenant) leaves out, so SesStoredResourceArns.find resolves the name to the stored tenant's ARN,
read in place too.

StoredResourceTagIamIntegrationTest checks a caller allowed transfer:DescribeServer and ses:GetConfigurationSet
and ses:GetTenant only on resources tagged team=blue reaches the blue one and is refused the red one; TransferServiceTest and
SesServiceStoredTagsTest check the reads, their copies and the ARNs that name nothing.
2026-11-30 09:13:57 -04:00
Oleksandr Nikolaichuk 4a013f5226 feat(iam): SimulatePrincipalPolicy lists resource-policy statements in MatchedStatements (#9776) 2026-11-30 06:57:27 -04:00
Priamo Germosen d6ab5bc760 fix(iam): read stored tags only from held resources, without leaving state behind (#9807)
Follow-ups of the stored-tags batches (#9794, #9799), from their reviews.

Config's TagResource keeps tags for any config ARN of a kind it holds no resource of (an aggregator, a stored query),
and storedTags read them, so a caller allowed config:TagResource could store tags on such an ARN that then satisfied
an aws:ResourceTag condition. AwsConfigService.heldTags answers only for the kinds Config holds and checks before
tagging (a rule, a conformance pack, an aggregation authorization, the configuration recorder), and finds the
resource without creating the per-Region maps or the lock its tag changes use, which the locked read did for the
Region of any ARN a request named, denied ones included; it takes that lock only once the resource is found. EFS's
storedTags likewise finds the file system or access point before taking its lock.

MemoryDbServiceTest checks that every map of tags MemoryDB answers is a copy, and the MemoryDB and Route 53 Resolver
integration tests' cleanups name the port, as they run after the test method once Quarkus has reset RestAssured's
(Route53ResolverRequests gains a port overload).
2026-11-30 06:26:15 -04:00
Priamo Germosen 10cec1d376 fix(iam): read the stored tags of CloudWatch alarms, dashboards and metric streams (#9796)
The request-resources table gives CloudWatch's alarms, dashboards and metric streams the aws:ResourceTag keys, which
the Service Reference lists for them, but CloudWatch answered no storedTags, so a condition on a resource tag never
matched: a caller allowed cloudwatch:DeleteAlarms only on alarms tagged team=blue was refused it on the blue alarm as
on any other.

CloudWatchStoredResourceArns reads the tags CloudWatch's tag operations read, each kind from the service keeping it:
an alarm's from the metrics service, a dashboard's from the dashboards service and a metric stream's from the metric
streams service. An ARN of another account, or one naming no resource CloudWatch holds, reads none.

The dashboards and metric streams services changed a resource's tags in place under no lock, and their tag read
handed out the live map, which an IAM check reading it while another request tags the resource could see half
changed or fail on. Their tag read, tag and untag are now synchronized, and the read returns a copy, as the metrics
service's already were; the dashboards and metric streams service tests check the read is a copy.

Each kind is told by the resource part its ARN starts with (alarm:, dashboard/, metric-stream/), as the table's
formats name it. isDashboardArn and isMetricStreamArn matched their word anywhere in the ARN, and an alarm may be
named x:dashboard/y, which then went to the dashboards service, read no tags and escaped a tag-scoped Deny; the tag
handlers dispatched with the same helpers, so they now match the prefix too.
2026-11-29 23:26:55 -04:00
Priamo Germosen bcb2a5e29c fix(iam): read the stored tags of Config, EFS and Route 53 Resolver resources (#9794)
The request-resources table gives AWS Config's rules, aggregators, conformance packs and other resources, EFS's file
systems and access points, and Route 53 Resolver's endpoints, rules and firewall domain lists the aws:ResourceTag
keys, which the Service Reference lists for them, but none of the three services answered storedTags, so a condition
on a resource tag never matched for them: a caller allowed an action only on resources tagged team=blue was refused
it on the blue one as on any other.

Each service's stored-ARN class now reads the tags it keeps on the resource the ARN names, under the lock that
resource's tag changes hold, so a concurrent change is seen whole or not at all: Config through ListTagsForResource's
own locked read; EFS from the caller's file system or access point the ARN names, matched on its stored ARN and
copied under its resource lock (EfsService.storedTags); Route 53 Resolver from its tag store for the caller's
endpoint, rule or firewall domain list, under the monitor its tag changes hold. An ARN of another account reads none, as these services keep no resource of it for the caller.
2026-11-29 22:59:34 -04:00
Priamo Germosen 91480010b7 fix(iam): read the stored tags of MemoryDB clusters, users and ACLs (#9799)
The request-resources table gives MemoryDB's clusters, users and ACLs the aws:ResourceTag keys, which the Service
Reference lists for them, but MemoryDB answered no storedTags, so a condition on a resource tag never matched: a caller
allowed memorydb:DeleteUser only on users tagged team=blue was refused it on the blue user as on any other.

MemoryDbStoredResourceArns reads the tags MemoryDB's ListTags reads, for the caller's cluster, user or ACL the ARN
names. Its tag changes mutated the stored map in place under no lock, and ListTags handed out that live map, which an
IAM check reading it while another request tags the resource could see half changed or fail on; the tag read, tag and
untag are now synchronized, and each returns a copy.
2026-11-29 22:52:36 -04:00
Priamo Germosen 1dc6478108 fix(iam): return GetFunction's tags only to a caller allowed lambda:ListTags (#9782)
The Lambda API reference says of GetFunction's Tags "Lambda returns tag data only if you have explicit allow
permissions for lambda:ListTags", and the Service Reference lists lambda:ListTags among the actions GetFunction is
authorized by. Floci returned a function's tags to every caller allowed lambda:GetFunction.

tools/aws/fetch_lambda_response_permissions.py vendors, from the API reference page of each operation the Service
Reference lists as authorized by an action beside its own and the reference's operations page documents, each
response element's sentence saying it is returned only with a permission, with the element and the action. It
refuses a sentence naming a permission and a lambda: action in any other wording, and a page whose response elements
section is missing or lists no element without saying the response is empty, so a reworded or relaid page fails
rather than dropping the check. The authorized-actions generator reads it into a returnedOnlyIf
section, where botocore's response of the operation has a member of the element's name and the Service Reference
lists the action among the operation's: GetFunction returns Tags only with lambda:ListTags. IamAuthorizedActions
reads it, and LambdaController leaves the member out of a GetFunction response to a caller not allowed the action on
the function, checked with the function's tags through IamEnforcementFilter.authorizeEntryResource. TagsError is not
set, as no recording of AWS's answer for that case gives its code and message.

IamEnforcementFilter.requestAuthorization, which hands a handler the caller the filter evaluated, now treats a blank
Authorization header as no credential, as the filter itself does, and falls back to the presigned X-Amz-Credential;
before, a request with a blank header and a query credential passed the filter as that credential and the handler's
check as unsigned, so GetFunction returned Tags to a caller not allowed lambda:ListTags.
2026-11-29 22:09:26 -04:00
Priamo Germosen e4ee7816ad fix(iam): check each secret a Secrets Manager batch read returns as GetSecretValue (#9774)
The API reference's required permissions for BatchGetSecretValue say "you must have secretsmanager:GetSecretValue for
each secret", and the Service Reference lists that action among the operation's. Floci checked the batch action only,
so a caller allowed secretsmanager:BatchGetSecretValue read every secret, whatever its policies said about
GetSecretValue on each one.

The authorized-actions generator now reads that clause, already vendored by
fetch_secretsmanager_required_permissions.py, into a perEntry section: the action an operation needs on each entry it
reads, with the type of the action the clause's words name as the generators' names go (stem: secret is Secret),
where the Service Reference lists the action among the operation's. IamAuthorizedActions reads it, and the Secrets
Manager handler checks each secret a batch read returns against it, both by SecretIdList and by Filters. A secret the
caller may not read goes to Errors as AccessDeniedException, under the id it was requested as (its ARN for a filtered
read), and the others are returned, as AWS's own fidelity check records it
(check_batch_get_secret_value_returns_partial_results_with_a_per_secret_error_for_a_denied_secret).

Each secret is checked with the condition keys of its own stored tags (aws:ResourceTag/<key>,
secretsmanager:ResourceTag/<key>), through IamEnforcementFilter.authorizeEntryResource, so a grant or a deny scoped to
a tag holds for each secret of a batch as it does for a GetSecretValue of that secret alone.

The gates this change runs need today's AWS too, so the tables they cover are synced: the Service Reference lists 37
more Glue actions with no resource type and S3 Tables' ListStorageLensConfigurations (iam-authorized-actions.json),
S3 Tables' StorageLens type on its tagging actions with its ARN format and tag keys, and the elasticfilesystem-endpoint
and s3files-endpoint namespaces it does not read (iam-request-resources.json), three S3 actions taking
s3:ResourceAccount, GetBucketDefaultStorageClass, PutBucketDefaultStorageClass and GetIncompleteUpload
(s3control-tag-condition-keys.json), and the S3 user guide's permissions table gives the two default storage class
operations (tools/aws/sources/s3-required-actions.json).
2026-11-29 19:06:49 -04:00
Priamo Germosen 6563e6a315 fix(iam): check each layer a Lambda function adds as lambda:GetLayerVersion (#9769)
The Service Reference lists lambda:GetLayerVersion among the actions CreateFunction and UpdateFunctionConfiguration
are authorized by, and the Lambda Developer Guide says what it is checked on: "Make sure that you have permission to
call the GetLayerVersion API on the layer version". Floci checked neither operation as it, so a caller allowed to
create or update functions added any layer version of its account, whatever its policies said about reading it.

tools/aws/fetch_lambda_layer_permissions.py vendors that sentence from the adding-layers page, with the action and
the resource it names, and refuses a page asking for permission to call an API in any other wording. The
request-resources generator reads it (api_permission_resources): an operation the Service Reference lists as
authorized by that action is also checked as it on each value of the request's member holding botocore's ARN shape
for the type the words name (`<Type>Arn`, as minted_types reads it; `Layers`, a list of `LayerVersionArn`, for a
`layerVersion`). CreateFunction and UpdateFunctionConfiguration now check lambda:GetLayerVersion on each layer
version their Layers give, and a request giving none is not checked as it; no other operation changes.
--verify reports an operation checked so whose action the Service Reference stops listing (verify_api_actions).

CreateFunction is the first operation checked by parts that also tags what it creates, so IamEnforcementFilter now
checks an operation's own action, where it is one of the parts, as it would be alone: with the request's tags
(aws:RequestTag, aws:TagKeys) and carried values, not the bare part context. The checks made after it, the tagging
action a create also needs, a companion and a forwarded action, are made on the resources that action was checked on,
not on *, so lambda:TagResource is again checked on the function a tagged create makes.

Another account's layer version is checked on its ARN alone: LambdaStoredResourceArns answers reachedInItsAccount
for it, as Lambda reads such a layer in its owner's account through the owner's policy and never as the caller's layer
of that name, where IAM also checked the caller's same-named layer before (GetLayerVersionByArn too).

The table is regenerated against today's Service Reference too, which the online gate this change runs requires: AWS
added SageMaker's leaderboard and model-monitor-config types (their ARN formats and tag keys, and the types of
AddTags, DeleteTags and ListTags) and lists a backup-external namespace the table does not read.

The docs and two comments in LambdaService and LambdaLayerService no longer say Floci implements no layer
permissions.
2026-11-29 16:49:45 -04:00
Oleksandr Nikolaichuk 5a3bff3939 feat(iam): report EvalDecisionDetails per policy type for cross-account simulations (#9766) 2026-11-29 16:35:55 -04:00
Priamo Germosen 96819a87fd fix(iam): check a Secrets Manager request for the actions its required permissions give (#9758)
The Service Reference lists the actions each Secrets Manager operation is authorized by without saying when each is
needed, so a request was checked as its own action alone: a BatchGetSecretValue using Filters without
secretsmanager:ListSecrets, a CreateSecret adding replica Regions without secretsmanager:ReplicateSecretToRegions and
a ValidateResourcePolicy without secretsmanager:PutResourcePolicy were all let through.

Each operation's page in the API reference says it, in its required permissions: "If you use filters, you must also
have secretsmanager:ListSecrets", "To add replica Regions, you must also have secretsmanager:ReplicateSecretToRegions",
"Required permissions: secretsmanager:ValidateResourcePolicy and secretsmanager:PutResourcePolicy".
tools/aws/fetch_secretsmanager_required_permissions.py copies that paragraph for each operation the Service Reference
lists as authorized by another of its actions, with each clause's action and what it is needed for or on, into
tools/aws/sources/secretsmanager-required-permissions.json. Two generators read it:

- regen_iam_authorized_actions.py: an action needed when the request does something is a companion of the request
  member the clause's words name as the generators' names go (filters is Filters, add replica Regions
  AddReplicaRegions), where the Service Reference lists it for the operation and does not mark it as tagging, which
  the tag-on-create table checks. A companion a request member sets may now carry no session key.
- regen_iam_request_resources.py: actions an operation always needs beside its own are each checked on what the rules
  read for it (ValidateResourcePolicy and PutResourcePolicy on the secret its SecretId names). A request checked by
  parts that names nothing is now checked on * as each action the table checks on the same resources as its own, not
  as its own alone, so a ValidateResourcePolicy naming no secret still needs PutResourcePolicy.

The fetcher refuses a sentence naming a secretsmanager: action in a wording it does not read, so a reworded page fails
rather than dropping a check, and the enforcement test runs on the AWS SDK.

Not read: GetSecretValue for each secret of a batch, which AWS reports per secret in Errors rather than refusing the
call; PutResourcePolicy for a cross-account replica and DeleteResourcePolicy for one stopped replicating, whose words
name no member of the request; and the KMS permissions of a secret on a customer managed key.
2026-11-29 13:12:46 -04:00
Priamo Germosen bdfc7c2161 refactor(iam): place an SQS redrive's actions by the guide's per-queue groups (#9751)
#9743 read which queue each action of a message move task is checked on from two parameter sentences of the API
reference picked one by one (SourceArn's "only ARNs of dead-letter queues (DLQs)", DestinationArn's "specify the
destination queue"), a list of the three operations' pages, and a reading of its own for ListMessageMoveTasks: a queue
no parameter named was the one the row named the operation's own action of.

The developer guide's steps to configure a redrive's minimum permissions group the actions by queue instead:
"Permissions for the DLQ (source queue): sqs:StartMessageMoveTask, ..., sqs:ReceiveMessage, sqs:DeleteMessage,
sqs:GetQueueAttributes" and "Permissions for destination queue: sqs:SendMessage". The fetcher now copies those groups,
and group_permission_resources places each action the Service Reference lists an operation as authorized by on the
queue its group names, the member of the request the group's words name as the generator's names go (the source queue
is SourceArn, the destination queue DestinationArn), as CodeArtifact's destination repository is its
destinationRepository. The parameter sentences, the list of operations and the own-queue reading are gone. The table
is unchanged.
2026-11-29 11:48:06 -04:00
Priamo Germosen 1c84d5eccf fix(iam): check an SQS redrive as the actions its guide gives each queue (#9743)
StartMessageMoveTask was checked as sqs:StartMessageMoveTask alone, on both its SourceArn and its DestinationArn, so a
caller granted the permissions AWS requires was refused on the destination, and one granted the action alone on the
dead-letter queue was let through. ListMessageMoveTasks was checked as its own action alone.

The Amazon SQS developer guide's table of a dead-letter queue redrive's minimum permissions gives each task's actions
of each queue: "Add the sqs:StartMessageMoveTask, sqs:ReceiveMessage, sqs:DeleteMessage, and sqs:GetQueueAttributes
of the dead-letter queue", "Add the sqs:SendMessage of the destination queue", and "Add the sqs:ListMessageMoveTasks
and sqs:GetQueueAttributes of the dead-letter queue". The API reference names each queue's parameter: SourceArn "only
ARNs of dead-letter queues (DLQs)", DestinationArn "specify the destination queue". AWS's own fidelity check
(iam__sqs__sts/check_start_message_move_task_requires_composite_source_and_destination_permissions in
aws/aws-emulator-evaluation-suite) refuses a caller granted sqs:StartMessageMoveTask alone on the dead-letter queue,
naming sqs:ReceiveMessage on it, and lets the call through once the five are granted.

tools/aws/fetch_sqs_redrive_permissions.py copies the table's rows and those parameter sentences into
tools/aws/sources/sqs-redrive-permissions.json, a new PERMISSION_SOURCES entry, and the request-resources generator's
task_permission_resources reads it: the row naming the operation's own action, each action on the resource the rules
read from the parameter naming its queue, a queue the request names by no such parameter being the one the row names
the operation's own action of. --verify checks each row's actions against the Service Reference's AuthorizedActions.
Only StartMessageMoveTask and ListMessageMoveTasks change; CancelMessageMoveTask names its task by handle and keeps
its reading.
2026-11-29 11:22:57 -04:00
Priamo Germosen 8440821793 fix(iam): read iam:AccountPropertyNamespaces from the keys PutAccountProperties sets (#9736)
The generated IAM condition key table had iam:AccountPropertyNamespaces in notRead on both actions the Service
Reference lists it on, so a policy keyed on it matched nothing: the IAM user guide's DenyRoleManagerEnablement
statement, ForAnyValue:StringEquals on RoleManager, let a caller enable role manager, and an Allow requiring the
namespace refused every call.

Neither botocore nor the Service Reference says where the value is; AWS's pages do. The IAM user guide's condition
key table: iam:AccountPropertyNamespaces "Specifies the account property namespaces being read or modified in the
request ... When you call PutAccountProperties or GetAccountProperties". The API reference on PutAccountProperties'
Properties: "Each key uses the format Namespace/PropertyName. The key must contain exactly one / separating the
namespace from the property name". tools/aws/fetch_iam_account_property_namespaces.py copies both sentences into
tools/aws/sources/iam-account-property-namespaces.json with what they name: the key, the operation, the parameter,
the format, its separator and the part that is the namespace. regen_iam_condition_keys.py takes that entry as it
stands, refusing it unless the Service Reference lists the pair and botocore models the parameter as a map of
strings, and writes it to a new fromMapKeys section, which the IAM context resolver reads from the request's map as
the operation's handler does. GetAccountProperties names no properties, so it stays in notRead.
2026-11-29 08:40:07 -04:00
Priamo Germosen 7d3049d218 fix(iam): read a federated assume's source identity from its assertion or token (#9708)
Under enforcement a role whose trust policy conditions AssumeRoleWithSAML or AssumeRoleWithWebIdentity on sts:SourceIdentity refused every assume, and one that withheld sts:SetSourceIdentity was never consulted: neither operation read the source identity its identity provider sets, so the session carried none, the response returned none and its requests carried no aws:SourceIdentity. The Service Reference gives both actions sts:SourceIdentity but lists no authorized actions for either operation, and botocore models the value only in the response.

The IAM user guide's page on source identity, which tools/aws/fetch_sts_source_identity.py already vendors, says where each carries it, "to set a SAML attribute for source identity, include the Attribute element with the Name attribute set to https://aws.amazon.com/SAML/Attributes/SourceIdentity" and "include source identity in the https://aws.amazon.com/source_identity namespace in the token", and what it needs, "trust policies for all roles connected to an identity provider (IdP) must have the sts:SetSourceIdentity permission". The fetcher now copies those sentences too, and regen_iam_authorized_actions.py gives each operation a companion naming the attribute or the claim and the key it is read as, where the reference's action of the operation's name takes sts:SourceIdentity.

STS reads the value the table names, holds it to botocore's sourceIdentityType (the shape botocore gives the response's SourceIdentity, as it does AssumeRole's member), and refuses several values or one outside it with InvalidIdentityToken. The trust policy reads it as sts:SourceIdentity, through the keys the federated trust evaluators already read in full, and is checked for sts:SetSourceIdentity before the assume, as for AssumeRole. The session records it under aws:SourceIdentity, which a session assumed from it carries on, and the response returns it.

Part of #6640.
2026-11-28 23:02:42 -04:00
Priamo Germosen cc74f1c3a2 fix(iam): read an AssumeRole's source identity as the IAM user guide gives it (#9697)
Under enforcement an AssumeRole passing a SourceIdentity was neither held to sts:SetSourceIdentity nor read as sts:SourceIdentity, so a trust policy requiring a source identity refused every assume and one granting the permission was never consulted. The session kept no source identity either: the response returned none, its requests carried no aws:SourceIdentity, and a session assumed from it could set another. botocore gives the member and the Service Reference the key and the action, listing sts:SetSourceIdentity among the actions AssumeRole is authorized by, without saying when it is needed or which member carries the key.

The IAM user guide's page on source identity says both: "to pass source identity while assuming a role, use the -–source-identity AWS CLI option or the SourceIdentity AWS API parameter", "to specify a source identity, principals (IAM users and roles) must have permissions to sts:SetSourceIdentity", and when chaining it is "required in both the permissions policy of the principal who is assuming the role and in the role trust policy of the target role". tools/aws/fetch_sts_source_identity.py vendors it into tools/aws/sources/sts-source-identity.json. regen_request_condition_keys.py reads it for sts (CONDITION_SOURCES), so sts:SourceIdentity is read from AssumeRole's SourceIdentity, and regen_iam_authorized_actions.py crosses it with the reference's AuthorizedActions and botocore's request members into a new companions section of iam-authorized-actions.json: AssumeRole needs sts:SetSourceIdentity when it names SourceIdentity or its caller carries aws:SourceIdentity.

Enforcement checks the companion action on the role with the request's keys, and for a caller that is itself a role session checks it of the caller's own permissions alone too, since a trust policy naming the caller's role would otherwise stand in for them in the same account (the table's callerPolicyWhenChained, from the page's sentence on role chaining). STS checks it in the trust policy before the assume, as AWS names it where a statement granting both is conditioned on another sts:SourceIdentity. The session records the value under the key the table gives, aws:SourceIdentity, which its requests carry and a session assumed from it carries on, read there as sts:SourceIdentity too, and the response returns it. A chained request naming another value is refused with ValidationError, "The source identity is already set for this assume role session", and an AssumeRole naming a session tag key twice with InvalidParameterValue, "Duplicate tag keys found. Please note that Tag keys are case insensitive.", both as AWS's evaluation suite records them.

Part of #6640.
2026-11-28 21:09:11 -04:00
Priamo Germosen 75f5ec3136 fix(iam): read the tags an AssumeRole passes in the role's trust policy (#9689)
Under enforcement a role whose trust policy conditions the assume or sts:TagSession on aws:RequestTag/<key> or aws:TagKeys refused every tagged AssumeRole, and a Deny keyed on them never applied: STS built the trust policy's context by hand, with the session name and external ID alone. The Service Reference gives sts:AssumeRole both keys, and the IAM user guide's session tags page has a trust policy reading them: with aws:RequestTag "you can allow the principal to pass the specified session tags, but only with the specified values", and with aws:TagKeys "pass only session tags with the specified tag keys".

The trust policy's context now takes the request's keys from the generated tables, as the caller's own policies do: the members request-condition-keys.json gives sts:AssumeRole, its RoleSessionName and ExternalId, and the tags iam-tag-on-create.json reads from its Tags, as aws:RequestTag/<key> and aws:TagKeys. The assume and the sts:TagSession permission are each checked once for every set of tags a reading of the list gives, past a gap in its numbering or with each value of a key sent twice, as the enforcement filter checks the caller's policies, so a Deny on a tag holds however the list is sent. The filter's per-set helper moves to IamConditionContextResolver beside requestContextsOfForm, which STS calls, and formParameters shares its first-value reading with it.

Both read the list as STS does. TagOnCreate read sts: tags under Tags.member up to the first gap, while STS reads them through AwsQueryLists, Tags.member.N or the bare Tags.N at every index, so a tag sent as Tags.1, or after a gap, reached the session and not the check, and a policy requiring it refused a call AWS allows. sts: is now read through the shared reader, as iam: is, and the shared reader takes the members in the order of their indices, as AwsQueryLists gives them, so a key sent twice keeps the value the handler keeps.

Part of #6640.
2026-11-28 19:27:26 -04:00
Priamo Germosen ee3970d6c9 fix(iam): read route53:VPCs from the vendored Route 53 developer guide (#9687)
Under enforcement a VPC association call scoped by route53:VPCs was refused for every VPC, as #8367 reports: the request condition key table never filled the key, so a condition on it never saw a value. Neither botocore nor the Service Reference says where a request carries the key or in what form.

Route 53's developer guide says both, in its table of condition keys: route53:VPCs "Represents a list of VPCs in the request of AssociateVPCWithHostedZone, DisassociateVPCFromHostedZone, ListHostedZonesByVPC, CreateHostedZone, CreateVPCAssociationAuthorization, and DeleteVPCAssociationAuthorization, in the format of "VPCId=<vpc-id>,VPCRegion=<region>". A vendored source, tools/aws/sources/route53-condition-keys.json, written by tools/aws/fetch_route53_conditions.py from that page, gives each key the table gives in a format of request members, with its operations and members, and the generator reads it for route53 (CONDITION_SOURCES) beside the record keys it already reads.

The table writes a key a format composes as that format with each member's place holding where the request carries it (VPCId={VPC.VPCId},VPCRegion={VPC.VPCRegion}), and a member of the query string as ? and its name (ListHostedZonesByVPC's ?vpcid and ?vpcregion), and the request condition reader fills the format from them, read from an XML body or the query string, when each member holds one value. A request naming no VPC, as a public CreateHostedZone does, carries none.

Route 53 reads the VPC only where its schema puts it, the VPC below the request's root, where IAM reads it, and refuses a second VPC, a second VPCId or VPCRegion, or a repeated vpcid or vpcregion query parameter with InvalidInput, as it already refuses a change batch naming an element twice. It used to take the first VPC anywhere in the body, so a request naming a denied VPC beside another carried no value for the Deny to match and still acted on the denied one.

Closes #8367.
2026-11-28 18:39:20 -04:00
Priamo Germosen 1b7ddb1101 fix(iam): read EKS access entry condition keys from the vendored Service Authorization Reference (#9682)
Under enforcement a CreateAccessEntry scoped by eks:principalArn or eks:accessEntryType was refused for every entry, and an AssociateAccessPolicy scoped by eks:policyArn or eks:namespaces for every association, as #8311 reports: the request condition key table read none of these keys, so a condition on them never saw a value. Neither botocore nor the Service Reference says which request member carries them.

The Service Authorization Reference's table of the keys EKS defines says it: eks:principalArn, eks:kubernetesGroups, eks:policyArn and eks:namespaces filter on "the <member> present in the access entry requests" or in "the associate / disassociate access policy requests", and eks:accessEntryType and eks:username on "the access entry type" and "the Kubernetes username" present in them, the access entry requests' type and username. A vendored source, tools/aws/sources/eks-condition-keys.json, written by tools/aws/fetch_eks_conditions.py from that page, gives each key its member, and the generator reads it for eks (CONDITION_SOURCES) beside the cluster keys it already reads.

The page gives what a request carries, so a vendored key is read from an action's request only where the reference lists it on the action itself; one the reference gives a resource type alone is the stored resource's value. A list's values are each read (kubernetesGroups, accessScope.namespaces). A vendored member the request carries outside its body, as DisassociateAccessPolicy carries policyArn in its path, or as a structure, as accessScope is, the page not saying which of its values the key holds, is not read.

The keys the reference gives the access entry itself, its stored principal, type, groups and username on the operations acting on one, are not read yet: those requests are checked on an access entry ARN whose identity and id are left open, which names no one entry to read them from.

Closes #8311.
2026-11-28 17:12:28 -04:00
Priamo Germosen b4cc436ad0 fix(iam): read EventBridge's rule and target condition keys from the vendored user guide (#9673)
Under enforcement a PutRule scoped by events:source was refused for every event pattern, and a PutTargets scoped by events:TargetArn for every target, as #8320 reports: the request condition key table never filled either key, so a Null or ForAllValues condition on them never saw a value. The table's reader is generic, but which member carries a key comes from SERVICES in regen_request_condition_keys.py, and EventBridge was not there. Neither botocore nor the Service Reference says where a request carries these keys: botocore models EventPattern as a string ("The event pattern").

EventBridge's user guide says it, in its table of condition keys: events:source is "the literal string for the source field of the event", with events:detail-type, events:detail.service, events:detail.eventTypeCode and events:detail.userIdentity.principalId the same for their fields, which a rule's event pattern gives ("EventPattern is a mandatory argument to PutRule"), and events:TargetArn is "the ARN of the target for the rule". A vendored source, tools/aws/sources/eventbridge-condition-keys.json, written by tools/aws/fetch_eventbridge_conditions.py from that page, gives each key its member, and the generator reads it for events (CONDITION_SOURCES), each key in the one operation the page names: PutEvents, CreateEventSource and UpdateEventSource take events:source too, which the page does not describe, so they are not read there. --verify checks the file against the page.

The table writes a field of a JSON document a string member holds after #: EventPattern#source.* is each literal string of the pattern's source, read by one generic step of the JSON reader. A pattern leaving a field out names nothing, so ForAllValues allows it and a Null check refuses it, as the page's examples show. The fields are read at the pattern's top level, where every example on the page gives them, so a $or branch's names nothing, and a matcher such as {"prefix": "aws."} is no literal string and names nothing. events:TargetArn reads each target's own Arn, not its dead-letter queue's.

Closes #8320.
2026-11-28 15:50:13 -04:00
Priamo Germosen c0c60ea886 fix(iam): check AWS Backup by its generated routes, resources and passed roles (#9669)
Under enforcement a REST route no vendored model names runs unchecked, and AWS Backup was among them: a caller could start a backup job or assign resources to a backup plan with any role and no iam:PassRole, and a grant scoped to one backup vault or plan covered every one, as #6255 reports. Backup's model routes are vendored, so each request is checked as its operation's action, and Backup joins the tables of request resources, passed roles and tags on create.

The Service Reference passes most of Backup's roles to one service, which the passed-roles generator reads alone: IamRoleArn to backup.amazonaws.com, a backup plan's scan settings' ScannerRoleArn to malware-protection.guardduty.amazonaws.com, and a restore testing selection's to restore-testing.backup.amazonaws.com. It passes StartScanJob's IamRoleArn and ScannerRoleArn to both of the first two without saying which goes where, so a vendored source, tools/aws/sources/backup-roles.json, written by tools/aws/fetch_backup_roles.py from the developer guide's malware protection page, gives each: the scanner role "trusts malware-protection.guardduty.amazonaws.com", and the backup role is "the same role found in ... the BackupSelection API", linking CreateBackupSelection, whose role the Service Reference passes to backup alone. The generator reads such a role as going where the reference passes that operation's roles, when that is one service.

A backup vault is checked by its name and a backup plan by its id; BackupStoredResourceArns answers the tags Backup holds on either, which an aws:ResourceTag condition reads. A recovery point's format the Service Reference gives with a literal * account, which the reader matches as written, so a request naming a recovery point by its ARN is checked on *, as one naming a DMS endpoint is.

A namespace the table reads is served on the shared tag routes only with a method its model gives on the path, as it already was only on the paths its model gives: Backup removes tags with POST /untag/{resourceArn}, so a DELETE on its /tags/{resourceArn}, which no Backup operation is and no action checks, was let through and removed tags an aws:ResourceTag deny relies on. It is now refused with MethodNotAllowedException (405), as a tag call sent with the other verb is.

Closes #6255.
2026-11-28 14:26:04 -04:00
Priamo Germosen 0da5179612 fix(iam): check AWS AppSync by its generated routes, resources and passed roles (#9668)
Under enforcement a REST route no vendored model names runs unchecked, and AWS AppSync was among them: a caller could give a data source any service role and a GraphQL API any CloudWatch Logs or merged API execution role with no iam:PassRole, and a grant scoped to one GraphQL API covered every API, as #6255 reports. AppSync's model routes are vendored, so each request is checked as its operation's action, and AppSync joins the tables of request resources, passed roles and tags on create.

The Service Reference passes every AppSync role to appsync, so the passed-roles generator reads each member alone: a data source's serviceRoleArn, a GraphQL API's logConfig.cloudWatchLogsRoleArn and mergedApiExecutionRoleArn, and an Event API's eventConfig.logConfig.cloudWatchLogsRoleArn, each passed to appsync.amazonaws.com.

The request-resources generator now also fills a variable whose stem no member's matches with the one path label a REST route puts after the literal segment the type's format puts before that variable, or after that segment qualified by the variable's first word: AppSync's apiId in /v1/apis/{apiId} fills apis/${GraphQLAPIId}, and sourceApiIdentifier in /v1/sourceApis/{sourceApiIdentifier} a merged API association's apis/${SourceGraphQLAPIId}. No other namespace's reading changes. An operation on an API's data sources, resolvers, functions, types, API keys or schema, which the Service Reference gives no resource type, stays on *, as AWS checks it. AppSyncStoredResourceArns answers the tags AppSync holds on a GraphQL API or a custom domain name, which an aws:ResourceTag condition reads.

AppSync now mints a channel namespace's ARN as apis/<apiId>/channelNamespace/<name> and an association's as apis/<mergedApiId>/sourceApiAssociations/<associationId>, from the association's own id, as AWS returns them, so a policy naming the ARN AppSync returns names the resource the request is checked on. Floci minted channelNamespaces/<name>, and an association ARN under sourceApis/ or mergedApis/ ending in a second id.

AppSync's tag routes are served, as every namespace's the table reads, on the route its model gives, /v1/tags/{resourceArn} with the ARN encoded as an SDK sends it.

Part of #6255.
2026-11-28 13:03:05 -04:00
Priamo Germosen 739e1274bc fix(iam): check AWS Batch by its generated routes, resources and passed roles (#9660)
Under enforcement a REST route no vendored model names runs unchecked, and AWS Batch was among them: a caller could create a compute environment with any service, instance or Spot Fleet role and register a job definition with any job or execution role, as #6255 reports. Batch's model routes are vendored, so each request is checked as its operation's action, and Batch joins the table of request resources and the passed-roles table.

The passed-roles generator reads RegisterJobDefinition's roles, each passed to ecs-tasks.amazonaws.com, alone. The Service Reference passes CreateComputeEnvironment's and UpdateComputeEnvironment's roles to batch, ec2, ecs and spotfleet without saying which member's goes where, so a vendored source, tools/aws/sources/batch-roles.json, written by tools/aws/fetch_batch_roles.py from the Batch API reference and user guide, gives each: serviceRole is trusted by batch.amazonaws.com, a compute resource's instanceRole is an instance profile whose role is trusted by ec2.amazonaws.com, spotIamFleetRole by spotfleet.amazonaws.com, and a managed instances provider's infrastructureRoleArn needs "iam:PassedToService: ecs.amazonaws.com", the update's naming the same role in the same words. SubmitServiceJob, which Floci does not serve, names its role inside the SageMaker request it queues, a string the table does not read.

The request-resources generator reads a type of two variables from a member whose documentation spells it, as it does ECS's "(family:revision)", now also where a variable shares only some of its words with the type's name, so DeregisterJobDefinition's "(name:revision)" names a job definition revision whole, not only its name, and where a member lists the form among those it takes, as SubmitJob's "definition-name, definition-name:revision, or the ARN" does, naming the revision rather than the job definition its name alone fills: "the request ARN includes the revision". BatchStoredResourceArns resolves it as Batch does, a name alone being the latest active revision a job runs, and answers the tags of what Batch stores. A member of a structure documented as "The Amazon Resource Name (ARN) of the" resource is read as one, so a job queue's computeEnvironmentOrder[].computeEnvironment is checked. No other namespace's reading changes.

A role name a path prefixes, which Batch documents ("if a role with the name bar has a path of /foo/, specify /foo/bar as the role name"), is checked on the role IAM holds under that name and path.

Batch's tag routes are served, as every namespace's the table reads, on the route its model gives, /v1/tags/{resourceArn} with the ARN encoded as an SDK sends it. Its tag-on-create reading waits: CreateComputeEnvironment is checked as batch:TagResource or batch:SetCapacityTags, and nothing says which of its tag members each is for.

Part of #6255.
2026-11-28 11:14:42 -04:00
Allen Sanborn 6ff7b0fdd9 fix(iam): match AWS wording for missing and duplicate entity errors (#9098)
IAM's wording for missing and duplicate entities now matches what AWS answers. A duplicate CreatePolicy is "A policy called <name> already exists. Duplicate names are not allowed.", and a permissions boundary that names no policy, on CreateUser, CreateRole, PutUserPermissionsBoundary or PutRolePermissionsBoundary, answers "Scope ARN: <arn> does not exist or is not attachable.". A version id that names nothing on a policy that exists is named inside the attach sentence on GetPolicyVersion, DeletePolicyVersion and SetDefaultPolicyVersion, inline policies read "The user|group|role policy with name <name> cannot be found.", and instance profiles read "Instance Profile <name> ...". The wording tests share IamWordingRequests, which registers every create with PartitionCleanup.
2026-11-28 09:14:58 -04:00
Oleksandr Nikolaichuk a36725ec2d feat(iam): evaluate ResourcePolicy on SimulatePrincipalPolicy for a user source (#9583)
SimulatePrincipalPolicy ignored ResourcePolicy, so a simulation answered from the identity policies alone. For an IAM user source the supplied resource policy is now evaluated through the same decide the enforcement path uses, with CallerArn, which defaults to the source user, as its principal, and its condition keys counted in MissingContextValues. Each resource's owner is the account its ARN names, otherwise ResourceOwner, otherwise the caller's account, and RoleResourceAccessAuthorizer.relationship picks the same- or cross-account rules. A role source still ignores it, as the reference says resource-based policy simulation isn't supported for roles, and CallerArn is held to its declared length.
2026-11-28 08:40:11 -04:00
Priamo Germosen a5afece703 fix(iam): check iam:PassRole on the roles an API Gateway request names (#9597)
AWS's Service Reference lists iam:PassRole for twelve API Gateway
operations, each passing its roles to apigateway.amazonaws.com. Floci
checked none: API Gateway is authorized by HTTP method, the passed-roles
table left the namespace out, and no member naming a role has a name the
table's rule knows (credentials, authorizerCredentials, credentialsArn,
authorizerCredentialsArn). An update names its role as a patch
operation's value, and an import inside its OpenAPI definition.

The roles are now checked for the operation the request's route resolves
to, which the table is keyed by, from three readings. A new vendored
source, tools/aws/sources/apigateway-roles.json, written by its own
script from the API references and developer guide, gives what they
read:

- The members that take a role, by the resource type each describes:
  "To specify an IAM role for API Gateway to assume, use the role's
  Amazon Resource Name (ARN)". PutIntegration, CreateIntegration,
  CreateAuthorizer, CreateApi and UpdateApi read them, REST APIs' and
  HTTP APIs' alike.
- A REST API update's patch operation, which names the property it
  changes by its path ("the path for this property is /name"): the
  value of the one whose path names a role member of the resource the
  update returns, so UpdateIntegration reads
  patchOperations[path=/credentials].value, UpdateAuthorizer
  /authorizerCredentials and UpdateAccount /cloudwatchRoleArn. The
  table gains a list step selecting the elements whose field holds a
  value.
- An import's OpenAPI definition, JSON or YAML: the
  x-amazon-apigateway-integration credentials of each Operation object,
  the ANY method's included, and the x-amazon-apigateway-authorizer
  authorizerCredentials of each security scheme, OpenAPI 2's and 3's,
  where the guide says each extension sits. ImportRestApi and PutRestApi
  take the whole body as the definition, ImportApi and ReimportApi a
  body member. The definition is read as its service takes
  and reads it, through a new PassedRoleLookup hook given the whole body:
  API Gateway resolves a REST API definition's ${AWS::Region},
  ${AWS::AccountId} and ${AWS::Partition} before importing it, so a role
  written with them is checked too, and takes an HTTP API's from its
  body's body (the REST route's envelope) or Body (the JSON 1.1
  handler's), or else the whole body, which the REST route also takes.

A REST JSON model's member is also read by its botocore name where its
wire name differs: Floci serves HTTP APIs over JSON 1.1 too
(AmazonApiGatewayV2.*), whose bodies name members as botocore does
(CredentialsArn, Body), and its handler takes either spelling as the
same member.

apigateway joins the passed-roles namespaces with all twelve operations
read and nothing added to the hand lists.
2026-11-27 14:21:56 -04:00
Priamo Germosen 1a91dbda76 fix(iam): check iam:PassRole on the roles an EMR RunJobFlow request names (#9587)
AWS's Service Reference lists iam:PassRole for RunJobFlow, passing its
roles to application-autoscaling.amazonaws.com, ec2.amazonaws.com and
elasticmapreduce.amazonaws.com without saying which member's role goes
where, and JobFlowRole names an instance profile rather than a role.
The passed-roles table left the operation unread, so a caller allowed
elasticmapreduce:RunJobFlow could launch a cluster with any service role
and any instance profile.

A new vendored source, tools/aws/sources/emr-roles.json, written by its
own script from the EMR API reference, management guide and AWS CLI
reference, gives each member's role. The guide's page of each role names
its default role ("The default role name is EMR_EC2_DefaultRole"), and
the full access policy it gives users passes each default role to one
service ("iam:PassedToService": "ec2.amazonaws.com*"). The API reference
calls JobFlowRole an instance profile ("Also called instance profile and
Amazon EC2 role"), and the CLI reference's create-cluster examples give
the roles by name (--service-role EMR_DefaultRole). The steps' runtime
role, StepExecutionRoleArn, is not passed: "You can control access to
the runtime role with the condition key elasticmapreduce:ExecutionRoleArn."

The generator reads the source through ROLE_SOURCES, as it reads EKS's,
now taking a documented iam:PassedToService over a trust policy, a member
by name or as an instance profile where the source says so, and leaving
out a member whose role a condition key controls. RunJobFlow moves out of
notRead: ServiceRole to elasticmapreduce.amazonaws.com and AutoScalingRole
to application-autoscaling.amazonaws.com, each by name or ARN, and the
roles of the instance profile JobFlowRole names, by name or ARN, to
ec2.amazonaws.com, found with the instance-profile lookup RunInstances
already uses. A profile IAM does not hold passes no role, as Floci's EMR
already reads JobFlowRole. An instance-profile member is not read for a
call with no request of its own, which has no such lookup.

The instance profile is now found one way everywhere it is used
(IamService.instanceProfileNamed): by its name, or by its own ARN, path
and account included. IAM's passed-role check, EMR's step role and an
EC2 instance's credentials each read it their own way, and EMR kept only
the name after an ARN's last slash. A JobFlowRole ARN of another account
or path then found no role to check but ran the steps as the local
profile's role.

A member's JSON value is now read as the text a handler reads it as, a
number or a Boolean included, as the request resources and condition
keys already read a body's values. The passed-roles reader took strings
alone, while EMR takes "JobFlowRole":123456 as the profile 123456, so a
role named by a number went unchecked.
2026-11-27 08:11:04 -04:00
Priamo Germosen fb0e72c96a fix(iam): check iam:PassRole on an EKS Auto Mode cluster's node role (#9576)
CreateCluster and UpdateClusterConfig take EKS Auto Mode's node role in
computeConfig.nodeRoleArn. AWS's Service Reference lists iam:PassRole
for both operations, with iam:PassedToService ec2.amazonaws.com and
eks.amazonaws.com, but not which member's role goes to which service.
Floci never checked the node role: CreateCluster read only its cluster
role, by hand, and UpdateClusterConfig was left out of the table.

A new vendored source, tools/aws/sources/eks-roles.json, written by its
own script from the EKS API reference and user guide, gives each member's
role and the service its trust policy is for. CreateCluster's roleArn is
the cluster IAM role ("provides permissions for the Kubernetes control
plane"), whose page links from the member and whose trust policy names
eks.amazonaws.com. nodeRoleArn is "the IAM Role EKS will assign to EC2
Managed Instances", whose description names the EKS Auto Mode IAM
reference, whose node IAM role section links the guide's page of that
role, whose trust policy names ec2.amazonaws.com. The generator reads
the source (ROLE_SOURCES) to choose, among the services the Service
Reference names for an operation, the one each member's role is for. It
fails on a vendored role for a service the reference does not name, and
on one no operation reads. --verify checks the source against the live
pages.

So CreateCluster now needs iam:PassRole on roleArn for eks.amazonaws.com
and on computeConfig.nodeRoleArn for ec2.amazonaws.com, and
UpdateClusterConfig on its node role for ec2.amazonaws.com. Both move
into the generated table. So do CreateNodegroup, CreateFargateProfile,
CreateAddon and UpdateAddon, whose roles PassedRoles read by hand, the
same members to eks.amazonaws.com the generator gives from botocore and
the Service Reference. Their hand readers are gone, and Step Functions'
EKS tasks now check them as a direct request does.
2026-11-27 01:00:33 -04:00
Priamo Germosen 6ba4970877 fix(iam): check iam:PassRole on the role an S3 replication configuration names (#9570)
PutBucketReplication passes the Role of its ReplicationConfiguration to
S3, and AWS's Service Reference lists iam:PassRole for it with
iam:PassedToService s3.amazonaws.com. Floci never checked it: the
passed-roles table recorded the operation as not read, because its
request body is XML, so a caller allowed s3:PutReplicationConfiguration
could name any role.

PassedRoles now reads a REST-XML body the way the condition keys of a
REST-XML request are read (XmlParser.valuesAt): each member at the
elements botocore serializes it as, below the document element, a
list's elements under the name its shape gives them or as member. The
text is read without surrounding whitespace, which S3 keeps in a Role it
accepts. The generator reads rest-xml models too, and fails on a role
member reached through a map or a flattened list, which an XML body
does not nest as the table's paths do. Two operations move from notRead
into the table: S3's PutBucketReplication (Role, to s3) and S3 Access
Grants' CreateAccessGrantsLocation (IAMRoleArn, with no named service).

Form parameters are now read only from a request the Query controller
dispatches (IamActionRegistry.isQueryRequest: a form posted to the root
path), as formParameters already documented. A request to another
protocol's route is read as its handler reads it, whatever Content-Type
it is sent with: an S3 replication configuration sent as
application/x-www-form-urlencoded was parsed as one form key, so its role
went unchecked while S3 stored the XML. The same held for tag-on-create
and request resources reading a REST request's JSON body.

S3's PutBucketReplication now refuses with MalformedXML a document that
is not well-formed as a whole, or whose configuration does not hold
exactly one Role with text, as it already counts each rule's Destination
and Bucket. It read the first Role anywhere in the document from a parse
that stopped where the configuration ended, so a second Role holding an
element, or content after the configuration, left IAM reading no role
while S3 stored the document.

The table is keyed by operation, as the Service Reference lists it, but
the enforcement filter and the Step Functions request checks looked it
up by the IAM action. The two differ for PutBucketReplication, which is
authorized as s3:PutReplicationConfiguration, so its entry would never
have been found. Both now look roles up by the request's operation, as
tag-on-create already does. DMS's ModifyDataProvider and
ModifyMigrationProject, authorized as UpdateDataProvider and
UpdateMigrationProject, are found the same way once Floci serves them.
2026-11-26 23:27:51 -04:00
Priamo Germosen e6a9092be8 feat(iam): check AppConfig, CodeArtifact and CodeGuru Reviewer by their REST routes (#9530)
Under enforcement a REST route no rule maps and no vendored model names
runs unchecked. AWS AppConfig with its data plane, AWS CodeArtifact and
Amazon CodeGuru Reviewer were among those: Floci serves each and no rule
mapped them.

Vendors the appconfig, appconfigdata, codeartifact and codeguru-reviewer
models' routes, 120 operations, so each request is checked as its
operation's action: a caller holding no grant for one is now refused
where the request used to pass. A request signed with a vendored model's
own name, which Floci also serves (appconfigdata), is checked under the
signing name the routes file records for that model (appconfig).

The three namespaces join the table of request resources. CodeArtifact's
48 operations and CodeGuru Reviewer's 14 read every type the Service
Authorization Reference marks required. Nine of AppConfig's 58 act on a
required type the table reads no member for (a deployment, a hosted
configuration version, an experiment run, a configuration profile named
as Configuration), so those are checked on the types it does read.
AppConfig Data's StartConfigurationSession is checked on the application
its ApplicationIdentifier names by its id or its name, from a measured
entry quoting AWS's own refusal of it on application/<app_id>, and
GetLatestConfiguration on the configuration of the session its
ConfigurationToken names: a reading gives a request's token that a
create of its service answers as naming what that create's session is
on, which the service finds.

A request member whose botocore shape is an account id now gives the
account of what the request names wherever a REST request carries it,
its path and query too, as the generator's own rule says, not only in
its body: CodeArtifact's domain-owner, QuickSight's AwsAccountId path
label on 196 operations, and Signer's GetSigningProfile profileOwner.
Such a resource in another account than the caller's is named as an ARN
of another account already is, in that account and as the caller's of
that name too, unless its service acts on it in that account. Signer,
ECR, CodeArtifact and Redshift do and say so, so each is checked on that
account's resource alone, as AWS checks it: Signer now reads the profile
or job its profileOwner or jobOwner names in that account, as AWS does,
where it read the caller's own, and saves a job it revokes there. Such a
request needs the owner's grant beside the caller's own policy, as AWS
requires of a cross-account request: CodeArtifact gives IAM a domain's
and a repository's policy, and Signer the profile permissions
AddProfilePermission adds, as the resource's policy (ResourcePolicyProvider),
a permission of one profile version holding for that version alone: a
job's, the version that signed it.
A resource a request names by another spelling than its service stores
it under is checked as the service reads it (resolveStoredArn, now also
for an ARN the reader builds from members): an AppConfig environment or
configuration profile by its id when named by its name, a CodeArtifact
PyPI or NuGet package by its normalized name, as AWS writes it in ARNs.

AppConfig, CodeArtifact and CodeGuru Reviewer give IAM the tags they hold
on the resource a request names (an application, a domain, repository or
package group, an association), so a grant conditioned on aws:ResourceTag
reaches a tagged resource; Signer reads a profile's tags in the profile's
own account, another account's included. A tagged create is checked for tagging on what
it makes where botocore's response gives it: CreateEnvironment answers
an Environment whose Id is the new environment's, AssociateRepository
the RepositoryAssociation whose AssociationArn is the association it
makes. A tagged StartDeployment's tags go on the deployment it makes,
its DeploymentNumber AppConfig's to mint, open. AppConfig stays out of
the passed-roles table: CreateExtension and UpdateExtension pass a role
in Actions{}[].RoleArn, a map of lists that file does not read.

A new vendored source, tools/aws/sources/codeartifact-permissions.json,
written by its own script from the CodeArtifact user guide, gives what
neither botocore nor the Service Reference says: CopyPackageVersions is
checked as ReadFromRepository on its source repository and as
CopyPackageVersions on its destination repository, and a package with
no namespace has an empty one in its ARN (package/my_domain/my_repo/
npm//react), so a request leaving namespace out is checked on that ARN.
A variable the reference names Encoded and a botocore shape's name is
filled from the member of that shape and encoded as its service encodes
it, through StoredResourceArns: CodeArtifact's package group pattern,
percent-encoded in lower case, which CodeArtifact now writes into the
group's own ARN as AWS does (/npm/team/* is /npm/team/%2a). A tag call
spelling a group's pattern otherwise (%2A), which CodeArtifact reads as
the same group, is checked on the group's own ARN, which CodeArtifact
resolves it to, so a deny on that ARN holds.

With AppConfig in the table, a tag call naming one of its ARNs with the
slash unencoded is refused as a path its model does not give, as for
every namespace the table reads; AppConfig's tests now send the ARN
encoded, as an SDK does. AppConfig Data's GetLatestConfiguration, which
a route filter moves off GET /configuration so S3's bucket of that name
keeps its route, is moved under an internal prefix the request records,
as every such route is, so IAM matches it on its modeled path. The table
tests place a create's members where the table locates them, expect a
member holding the type's own ARN to name it as it is, and expect each
resource in the account its own account member gives.
2026-11-26 18:45:59 -04:00
Priamo Germosen 5c1e8b8110 feat(iam): check Amazon SES by its generated routes and request resources (#9504)
SES v2 was checked by 118 hand-written rules in IamActionRegistry, one
per route of the model, and no SES request, v1 or v2, was checked on
the resource it names: the ses namespace waited in the table of request
resources' NOT_COVERED, as the generator refused it while its REST
clients had no vendored routes to tell their requests apart.

Vendors the sesv2 and pinpoint-email models' routes under the ses
credential scope, so each v2 request is checked as its operation's
action by the route botocore gives it, and removes the hand rules. The
ses namespace joins the table of request resources, 231 operations over
the ses, sesv2, pinpoint-email and mailmanager clients: an identity, a
configuration set, a template or a contact list by the member naming it,
an ARN member by the ARN it holds, as the Service Reference gives their
formats; an operation naming none of its action's types stays on "*".
Floci mints the same identity/<name> and configuration-set/<name> ARNs.

SES v1 and v2 share the operation names of the table, and the generator
merged the rows of clients that share an endpoint prefix, holding that a
request cannot tell them apart: a v2 SendEmail was read for v1's
SourceArn, so a grant on one identity sent from another by adding one.
Every row of the table now names the APIs it is read for, each a
protocol botocore gives a client of the operation with its API version
(SourceArn is query/2010-12-01), and the reader reads a request for the
rows of its own API alone: a Query request's by the Version its handler
dispatches it by, its form's on a POST and never its URL's, a REST
request's by the version of the model whose route it matched, never by
a member a caller adds. A request whose API neither gives, or
one no row names, is read for every row, as before. 68 rows are read
for some of their operation's APIs only, over SES, Elastic Load
Balancing's classic and v2 APIs, EventBridge, Lambda and Bedrock.

botocore now gives ListConfigurationSets and ListEmailIdentities as
POST /v2/email/list-configuration-sets and POST /v2/email/list-identities.
The GET /v2/email/configuration-sets and GET /v2/email/identities routes
an SDK built before that still sends stay served and match no route of
the model, so they are not checked. The hand-kept copy of the SES v2
model's routes the registry test read is removed: the route coverage
test checks every vendored route.
2026-11-26 10:08:17 -04:00
Priamo Germosen 6196543370 feat(iam): check Amazon EFS by its REST routes (#9483)
Under enforcement a REST route no rule maps and no vendored model names
runs unchecked. Amazon EFS was among those: Floci serves it and no rule
mapped it.

Vendors the efs model's routes, so each request is checked as its
operation's action: a caller holding no grant for one is now refused
where the request used to pass.

EFS joins the table of request resources: a file system by its id, an
access point by its, and a mount target's operations and the tag calls
by what EfsStoredResourceArns answers their MountTargetId or ResourceId
reaches, the file system or the access point EFS stores. All 31 of its
operations read every type the Service Authorization Reference marks
required, so every route is checked on the resources AWS checks. Its
two creates join the tag-on-create table, and
CreateReplicationConfiguration's Destinations[].RoleArn is checked for
iam:PassRole.

A tagged create of a type its action does not act on tags the resource
it makes where its request names every variable of it; a variable the
service mints, which the create's response answers and its request
carries none of, now counts as named there, staying open as it does in
every resource a create makes. So CreateAccessPoint, which acts on its
file system, has its tags checked on access-point/* rather than on the
file system, and so do five creates of other namespaces whose made
resource was named but for a minted id: CloudFormation's
CreateChangeSet, EMR's StartNotebookExecution, Textract's
CreateAdapterVersion and Transfer Family's CreateAgreement and
CreateConnector.
2026-11-25 22:46:23 -04:00
Priamo Germosen 0ed899bd59 fix(iam): give a role's tags to the policies an AssumeRole is checked against (#9474)
IAM's stored lookup answered no tags, so a role or user was never given its
aws:ResourceTag or iam:ResourceTag keys outside the IAM condition-key
table's fromTarget route, and an AssumeRole saw none of the role's tags:
a caller's policy allowing sts:AssumeRole on roles carrying a tag (the
guide's "Assume roles that have a specific tag") matched no role, and a
trust policy keyed on its own role's tags never matched.

IamStoredResourceArns.storedTags now gives the tags of the user or role an
ARN names, in the account it names, path included: the identity resources
iam:ResourceTag reads ("the tag attached to the identity resource (user or
role)"), which IAM and STS read aws:ResourceTag on alike. The trust policy
of an AssumeRole, and of the role a Step Functions Lambda task assumes, is
read with the role's tags under the keys the generated table gives the
role type, through IamConditionContextResolver.resourceTagKeys, which
resourceTags now shares.

A resource-tag key the generated IAM condition-key table does not read for
the action being checked is left out of its context
(IamConditionContextResolver.resourceTags(action, resource), from
IamConditionKeys.unreadTagPrefixes): the table reads none for iam:PassRole,
AWS warning that ResourceTag conditions with PassRole "do not have reliable
results", so a PassRole check still sees no role tags.
2026-11-25 18:46:34 -04:00
Priamo Germosen c9a4443f50 feat(iam): read Transfer Family from the generated tables (#9420)
Move `transfer` from NOT_COVERED to NAMESPACES in
regen_iam_request_resources.py, so Transfer Family requests are checked on
the resources they name instead of `*`: a server by its ServerId, as
server/<id>, and a user by its ServerId and UserName, as
user/<server-id>/<name>, the ARNs the service mints, and a tag call on its
Arn. No other namespace's rows change.

The resource a create makes now leaves open a variable its response
answers when its request carries no member of that name, an id the service
mints: ImportCertificate's certificate took its CertificateId from the
certificate body it imports, and ImportHostKey's host key its HostKeyId
from the key body. Across the table only those two rows change.
2026-11-25 07:24:59 -04:00