Commit Graph
185 Commits
Author SHA1 Message Date
David 2fe25793c8 fix(iam): check Security Hub and GuardDuty routes under enforcement (#7874)
Neither REST model was vendored in rest-routes.json and no rule mapped
their routes, so under enforcement every Security Hub and GuardDuty
request resolved to no action and was let through: a user with no
policies could EnableSecurityHub or ListDetectors.

- regen_rest_routes.MODELS reads securityhub and guardduty;
  rest-routes.json takes their routes from botocore 1.43.118, and
  iam-authorized-actions.json their actions of no resource type
  (securityhub 31, guardduty 70). Nothing else changed.
- Both move from NOT_COVERED to NAMESPACES in the table of request
  resources: 228 operations, 3350 over 46 namespaces, no other entry
  changed. Security Hub's hub actions are checked on the caller's hub
  in the Region, hub/default, the ARN Security Hub gives it, and
  GuardDuty's detector and publishing destination operations on the
  detector their path names.
- The generator gains a rule: an optional top-level member holding the
  ARN of a type whose format has no variable of its own also names
  that type when the request leaves it out. DescribeHub with no HubArn
  is so checked on hub/default, as AWS checks it, rather than on *,
  which would refuse a grant scoped to the hub. The rule changes no
  other operation.
- Both move to NAMESPACES in the tag-on-create table too: an
  EnableSecurityHub carrying tags also needs securityhub:TagResource on
  the hub, a GuardDuty create carrying tags guardduty:TagResource, and
  the create is checked with aws:RequestTag and aws:TagKeys.

Regenerated from the Service Reference retrieved 2026-11-11. It now
also gives two Lake Formation operations, GetGlueFunctionSessionContext
and GetTemporaryGlueFunctionCredentials, checked as
lakeformation:GetDataAccess; they are left to the next sync, which
--verify reports without failing. Macie is read by #7869.

IamRestRouteEnforcementIntegrationTest checks both services: a caller
with no grant refused, a grant scoped to the hub or detector let
through, another Region's hub and another detector refused, and a deny
holding under an allow on everything. IamTagOnCreateEnforcementIntegrationTest
checks a hub enabled and a detector created with tags: TagResource
needed, a request tag condition applied, and an untagged create
needing its own action alone. All four fail on main. iam.md says so.

Closes #7830
2026-11-11 15:01:28 -04:00
Priamo Germosen d250eb276e fix(s3): refuse an unserved sub-resource and keep a key's own slashes (#8019)
A bucket request that names a sub-resource Floci does not serve fell through
to the bucket's own operation: DELETE ?metadataConfiguration and
?metadataTable deleted an empty bucket, GET ?abac and ?metadataTable listed
it, PUT ?abac created a bucket that did not exist, and HEAD ?acl ran
HeadBucket. The same happened to a sub-resource sent with a method AWS defines
none for, such as DELETE ?versioning. A POST naming one got a 400 asking for
?delete, and no IAM check at all.

The bucket handlers, HEAD and POST among them, now refuse such a request
where they would have run the bucket's operation. A sub-resource the AWS model
defines for the method is answered 501 NotImplemented, and one it defines for
other methods only 405 MethodNotAllowed, as DELETE ?accelerate already was.
A browser-form upload and DeleteObjects still run first on a POST. The
sub-resources are read from botocore's S3 model in the vendored
rest-routes.json, so one AWS adds is refused once the table is regenerated,
not run as the bucket, and their names from the parsed query parameters, so
an escaped & inside a value, ?prefix=reports%26abac, names none. The IAM
check matches: an unserved sub-resource is checked as the action the Service
Reference gives the operation it names (DELETE ?metadataTable needs
s3:DeleteBucketMetadataTableConfiguration, not s3:DeleteBucket, and
POST ?metadataTable s3:CreateBucketMetadataTableConfiguration), which lets
the route coverage test drop the two operations it exempted.

A key made only of slashes was read as the bucket too: JAX-RS collapses
PUT /bucket// to the bucket's path, so it ran CreateBucket and was checked as
s3:CreateBucket, where it writes the key "/". A filter now escapes such a
key's slashes in the path the router matches, path-style and virtual-hosted,
so S3 and the IAM check both act on the object, arn:aws:s3:::bucket//. One
trailing slash, /bucket/, is still the bucket.

The resource ARN a request is checked against read the same collapsed path,
which named another object whenever a key carried a slash of its own.
PUT /bucket//email.txt stores the key "/email.txt" and the controller and the
condition resolver both read it that way, from the path as it arrived, while
the ARN came out as arn:aws:s3:::bucket/email.txt: a grant on that object
covered this one, and a statement naming bucket//* matched nothing it names.
A key with a double slash inside it, a//b.txt, was checked as a/b.txt the
same way. The ARN is now built from the key those two already read, through
one reader the three share, so the object stored, the object a condition
describes and the object a policy is matched against are the same one. An S3
Control operation, told apart by the operation as before and not by its path,
names no object and is left as it was: the ARN in its path is still taken as
written.
2026-11-11 10:53:14 -06:00
Jimmy Liu Jia d0d0e0eef8 fix(codedeploy): preserve deployment group creation tags (#8025) 2026-11-11 11:08:16 -04:00
Priamo Germosen dfec9737a6 feat(iam): check Lake Formation, Macie and Inspector by their REST routes (#7869)
Under enforcement a REST route no rule maps and no vendored model names
runs unchecked. Lake Formation, Macie and Inspector were among those:
of their 33 served routes only Inspector's Disable had a rule, added by
hand. AWS's Service Reference gives 32 of those 33 actions no resource
type, so each is authorized on "*", which is what the route join added
in #7461 already checks when the model is vendored.

Vendors the three models, so all 33 are checked as their operation's
action. A caller holding no grant for them is now refused where the
request used to pass; that is the behaviour change.

The 33rd is Macie's CreateMember, on the POST /members it shares with
Security Hub, which AWS authorizes on the member it makes and with the
tags it carries. A correction fills the member from account.accountId,
so a grant or a deny scoped to one member holds, and Macie joins the
tag-on-create table, so a request with tags needs macie2:TagResource
and its tags are what aws:RequestTag and aws:TagKeys see.

Inspector's Disable rule goes, since the vendored route gives the same
action. Macie and Inspector move into the table of request resources,
their reason for staying out (no model vendored) no longer being true.
Lake Formation has no resource type at all, so that table does not
list it.

Regenerating the tables also brings in es:UpdateClone, which AWS has
added since. Floci does not serve it.
2026-11-10 22:47:39 -06:00
Priamo Germosen 0197723641 fix(iam): simulate a principal without the policies the request excludes (#7865)
`SimulatePrincipalPolicy`'s `PolicyExclusionList` was read by nothing, so a caller
excluding a policy was given a simulation that still counted it, which is the
decision it had asked not to be given. The member is read now: each
`PolicyIdentifier` drops a policy from the set this one simulation evaluates and
from nothing else, the attachment and every listing left as they were.

The reference states both answers an entry gets, and those are the answers here:
"Syntactically invalid identifiers, such as malformed ARNs or wildcards in
disallowed positions, cause the request to fail with an InvalidInput error.
Syntactically valid identifiers that don't match any attached policy are
ignored." The constraints ahead of the operation already hold each member of an
entry to the shape the model declares, so an unknown `PolicyType` is the
`ValidationError` it always was; what the vendored data does not carry is the
union marker, so the rule that an entry names exactly one of the three is held
where the entry is read.

A `PolicyArn` is held to the one position the member admits a wildcard in, the
resource name, so a wildcard in the resource type an ARN carries ahead of it is
refused rather than matched: a `poli?y/reader` reads like the `policy/reader` it
would reach. It is held to carrying the fields every ARN carries too, its
partition, its service and its resource, a blank one being a malformed ARN rather
than an identifier that matches nothing. The region and the account are not among
those, an AWS managed policy carrying no region.

`PolicyType` reads as the part a policy plays rather than the kind of document it
is, which is what keeps `permission-boundary` in a value set beside
`user-managed`: a boundary is itself a customer managed policy, so a type meaning
the kind would match it twice. `scp` matches nothing, this simulation carrying no
SCP ceiling, and `rcp` is published as ignored. An ARN names the policy itself,
so it reaches that policy in whatever part it plays, the boundary included. The
account-level grant an account password policy carries is attached to nothing and
reached by nothing.

The wording of the two refusals no source gives, and the reading of a wildcard in
`AttachmentName`, which the member documents and its own declared pattern admits
no character for, are recorded under Policy Simulation in docs/services/iam.md.
2026-11-10 22:31:21 -06:00
Priamo Germosen 90a4455905 chore(iam): sync the tag-on-create table with what AWS has added (#7852)
make iam-tag-on-create-sync has failed since AWS listed three more
operations with a tagging action, because the generator found no request
member carrying tags on any of them and asks for a reason.

SSM's StartExecutionPreview has no such member at any depth, so it is
not read for that reason. Athena's CreateSystemTableConfiguration and
SageMaker's CreateClusterExtension do take Tags, but the pinned botocore
predates both, so their requests cannot be read yet. They get a reason
of their own, which the generator refuses once the pinned botocore has
the operation, so a bump cannot leave their tags unread. Floci serves
none of the three.

The sync also lists the new applicationinsights namespace, and iam.md's
count of operations read with their tags follows the table.
2026-11-10 06:37:23 -06:00
Priamo Germosen 69da60d07f docs(iam): settle a distribution's IAM certificate on what AWS publishes (#7740)
CloudFront resolves ViewerCertificate.IAMCertificateId by id alone, and two
questions about that have sat open. A server certificate meant for CloudFront
must be uploaded under /cloudfront, which nothing here enforces, and a blank
value is read as naming no certificate at all.

The blank is settled by AWS's own text, twice over. The member is declared with
a minimum length of 0, so an empty string breaks no bound it carries, and the
ViewerCertificate entry tells a caller on the CloudFront domain name to set
CloudFrontDefaultCertificate and leave all other fields empty. An element left
empty arrives as a blank on this REST XML protocol, so reading it as an id
would refuse the very request the reference asks for.

The path is a published obligation on the caller, in IAM's
UploadServerCertificate note and again in CloudFront's own procedure for
uploading a third-party certificate to IAM, and this emulator does not hold
callers to it. That is a deliberate divergence rather than a reading of what
AWS accepts. What is published is the obligation on the upload rather than a
refusal on the write: the Developer Guide's InvalidViewerCertificate page
enumerates what CloudFront verifies when an alternate domain name is added, in
the order it verifies them, and the certificate's path is not among those
checks. Holding a distribution to the path would refuse a write on a rule
published for the upload, so the id alone decides until something records
otherwise, and a capture of such a refusal moves the reader, the page and the
test.

The reasoning lives in docs/services/iam.md, with the CloudFront page and the
reader's javadoc pointing at it, and two tests pin what each case does: a
distribution created through the API with an empty IAMCertificateId element is
accepted and holds no certificate, and a certificate uploaded outside
/cloudfront serves a distribution and cannot be deleted while it does.
2026-11-09 16:50:23 -06:00
Priamo Germosen 16ce8261eb fix(iam): check an object's tags apart from its members on create (#7739)
The tag-on-create check reads a body's tags under any spelling a handler
might read, so that no tag a handler applies goes unchecked. An object at
the tags member was read both ways into one set: its structures as tags
and its members as a map's tags. A member named as a structure's key then
replaced that structure's tag, so KMS's CreateKey with
{"Tags":{"team":{"TagKey":"team","TagValue":"red"}}} was checked as
team="" while its handler, which iterates Tags whatever it holds, stored
team=red: a deny on aws:RequestTag/team held on neither kms:CreateKey nor
kms:TagResource.

The two readings are now sets of their own, each checked, so the tag the
handler applies is checked whatever the members are named.

OpenSearch's creates refuse such an object as a TagList, but a deny on a
tag in its structure now refuses it first, as it does a list.
2026-11-09 16:50:11 -06:00
luiseterc 3c398103ed fix(iam): resolve missing roles and EC2 tagging targets (#7596) 2026-11-09 18:28:31 -04:00
Priamo Germosen ee2cdfc4f8 docs(iam): close the service principal's comma on what AWS publishes (#7617)
`CreateServiceLinkedRole`'s AWSServiceName was left with one question open.
The capture on #6042 quotes [\w+=.@-]* for it, without the comma the
vendored shape admits, and nothing recorded said whether AWS takes a comma
or refuses one, so the shape kept the model's pattern and the message the
captured text.

AWS's own API Reference entry for the operation answers the part that
matters. It gives the member a minimum length of 1 and the pattern
[\w+=,.@-]+, the comma included, which is what botocore declares for the
shape it aliases the member to as well. The comma is therefore what AWS
documents for this member rather than something that aliasing brought
along, the captured message is the only source that drops it, and a message
answers for the text a violation carries rather than for what a value is
held to. So what a principal is held to stays the published pattern and
nothing moves about what this service admits. The minimum is published
there too, which is why an empty principal stays refused for a reason of
AWS's own rather than the model's alone.

What is left is a reading worth pinning rather than inferred again: a
principal carrying a comma clears the shape and reaches the lookup, where a
service no recording covers has its role name derived from the principal's
labels, the answer any unrecorded principal gets. That reasoning lives in the
docs page alone, with the generator's comment and the test's javadoc pointing
at it, and a capture of AWS refusing a comma as a pattern violation moves the
quoted-pattern entry, the shapes file a regeneration writes from it, and that
test.
2026-11-06 23:02:22 -06:00
Priamo Germosen 6110825561 fix(iam): check the tags an OpenSearch domain is created with (#7616)
OpenSearch's CreateDomain and the legacy CreateElasticsearchDomain store
the TagList they carry, but the tag-on-create table did not read the
`es` namespace, so under IAM enforcement a caller allowed to create a
domain could tag it with no es:AddTags, and a policy allowing the create
only with some tag did not hold. The reason the generator gave, that no
rule maps its REST routes, has not been true since they were vendored.

`es` moves to the generator's namespaces. The Service Reference lists
OpenSearch Service's operations for the `es` client alone, so, as the
request-resources generator does, an operation of a vendored REST model
it lists for no client is read as the action of its own name: it needs
the tagging actions of the operations the reference lists that action
for, and is checked with the request's tags when that action takes
them. The `opensearch` client's CreateDomain is es:CreateDomain, which
the reference lists for CreateElasticsearchDomain beside es:AddTags, as
the OpenSearch Service developer guide's policy for creating a domain
only with a tag grants es:CreateDomain and es:AddTags. Both creates now
need es:AddTags on the domain they name, and are checked with the tags
as aws:RequestTag/<key> and aws:TagKeys (587 operations over 72
namespaces, no other entry changed).

The handler also read a TagList the model does not allow, and not as the
check reads it: a tag with no value was dropped, though the check lets it
replace an earlier tag of its key, and an object's structures were tags,
though the check lets a member of the same name replace them. Either got
a denied tag past a deny on it. The model requires a list of tags, each
with a Key of 1 to 128 characters and a Value of up to 256, so CreateDomain
and AddTags now refuse anything else with a ValidationException, before
changing anything, and the tags checked are the tags a domain gets.
2026-11-06 23:02:09 -06:00
luiseterc 1ce40a1c79 fix(iam): populate stored caller principal tags (#7591) 2026-11-06 19:14:20 -04:00
luiseterc c3058a8de4 fix(iam): generate resource and request tag condition context (#7589) 2026-11-06 09:02:14 -04:00
Hector Ventura b1ba11c61e feat(stepfunctions): evaluate the execution role on SNS and EventBridge tasks (#7622) 2026-11-06 08:34:39 -04:00
Aymen JAMAAOUI 5bcb83b932 fix(iam): check Redshift requests on the resources they name (#7287)
Under IAM enforcement, Redshift requests were checked on `*`, so a
grant scoped to a cluster, a snapshot or a database user was refused,
and a deny scoped to one never applied.

The redshift namespace moves from NOT_COVERED to NAMESPACES in the
request resources generator, with corrections where the generated rule
checks the wrong resource. GetClusterCredentials now also gives the
redshift:DbUser condition key, from a new generated table, to its own
check and to the CreateClusterUser check that AutoCreate adds.

Refs #5907

fix(redshift): act only on a snapshot of the cluster the request names

A snapshot request is checked on snapshot:<cluster>/<name> for the
cluster it names, but DeleteClusterSnapshot, RestoreFromClusterSnapshot
and DescribeClusterSnapshots found the snapshot by its name alone. A
caller allowed on one cluster's snapshots could act on a snapshot of
another cluster by naming the allowed one.

A snapshot taken from another cluster than the one the request names,
in SnapshotClusterIdentifier, the cluster of a SnapshotArn, or
DescribeClusterSnapshots' ClusterIdentifier, is now not found.

Refs #5907

chore(iam): generate the Lambda Web and Redshift condition keys into one table

chore(redshift): read a restore's snapshot ARN once
2026-11-05 11:57:59 -04:00
Priamo Germosen 0f6d23c917 chore(iam): clean up the users a list test leaves and record whose reading the gap is (#7568)
Two follow-ups from the change that read every Query list off the indices a request numbers.

The tests holding that reading create a user each and deleted none of them. The emulator is shared
between test classes, so those users outlive the class that made them and the next class to list
users unscoped reads them. The provider the same class creates is registered with the cleanup
extension already, which the class holds for exactly this, so each user is registered beside it.

The reading itself is recorded as this service's own. Nothing published says AWS takes a gap in a
numbered list, and no SDK sends one: botocore's Query serializer numbers a list from 1 with no gap
in it, so a request carrying one is written by hand. What is recorded is that the constraints ahead
of each operation read every index a request names, which is the disagreement that change closed,
so a gap is read the way the constraint walk already read it until a capture says otherwise. The
account properties map says the same of its own entries.

Nothing under src/main changes.
2026-11-04 21:50:59 -06:00
Priamo Germosen a64fa37cd7 feat(iam): read IAM Access Analyzer's request resources (#7567)
Access Analyzer's routes are vendored, but the table of request
resources did not read the namespace, so a route of an action AWS
checks on an analyzer, GetAnalyzer, CreateAnalyzer and DeleteAnalyzer
among the ones Floci serves, was left unchecked under enforcement: a
caller with no grant on the analyzer was let through and a deny on it
never applied.

- access-analyzer moves from NOT_COVERED to NAMESPACES: 39 operations,
  1544 over 35 namespaces, no other entry changed. An analyzer is read
  as analyzer/<analyzerName> from the path or the body, the ARN Floci
  mints, an archive rule as analyzer/<analyzerName>/archive-rule/<ruleName>,
  and the operations naming an analyzer by its ARN, in the body or the
  query, on that ARN.
- With every operation of the scope in the table, the routes check
  each by the resources-read half of the join rule. No vendored route
  is left unchecked: every routed scope is read, built by hand, or of
  an action of no resource type.
- The REST reason of the namespaces not read yet no longer says the
  path is not read: RequestResources reads it from the vendored routes,
  which do not have those namespaces' models yet.
- access-analyzer is read by the tag-on-create table too, so a
  CreateAnalyzer carrying tags also needs access-analyzer:TagResource
  on the analyzer it names, and its own action is checked with them as
  aws:RequestTag and aws:TagKeys, as the Service Reference lists. The
  regeneration also takes Config's PutServiceLinkedConfigurationRecorder,
  which the reference has listed with config:TagResource since the last
  sync; Floci does not serve it.

IamRestRouteEnforcementIntegrationTest creates an analyzer and checks
GetAnalyzer, CreateAnalyzer and DeleteAnalyzer on the ARN Access
Analyzer gives it, a grant scoped to it, another analyzer refused and
a deny holding; the vendored-route test's unchecked example is gone.
IamActionRegistryTest checks the analyzer routes and keeps an unread
example on a fixture (Backup's GetBackupPlan); RequestResourcesTest
reads an analyzer from a path label and a body and an archive rule from
both; IamRestRouteCoverageTest pins the five operations Floci serves;
IamTagOnCreateEnforcementIntegrationTest checks a tagged CreateAnalyzer
needs TagResource on its analyzer and meets a request-tag condition,
and an untagged one CreateAnalyzer alone.
iam.md and access-analyzer.md say so.
2026-11-04 21:50:47 -06:00
Priamo Germosen 4abccec0c8 fix(iam): read every Query list and map off the indices the request numbers (#7547)
The Query protocol numbers a list's members rather than ordering them, and the constraint walk
reads every index a request names. The handler read a run from 1 that stopped at the first gap, so
the two halves disagreed about what a request carried: a request numbering tags 1 and 3 was held to
both tags and then stored the first alone, and a simulator whose first action is numbered 2 answered
`At least one ActionNames member is required.` for a list that had a member in it.

Every list and map `IamQueryHandler` reads now goes through `AwsQueryLists.members`, the same call
with the same arguments the constraints read them with: tags and tag keys with the count each is
held to, the two generic value readers, which had the same body once both read indices and are one
reader now, the context entries at both of their levels, and the `Properties` map of
`PutAccountProperties`. The last site was the reader a delegation request's policy parameters had to
themselves, which read its indices but only in the generic spelling: those parameters take the bare
form with it, and the handler reads a list in one place rather than three.

A member numbered only under a deeper key carries no value of its own and is no member of a list of
values, and a tag or a property numbered with a value and no key is nothing a map could hold, so
neither is counted nor stored.

The tags a create is authorized with are read the same way. `TagOnCreate` says how each Query
handler numbers a create's tag list, so the policy is checked with the tags the resource will get,
and it had IAM reading `Tags.member` to the first gap, as this handler did. On its own this change
would have left the authorizer reading a different list than the one stored: a tag numbered only at
2 met no policy requiring it, the model saying the handler applies none, and tags split across the
two spellings were a set each, where a deny naming both keys matched neither.

IAM reads there by the rule the handler reads by, rather than by a copy of it: the member comes from
the generated tag-on-create table and the spellings from `AwsQueryLists.memberKeys`, so no spelling
is written twice and a later change to that rule moves both sides at once. The handlers that number
a list their own way keep their own readings, untouched.

Seventeen wire tests over four classes, one for each reader, one for each spelling it missed, and
three holding the authorization. The provider one deletes what it creates: the emulator is shared
between test classes, so the next class to list providers unscoped would read it. Fifteen of them fail against the readings this replaces. The
reading is recorded in `docs/services/iam.md`, in the list section and beside the account properties
map.
2026-11-04 17:10:00 -06:00
Priamo Germosen 26cd74e6f8 fix(iam): read a REST request's path and query members under a form too (#7527)
A member the table locates in a REST request's path or query was laid
over a JSON body alone: a request sending a form skipped the overlay,
so a form's DomainName was read in place of the path's. OpenSearch
answers a form with 415, so no such request reaches its handlers
today, but the next REST namespace the table reads whose handler does
not refuse a form would be checked on the form's name while it acts on
the path's.

RequestResources now lays the located members over a form as it lays
them over a JSON body, for the resources a request names and for those
it creates: each is dropped from the form and read from the path or
the query alone.

RequestResourceMembersTest checks every resource of the table from a
form as from a JSON body, each located member given in the path or the
query and another value in the body and in the form; RequestResourcesTest
sends OpenSearch requests as forms naming another domain than the path
or the query does. iam.md says so.
2026-11-04 17:09:37 -06:00
Priamo Germosen 9062572948 feat(iam): read a REST request's resources from its path and query (#7499)
The table of request resources read only a request's body or Query
form, so no REST namespace was read: a REST request names its
resources in its path and its query. An OpenSearch Service request
naming its domain, DescribeDomain on
/2021-01-01/opensearch/domain/{DomainName}, was left unchecked by the
routes the previous change reads, as Floci could not check it on the
domain AWS checks it on.

- The generator reads a rest-json request's members in its path and
  its query as members, under their botocore names, and records where
  each one a resource reads is (`located`): a path label, `{Label}`, or
  a query parameter, `?name`. RequestResources lays them over the body,
  a label's value from the route the request matched in the vendored
  routes (IamActionRegistry.pathLabels, IamRestRoutes now capturing
  each label), a query parameter's from the query, so every kind of
  resource reads them as it reads the body's. A located member is read
  from where it is alone, as its handler reads it: one the body also
  gives is dropped.
- A namespace read this way also takes the operations of each botocore
  model Floci reads routes for under it (regen_rest_routes.MODELS) that
  the reference lists for none of its clients, each the action of its
  own name with that action's resource types, when the reference has
  that action: the reference lists OpenSearch Service's `es` client
  alone, while the `opensearch` client's operations are named after
  `es` actions. --verify checks such an operation's action and types
  against the reference's Actions, and reports one whose action AWS no
  longer has.
- `es` moves from NOT_COVERED to NAMESPACES: 120 operations, both API
  versions', 1505 over 34 namespaces. Every domain route Floci serves
  reads its domain, from the path, the body or `?arn`, on
  `domain/<DomainName>`, the ARN Floci mints. Those whose resource the
  table does not find (outbound connections, applications, insights)
  are routes Floci does not serve.
- Reading rest-json would also have read the Payment Cryptography data
  plane's key from its path; Floci serves only the control plane, so
  `payment-cryptography-data` joins CLIENTS_NOT_READ with its reason
  and its operations stay as they were. No other entry changes.

With the domain operations in the table, the routes check them by the
resources-read half of the join rule. IamActionRegistryTest checks the
domain routes and the labels a request's path gives;
RequestResourcesTest reads a path label, a query parameter and a body
together; IamRestRouteEnforcementIntegrationTest checks DescribeDomain,
DescribeElasticsearchDomain and ListTags on the domain they name; the
generator tests cover the located members, a member two clients locate
apart, the REST models' operations and a round trip through --check and
--verify. iam.md says so.
2026-11-04 08:05:50 -06:00
Priamo Germosen 27057e2c00 fix(ssoadmin): provision to all accounts only those the check covered (#7463)
Under IAM enforcement, a ProvisionPermissionSet for
ALL_PROVISIONED_ACCOUNTS is checked on each account the permission set
is provisioned to, which the permission check finds through
SsoAdminService.through. The handler then found those accounts again
and provisioned to each. Another request could provision the permission
set to one more account in between, with an account assignment of its
own, and a permission set change could leave that account
LATEST_PERMISSION_SET_NOT_PROVISIONED: this request then provisioned it
again, changing the account's state with no policy checked against it.

The accounts are now found once for the request and kept, in a
request-scoped SsoAdminRequestContext, as PaymentCryptographyRequestContext
keeps the key an alias named: the check and the provisioning use the
same accounts, and an account provisioned to since is left as the other
request left it. Each request finds them afresh, so the next one is
checked on it.

SsoAdminServiceTest replays the race: the check finds one account,
another account is assigned and a policy attached, and the provisioning
leaves the second account not provisioned. The IAM integration test
assigns a third account after a request was let through on two, and the
same grant no longer covers the next request. iam.md says so.
2026-11-03 23:18:56 -06:00
Priamo Germosen 251bb39375 feat(iam): check REST routes no rule maps by botocore's models (#7461)
A REST request gets its IAM action from IamActionRegistry's
hand-written rules, and a route no rule maps gets none, which the
caller allows: under enforcement such a request runs unchecked.
IamRestRoutes (#7085) reads botocore's routes at runtime, but only for
the operations a hand-written list enrolls, ValidatePolicy alone, and
only by literal paths.

A request no rule maps is now the operation whose route in botocore's
model it matches, and it is checked as that operation's action
(IamAuthorizedActions), as a Query or JSON request naming its
operation is, when Floci checks it on the resources AWS does: those
its request names, which ResourceArnBuilder builds for its namespace
or the vendored request resources read for the operation, or none,
when the Service Reference gives the action no resource type, as AWS
authorizes such an action on `*`. An action AWS checks on a resource
Floci neither builds nor reads stays unchecked, as before: checked on
`*`, a grant scoped to its resource would be refused. That is the
reason #7085 gave for enrolling ValidatePolicy alone, now read from
generated data instead of a list.

- The actions of no resource type come from the Service Reference's
  Actions, through regen_iam_authorized_actions.py, into
  iam-authorized-actions.json, for each credential scope whose routes
  rest-routes.json reads: 88 over 7 scopes. They are read from Actions,
  not Operations, because the reference lists one SDK client's
  operations per namespace, OpenSearch's `es` client alone. --check
  fails until a scope rest-routes.json adds is listed, and --verify
  fails when AWS gives a listed action a resource type.
- IamRestRoutes now matches every route of a model: literal segments,
  a label taking one segment, a greedy label the rest of the path, and
  the query a route names, which must be on the request. Of the routes
  a request matches, the most specific wins, segment by segment from
  the left a literal, then a segment mixing a literal and a label, then
  a label, then a greedy label; then the route naming more of the
  query. The path is the one the rules match, still percent-encoded and
  without a trailing slash, and a segment may still end in a matrix
  parameter, which the router ignores.
- The rules come first, so nothing they map changes. S3 and API Gateway
  are listed as handRouted, with their reasons, and routed by their
  rules alone: S3 tells apart the operations of one route by their
  query and headers, and API Gateway is checked by HTTP method. The
  route generator fails when one route names two operations of any
  other scope.
- OpenSearch Service's models, both API versions, are read under `es`:
  59 of their 147 operations are checked by their routes (29 of the
  `es` model's 51, 30 of the `opensearch` model's 96), 53 of which ran
  unchecked, ListDomainNames and ListVersions among them. The other six
  are the VPC endpoint operations #7351 mapped by hand: their rules are
  removed, as their routes give the same actions.
- Access Analyzer's 9 operations of no resource type are checked by
  their routes, ListAnalyzers among those Floci serves, where
  ValidatePolicy alone was; its analyzer operations are not.

Lambda's, EKS's, Scheduler's, Pipes' and DSQL's resources are built
by hand and their routes all mapped by their rules, so none is checked
differently. IamRestRouteCoverageTest checks every route of a scope
not hand-routed: by the vendored routes alone it is its own operation,
and through the registry it is its action when its resources are built
by hand or read, or its action has no resource type, and unmapped
otherwise.
iam.md and access-analyzer.md say which routes are checked.
2026-11-03 23:18:31 -06:00
Priamo Germosen a90b812cc6 fix(iam): name a map entry's field under .member, as AWS does (#7457)
A violation inside a map entry's structure named the entry and then the
field, replacementValues.Department.values. An AWS-validated recording of
the same protocol writes a segment between the two: SNS answers a missing
DataType inside its MessageAttributes map as

  1 validation error detected: Value null at
  'messageAttributes.attr1.member.dataType' failed to satisfy constraint:
  Member must not be null

and, inside a list's member,
publishBatchRequestEntries.1.member.messageAttributes.attr1.member.dataType.
So a map of structures is named the way a list of structures already is
here, the entry's key standing where a list's index stands, and the walk
now writes replacementValues.Department.member.values. AcquireRole is the
one operation that reaches it, its ReplacementValues being the only
structure-valued map these two services vendor.

What stays is the scalar-valued map. Nothing recorded covers one on this
protocol, and the only recording anywhere, Lambda's
routingConfig.additionalVersionWeights on REST-JSON, answers the map rather
than the entry with "Map value must satisfy constraint: [...]". A different
protocol and a different service is not evidence against the answer this
service already gave, so properties.Team/Owner stays as it is, with what
would move it written down beside it.

The core walk had no test for a structure under a map's key at all, every
case in that file holding a scalar, so one is added there rather than left
to the two IAM wire tests that quote the path.

docs/services/iam.md carries both halves, the recorded one and the open
one. The message's other half, the word null in the value slot, is IAM's
own and does not move: that service leaves it out and this is only the path.
2026-11-03 23:18:09 -06:00
Priamo Germosen 5c303afac6 fix(iam): check four more services on the resources their requests name (#7365)
Under IAM enforcement, DataSync, EMR, Rekognition and IAM Identity
Center requests were checked on `*`, so a grant scoped to a DataSync
agent, an EMR cluster, an Identity Center permission set or a
Rekognition custom model was refused, and a deny scoped to one never
applied.

The generated table of the resources requests name now reads them, 276
operations, from AWS's Service Reference and botocore as it reads the
earlier batches: their namespaces move from the generator's
NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it
edited by hand; 1385 operations over 33 namespaces. Each resource
type Floci serves has the ARN format it mints: DataSync's
`agent/agent-<id>`, `location/loc-<id>` and `task/task-<id>`, EMR's
`cluster/<id>`, and IAM Identity Center's instances and permission
sets, with no Region or account. Of Rekognition, Floci serves the image
analyses alone, which act on no resource but a custom model.

Corrections, each with its reason:

- EMR requests naming a cluster by its job flow id, JobFlowId or
  JobFlowIds (AddInstanceGroups, AddJobFlowSteps, DescribeJobFlows,
  TerminateJobFlows and the four Set operations), are checked on that
  cluster: a job flow's id is the cluster's.
- EMR's AddTags and RemoveTags are checked on the cluster their
  ResourceId names, the one Floci tags, not on the one their ClusterId
  gives, which only scopes a session-scoped resource's tags. Read as
  generated, a ClusterId the grant covers would have let a request tag
  another cluster.
- EMR's ModifyInstanceGroups may leave out its ClusterId ("Required:
  No") and name each instance group by its id alone, which EMR then
  finds the cluster of. Such a request is checked on the cluster each
  group is in, where it was checked on `*`; a null ClusterId is read as
  none, as the handler reads it. An InstanceGroups that is not a list
  names no group to the check, and the handler now refuses it as naming
  none, where it modified the groups an object's values named.
- Rekognition's stream processor operations are checked on
  `streamprocessor/<Name>`: the Developer Guide's example gives a
  processor named streamProcessorForCam the ARN
  `...:streamprocessor/streamProcessorForCam`.
- IAM Identity Center's CreateAccountAssignment,
  DeleteAccountAssignment and ProvisionPermissionSet are also checked on
  the account their TargetId names, `account/<id>`, which the action
  acts on beside the instance and the permission set. A
  ProvisionPermissionSet for ALL_PROVISIONED_ACCOUNTS names no TargetId
  and provisions the permission set to every account it is provisioned
  to (the User Guide: up to 3,500 accounts that way, one with
  AWS_ACCOUNT), so it is checked on each of them, where a grant on the
  instance and the permission set alone let it through. Its TargetId
  names the account only for AWS_ACCOUNT, so a null one with
  ALL_PROVISIONED_ACCOUNTS names none.

The two lookups are the existing `through` entries, which named the
cluster or workgroup a Redshift Data session runs on: one may now read
each value of a list's field, and apply only `when` the request names
its resource no other way. StoredResourceArns.through gives a list of
ARNs, which EmrService and SsoAdminService now answer from what they
store, EmrService under the lock its handlers change clusters under.

Fixes the new formats needed:

- DataSync's ARN formats, and IAM Identity Center's applications' and
  trusted token issuers', name their account `${AccountId}` where every
  other format has `${Account}`. The generator now reads that slot as
  `${Account}`, so the caller's account fills it; a new Identity Center
  application was otherwise checked on `arn:aws:sso::*:application/*/*`,
  which no account-scoped grant matches.
- Identity Center's application providers are AWS's own,
  `arn:aws:sso::aws:applicationProvider/<id>`. An ARN of a type whose
  format fixes the account as `aws` is now checked in that account
  alone, not also as the caller's own copy, which does not exist and
  which a grant on the provider did not cover. An ARN of any other type
  giving the account `aws` is still checked as the caller's too.
- A permission set, an application or a trusted token issuer an
  Identity Center create makes is in the instance its InstanceArn
  names, whose id its ARN carries, `permissionSet/<instance id>/<id>`.
  It was checked with both ids open, which no grant scoped to an
  instance's permission sets matched. The generator now fills a variable
  no member fills from the ARN of another type the action acts on whose
  format is that variable alone, given by the ARN member named after it.

Left as generated, on `*`: Rekognition's CreateStreamProcessor and
StartMediaAnalysisJob, which name their collection or model two
structures deep, where the table reads none, and which Floci does not
serve.

Elastic Beanstalk and Redshift Serverless, which have as few resource
types, stay unread, each with its reason: an environment's ARN carries
an application name its requests do not give, and Redshift Serverless'
ARNs end in ids its requests name by name, so both need the stored
ARNs found first.

iam.md lists the four services, and AWS Payment Cryptography, which
the table already read, and gives the corrections, the rule for an
AWS-owned resource's ARN, and the cluster, accounts and instance the
lookups and the creates are checked on.
2026-11-03 17:14:32 -06:00
Priamo Germosen 96fafbd4dc fix(iam): answer three refusals with their captured codes (#7364)
Captures from a real account on issue 6042 answer three refusals this
emulator had written for itself, each wrong in its code or its status
rather than only in its wording.

ChangePassword answered InvalidParameterValue 400 naming the user for a
wrong old password. AWS answers AccessDenied 403 and "Either the new
password does not conform to the account password policy or the old
password was incorrect.", which is now what it sends, as captured. The
sentence names both of the operation's causes without saying which one
refused the call, so a caller who cannot prove the current password
learns nothing about the policy either.

That it names the policy half does not settle the policy half. The
capture covers a wrong old password with a conforming new one, nothing
records AWS answering it for a password the policy refuses, and the
model declares PasswordPolicyViolation on this operation for exactly
that case, so a new password the account policy refuses keeps that error
and the rule it names, as it does on CreateLoginProfile and
UpdateLoginProfile. The old password is still read first, so a request
with both halves wrong answers the capture.

PolicySourceArn on SimulatePrincipalPolicy and
GetContextKeysForPrincipalPolicy resolved an entity out of whatever
followed the last slash, so arn:aws:iam:user/bob simulated as the user
bob. It is now held to AwsArnUtils.isArn before either simulator
resolves it, answering InvalidInput "Invalid ARN provided in the
request: <value>". A valid ARN that names neither a user nor a role
still answers the entity-type refusal it answered before.

GetAccessKeyInfo answered InvalidParameterValue quoting an id the
account never issued. AWS answers ValidationError "Access key ID is not
valid.", for an AKIA and an ASIA id alike, which also settles that it
refuses such an id rather than decoding the account out of it.

The wire and unit tests pin the two halves of the password refusal
answering differently and the order they are read in, both simulators
against three unparseable values and a well-formed one, and the key
refusal over both id formats. One enforcement test had pinned the
unparseable ARN resolving, which the capture overturns.
docs/services/iam.md and docs/services/sts.md carry the three answers,
what each capture covers, and what it leaves open.

Three comments that described these answers before the captures are
corrected with them: handleGetAccessKeyInfo's Javadoc, which still
called its old refusal a documented deviation,
StsAccessKeyInfoIntegrationTest's class comment, which said the same,
and validatedPolicySourceArn's, which said a value clearing 20
characters and parsing as no ARN is left alone and that what AWS answers
for one is not recorded.
2026-11-03 17:14:20 -06:00
Priamo Germosen 0e9f3402f2 docs(iam): name the one omitted member the capture covers (#7331)
docs/services/iam.md and IamValidationErrors read as if the capture that
moved IAM's required-member message settled it for every member. It settled
one: an omitted Status, answered from a real account on 2026-10-31 as "Value
at 'status' failed to satisfy constraint: Member must not be null" against
the shape the four credential operations share.

Every other omitted member this service answers, the sites checked by hand
and each required member the model walk reads, carries that form on this
service's reading rather than on a recording: the word null was never a
value AWS sent, an absent member having none to carry. The doc separates the
two and keeps that reasoning, IamValidationErrors says the capture covers
Status alone where the form is decided, and the account-properties test,
which quoted the Status capture beside an assertion on an omitted properties
map, says the reading is what carries over there.

Prose and comments only, no behavior change. Follow-up to #7265.
2026-11-02 17:31:36 -06:00
Priamo Germosen e1392c8ce9 docs(redshift-data): say a session statement's IAM target is inferred (#7330)
Follow-up to #7300. redshift-data.md and iam.md said a Redshift Data
ExecuteStatement or BatchExecuteStatement naming its SessionId is
checked on the cluster or workgroup the caller's session runs on, as if
AWS stated it. No AWS page says which resource such a request is
authorized on, so both now say the session's target is Floci's
inference: a session runs on the cluster or workgroup named by the
statement that opened it.
2026-11-02 17:31:24 -06:00
Charles Swanberg fccc81b61d fix(s3): place the encryption condition keys on a put, and on a part from its upload (#7050)
* fix(s3): place the encryption condition keys on a put, and on a part from its upload

A policy on s3:x-amz-server-side-encryption or
s3:x-amz-server-side-encryption-aws-kms-key-id read neither key, so a Deny under a
negated operator refused every put, encrypted or not.

A PutObject, CopyObject or CreateMultipartUpload now carries both from its headers, each
value as sent, in the enforcement filter and in S3's own bucket policy check. A part or a
completion sends neither header and carries what its upload recorded when it was created.
A part naming an upload not held answers NoSuchUpload, as S3 does under such a policy.

* fix(s3): check as an object write a PUT or POST naming an upload but not routed as a part

The enforcement filter let through a request naming an upload not held, and judged one
naming a held upload by that upload's encryption, on uploadId alone. A PUT with no
partNumber, or a POST asking for a new upload, creates an object or an upload whatever
that parameter says, so it skipped IAM or read the wrong encryption. Both now match the
routes S3Controller takes as a part or a completion. A part copy naming an upload not held
stays checked, since it names a source.

* test(s3): put the multipart encryption cases beside kmsOnlyBucket

The multipart cases copied S3BucketPolicyEnforcementIntegrationTest's two-statement KMS-only policy
and BUCKET_KEY. They now sit beside kmsOnlyBucket and reuse it, with the policy written once
(putKmsOnlyPolicy). The two cases whose upload is opened before the policy stands use a bucket with
no default encryption, as before: S3 records the bucket's default on an upload that asks for none,
where Floci records only what the request asks for.
2026-11-02 14:46:31 -04:00
Priamo Germosen c84e9249c9 fix(iam): check a Redshift Data statement in a session on the target the session runs on (#7300)
Under IAM enforcement, an ExecuteStatement or BatchExecuteStatement
naming only its SessionId was checked on `*`. A policy allowing one
cluster's or workgroup's ARN let a statement open a session there and
refused the next statement in it, and a deny on that ARN under an
allow on `*` let every statement after the first through.

A session runs on the cluster or serverless workgroup it was opened
on: ListSessions filters sessions "by session status, compute target
(cluster or serverless workgroup), or database", and the SessionId
"can then be used in subsequent ExecuteStatement and
BatchExecuteStatement operations". The Service Reference gives a
session no resource type, so the generator's new THROUGH names the
members a request names a resource through, with the types that
resource may be of: redshift-data:SessionId, on a cluster or a
workgroup. Each operation whose request has the member, and whose
action acts on one of those types, gets a generated
`{"types": [...], "through": "SessionId"}` entry, so there are no hand
corrections. The generator's validation and the Java loader reject a
`through` that is not one top-level member, or that sits beside any
other reading key.

For such an entry the reader asks the namespace's StoredResourceArns
through(member, value, region) for the ARN of the caller's resource
at the other end, and keeps it when it matches one of the types. When
there is none, as for a session that is closed, expired or another
caller's, it names nothing and the request stays on `*`; the Data API
then refuses it. RedshiftDataService now implements StoredResourceArns
for redshift-data, since it owns the sessions and builds their owner
scope: through gives the target ARN of the caller's open session,
through RedshiftDataSessions.targetArn, which find now shares; find
still gives the workgroup a name or an ARN finds, through the
resolver.

ExecuteStatement and BatchExecuteStatement gain the entry (1095
operations over 27 namespaces, unchanged). ListSessions takes a
SessionId too, but the Service Reference gives it no resource type,
so it stays on `*`. iam.md's sentence on EventBridge V2, which said
Floci does not serve it, now says how its requests are read.
2026-11-02 07:53:36 -06:00
Priamo Germosen b4c539d009 fix(iam): read a status and a service principal from the model (#7265)
Two members were held back from the vendored shapes because this service was
read as answering them in a wording of its own. Captures from a real account,
posted on issue #6042, answer both, and neither reading holds.

`statusType` is shared by `UpdateAccessKey`, `UpdateSigningCertificate`,
`UpdateSSHPublicKey` and `UpdateServiceSpecificCredential`. One hand-written
check answered all four, naming neither the offending value nor the permitted
set, which is what a 2025 recording of one of them carries. AWS names the set,
`Member must satisfy enum value set: [Expired, Active, Inactive]`, and answers
an omitted status as the required member it is rather than as a value outside
the set, which one check reading a null as a bad value could not tell apart.
Both are the model's own wording, so all four read it through the Query front
door and the check comes out.

The set is listed in the order AWS lists it, which is not the order botocore
declares. The values are the model's and the generator holds them to it: only
their order is read from the capture.

`AWSServiceName` on `CreateServiceLinkedRole` answered `InvalidInput` with a
sentence about its own bounds, where AWS answers a constraint violation naming
the declared pattern. A principal that satisfies the pattern and names no
service AWS has is still `InvalidInput`, so the layering the capture leaves in
place is the shape first and then whether the service exists.

The required-member message loses the word that stood where the value would
go. IAM names a member and leaves its value out everywhere, and the one
message carrying `Value null at` did so for want of a capture either way; the
capture answers `Value at 'status'`. The form moves in the one object that
decides it, so the eight refusals this package writes by hand move with the
walk, and the services that do quote their values keep the word.

The message quotes the pattern AWS quotes, which is not the one the shape
declares. botocore aliases that member to the shape it gives a group name,
`[\w+=,.@-]+` at 1 to 128 characters, where AWS's message gives
`[\w+=.@-]*`: the comma is gone and a `*` stands where the minimum is 1.
Only the message is in hand rather than the shape, so the generator records
AWS's text beside the model's and one object decides which text any
violation quotes, the way the enum order is read from the capture while the
values stay the model's. A comma is still admitted and an empty principal
still refused, and an empty one now breaks the minimum and the pattern at
once, as every other string member here does. The comma is what a second
capture would settle, and the difference is recorded in
`docs/services/iam.md`.
2026-11-02 07:53:11 -06:00
Priamo Germosen 9bd90d6580 fix(iam): check Redshift Data API requests on the cluster or workgroup they name (#7234)
Under IAM enforcement, Redshift Data API requests were checked on `*`,
so a grant scoped to a cluster or a serverless workgroup was refused
and a deny scoped to one never applied.

The Service Reference gives ExecuteStatement, BatchExecuteStatement,
DescribeTable, ListDatabases, ListSchemas and ListTables two resource
types: Redshift's `cluster:${ClusterName}`, which ClusterIdentifier
fills, and Redshift Serverless's `workgroup/${WorkgroupId}`. A
workgroup's ARN ends in the id Redshift Serverless gives it (its
workgroupId, "The unique identifier of the workgroup"; botocore's
WorkgroupNameString takes an ARN ending in workgroup/<uuid>), while a
request names it by WorkgroupName, "The serverless workgroup name or
Amazon Resource Name (ARN)". So the workgroup is a FOUND_BY type,
found by WorkgroupName.

FOUND_BY named a type by its members only where the rule had derived
a fill for the type to replace, as ResourceId fills a scalable target's
${ResourceId}. No member fills ${WorkgroupId}, so FOUND_BY now names
every FOUND_BY type the action acts on whose members the request has,
as its docstring already said. The Application Auto Scaling entries
are unchanged.

RedshiftDataResourceResolver, which resolves the target a request
runs on, now implements StoredResourceArns for redshift-data: it
gives the ARN of the workgroup a name or an ARN finds, through
RedshiftServerlessService.findWorkgroupByNameOrArn, which the
service's own name-or-ARN lookup now uses as well.

Redshift Data joins the table (12 operations, 1048 over 26
namespaces). The six operations above are checked on the cluster's
ARN or on the stored workgroup's, and on `workgroup/*` for a workgroup
there is none of; their SecretArn names neither. A request naming only
its SessionId stays on `*`, and so do CancelStatement,
DescribeStatement, GetStatementResult, GetStatementResultV2,
ListSessions and ListStatements, which the Service Reference gives no
resource type.
2026-11-01 20:57:48 -06:00
Jimmy Liu Jia 1cbf58a8ae fix(iam): match service-linked role name validation (#7235)
* fix(iam): match service-linked role name validation

Match the recorded AWS ValidationError for malformed AWSServiceName while preserving the documented length and character constraints.

Refs #6042 (item 1)

* fix(iam): align service-linked role validation
2026-11-01 22:24:43 -04:00
Priamo Germosen beef71e8eb fix(iam): check Application Auto Scaling requests on the scalable target they name (#7193)
Under IAM enforcement, Application Auto Scaling requests were checked on
`*`, so a grant scoped to a scalable target was refused and a deny
scoped to one never applied.

A scalable target's ARN ends in a unique id the service assigns,
`scalable-target/<id>` ("The unique ID ... is a value assigned by
Application Auto Scaling to the scalable target"), which the Service
Reference names ${ResourceId}, while requests name the target by
ServiceNamespace, ResourceId and ScalableDimension. Read as the table
reads other services, ResourceId (`service/<cluster>/<service>`) would
have filled that id, so the namespace was left out until the table could
look the ARN up.

The generator's new FOUND_BY gives a type whose ARN is all an id its
service mints, with the members a request names it by. An operation
whose request has them all names the type by them (`find`), generated
rather than corrected, and the reader asks the service for the ARN they
find through StoredResourceArns, the lookup EventBridge's connections
already use, or else checks the ARN with its id open, as for a create.
StoredResourceArns.find now takes the values a request names the
resource by, in the table's order: one name for EventBridge, the three
members for Application Auto Scaling, whose service now implements it
from the store its handlers read. A member left out or given a JSON
null names none, as the handler reads it.

Application Auto Scaling joins the table (14 operations, 1036 over 25
namespaces): RegisterScalableTarget, DeregisterScalableTarget,
PutScalingPolicy, DeleteScalingPolicy, PutScheduledAction and
DeleteScheduledAction are checked on the target's stored ARN, and a
RegisterScalableTarget registering a new one, its tags included, on
`scalable-target/*`; TagResource, UntagResource and
ListTagsForResource on the ARN their ResourceARN gives; the Describe
operations and GetPredictiveScalingForecast on `*`, as AWS checks them.
2026-11-01 10:10:02 -06:00
Jimmy Liu Jia a54ca5e0c9 fix(iam): match status validation errors for credential updates (#7174) 2026-11-01 09:12:08 -04:00
Andre Kurait fbd07bd6f5 fix(iam): include direct ViaAWSService condition context (#7133) 2026-10-31 17:48:04 -04:00
Priamo Germosen bfd3bcbbce fix(athena): read and check a request naming no catalog as AwsDataCatalog (#7061)
Athena's GetDataCatalog, ListDatabases, ListTableMetadata and
GetTableMetadata handlers read the catalog name with has() and
asText(), so a JSON null became a catalog named `null`: GetDataCatalog
then answered InvalidRequestException rather than the AwsDataCatalog
it answers for a request naming none. They now read it through the
handler's text(), as GetWorkGroup and StartQueryExecution read
WorkGroup, so a JSON null names no catalog.

Under IAM enforcement, a GetDataCatalog naming no catalog was checked
on `*` though Floci answers AwsDataCatalog, so a grant on that catalog
was refused and a deny on it did not apply, and the three catalog
reads given a JSON null CatalogName were checked on `datacatalog/null`
as well as on AwsDataCatalog. The request-resources table now reads a
request naming none, or a JSON null, as naming AwsDataCatalog for all
four, as it reads Athena's primary workgroup.

The table's regeneration also takes up drift in AWS's Service
Reference since the last sync, which the online check of both IAM
tables fails on: AWS now lists cognito-idp:DescribeTermsByClient among
the actions it authorizes DescribeTermsByClient as, so the
authorized-actions map no longer maps it to DescribeTerms and the
request-resources table checks it as its own action, and the map
gains MediaConnect's new BatchGetDestinationEndpoint and
BatchGetSourceEndpoint. Floci serves none of these operations.
2026-10-31 10:27:14 -05:00
Priamo Germosen ca3599f8c9 fix(iam): check seven more services on the resources their requests name (#6976)
Under IAM enforcement, Athena, Data Exports, Pricing Calculator, Cost
Explorer, CloudTrail, Global Accelerator and Timestream for InfluxDB
requests were checked on `*`, so a grant scoped to a workgroup, an
export, a workload estimate, an anomaly monitor, a trail, an
accelerator or a parameter group was refused, and a deny scoped to one
never applied.

The generated table of the resources requests name now reads them, 305
operations, from AWS's Service Reference and botocore as it reads the
first four batches: their namespaces move from the generator's
NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it
edited by hand; 1022 operations over 24 namespaces. Each resource
type's ARN format is the one Floci mints or reads: Athena's
`workgroup/<name>` and `datacatalog/<name>` (its tag handler parses
them), `export/<name>`, Cost Explorer's `anomalymonitor/<id>` and
Global Accelerator's `accelerator/<id>` with no Region, listeners and
endpoint groups under the accelerator's, `trail/<name>`, and Timestream
for InfluxDB's `<type>/<id>`.

Corrections, each with its reason:

- Athena's StartQueryExecution, ListQueryExecutions and ListNamedQueries
  naming no workgroup are checked on the primary one, where Athena runs
  and lists them ("If a workgroup is not specified, returns a list of
  query execution IDs for the primary workgroup"), and so is
  GetWorkGroup, which Floci answers with the primary one then. Floci's
  StartQueryExecution and GetWorkGroup handlers now read a JSON null
  WorkGroup as none, as ListQueryExecutions does, rather than as a
  workgroup named "null", so the workgroup checked is the one acted on.
- Athena's ListDatabases, ListTableMetadata and GetTableMetadata are
  checked on AwsDataCatalog, the Glue Data Catalog Floci reads
  whichever catalog they name, as well as on the one their CatalogName
  names.
- Cost Explorer's nine cost and usage reads are checked on `*`, not on
  their BillingViewArn: Floci serves no billing views and answers the
  account's costs whichever view is named, so a grant scoped to one
  must not reach them.
- Data Exports' CreateExport is not checked on its Export.ExportArn,
  the ARN "for this export", which the request creates; its pattern
  takes a table's, so a caller could choose the table checked.
- CloudTrail's StartLogging, StopLogging and GetTrailStatus name their
  trail by a bare Name, a name or an ARN, AddTags, RemoveTags and
  ListTags their resources by the ARNs in ResourceId and
  ResourceIdList, members whose names do not end in Arn, and the
  dashboard operations their dashboard by DashboardId, a name or an
  ARN.
- Cost Explorer's GetAnomalyMonitors and GetAnomalySubscriptions name
  their monitors and subscriptions by the ARNs in MonitorArnList and
  SubscriptionArnList; GetAnomalySubscriptions' MonitorArn, a
  monitor's ARN, is not read as a subscription's.
- Timestream for InfluxDB's RebootDbCluster is checked on each member
  instance its instanceIds names as well as on the cluster.
- Global Accelerator's ListCustomRoutingPortMappings is checked on its
  accelerator alone: its EndpointGroupArn extends the accelerator's ARN
  and so matched the accelerator's format.

Not read yet, each with its reason in NOT_COVERED: CodeDeploy, whose
on-premises instance format the Service Reference gives as
`instance:${InstanceName}` while the CodeDeploy permissions reference
gives `instance/instance-ID` and AWS's GetOnPremisesInstance example
answers `instance/<name>_<id>`; Redshift Data, whose serverless
workgroup's ARN ends in an id the service mints while its requests name
the workgroup by WorkgroupName; and Service Catalog, whose
*PortfolioShare requests give in AccountId the account a portfolio is
shared with, whose imported portfolios and products keep their owner's
account while requests name them by id, and whose AppRegistry half is
named in the path.
2026-10-30 07:23:46 -05:00
Priamo Germosen 98a3d2a346 feat(iam): read every modelled operation's constraints from the model (#6965)
The vendored file carried 52 of IAM's operations and carries 162 now, which
is every one of the 164 that declares a required member, a length, a pattern,
an enum or a range, bar the two account alias operations: those answer their
single member in AWS's own wording, so there is nothing left for the walk to
read on them.

What takes the last of them in is a walk that reads a Query map and anything
nested under one. A map arrives as entries numbered under its own name,
`ReplacementValues.entry.1.key` and `.entry.1.value`, and an entry's value is
named under the key that entry carried, `replacementValues.Department.values`,
which is how both maps this service answered by hand already named one and how
the JSON protocols name a map's value here. An entry is read off its key, so
one numbered with a value and no key is not an entry the map could hold. A
structure's field may be a list, a list's member may hold a list of its own
and a map's value may be a structure, so `AcquireRole`,
`PutAccountProperties`, `CreateDelegationRequest` and both simulators are read
with the rest, and the file refuses to load only for a shape of a type the
walk would pass over unread.

The two hand-written map checks come off with that. `AcquireRole`'s answers do
not move at all: the count of 30, each entry's required `Values` and the 20
values one entry admits read exactly as its own check read them, named by the
key the entry was sent under, which is what the tests it already had pin.
`PutAccountProperties` keeps the set it answered for a key, `Map keys must
satisfy constraint: [...]`, with the minimum length of 1 the model declares
now inside it where the hand-written set listed the maximum and the pattern
alone, and a value outside its bounds is answered in the words every other
member carries rather than the `must have length between 1 and 1024` that
check wrote. The `Namespace/PropertyName` rule stays exactly where it was,
being a rule the service applies after the format is good rather than a
constraint the model declares.

Two reductions keep an answer that is AWS's own rather than rewording it, both
through the hook the shared driver already takes. Eight operations answer a
member the request leaves out with "The request must contain the parameter
CertificateBody.", the wording this emulator answers for a missing Query
parameter in several services, so their shapes are vendored without the
model's required list and keep that refusal while their lengths and patterns
are read. Seventeen more are vendored without a member they answer in a
wording of their own: a service-linked role's principal and suffix, an empty
`ServiceNamespaces`, `statusType` on all four operations that take it,
`Encoding` on `GetSSHPublicKey`, the simulators' empty `ActionNames`,
`PolicyInputList` and `PolicySourceArn`, and `TagKeys` on the eight untag
operations.

Nine wordings this service wrote for itself go with the checks that wrote
them: the three password-policy ranges, the name refusal that spelled out its
own bounds and the group, server certificate and instance profile names beside
it, the path refusal, the authentication code, the virtual MFA device name and
the serial number. Each is answered by the model's own violation now, through
the one writer this package already had.

A member whose shape fixes one length is answered for that length rather than
for a bound it sits under, `Member must have length equal to 6`. That is the
wording a report's 36-character job id already answered by hand, which is why
the three report readers can be read from the model at all, and it reaches
STS through the same writer, whose `TokenCode` and `SigningAlgorithm` each fix
one length too.

Two test fixtures carried values AWS refuses and now carry values it takes.
`SignedIamUsers` named a user with a prefix plus a whole UUID, which reaches
66 characters where `userNameType` declares 64, and the two sibling fixtures
that named one the same way follow it onto the shorter suffix. The SDK suite
registered a SAML provider with a 375-character metadata document where AWS
declares 1000, so each of its two documents is padded to that bound on its
own.

`docs/services/iam.md` carries each reading, the maps among them.
2026-10-29 20:32:48 -05:00
Priamo Germosen 62527ebaa8 fix(iam): check ModifyReportDefinition on the report it names alone (#6935)
The generated table of the resources requests name checked Cost and
Usage Reports' ModifyReportDefinition on the report its ReportName
names and also on its ReportDefinition.BillingViewArn, read as a report
definition's ARN. That member is a billing view's ARN
(arn:aws:billing::<payer account>:billingview/...), never a report's,
so a request carrying a report's ARN there was checked on a report it
does not act on. PutReportDefinition's correction already leaves it
out.

A correction now reads ModifyReportDefinition's report from ReportName
alone, sharing PutReportDefinition's reason, and the table is
regenerated; nothing in it is edited by hand.
2026-10-29 18:04:35 -05:00
galsuchetzky-act 981b885348 fix(apigateway): authorize management calls against the path ARN they name (#6825) 2026-10-29 14:51:56 -04:00
Priamo Germosen 078931597e fix(iam): check five more services on the resources their requests name (#6927)
Under IAM enforcement, Budgets, Cost and Usage Reports, Service Quotas,
Textract and Translate requests were checked on `*`, so a grant scoped
to a budget, a report definition, a quota, an adapter or a terminology
was refused, and a deny scoped to one never applied.

The generated table of the resources requests name now reads them, 103
operations, from AWS's Service Reference and botocore as it reads the
first three batches: their namespaces move from the generator's
NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it
edited by hand; 717 operations over 17 namespaces. Each resource
type's ARN format is the one Floci mints or reads: `budget/<name>` with
no Region (Budgets' tag handler parses it), `definition/<name>`, and
`<service code>/<quota code>` (Service Quotas' QuotaArn).

Three corrections, each with its reason: CreateBudget and UpdateBudget
name their budget by Budget.BudgetName and NewBudget.BudgetName, and
PutReportDefinition its report by ReportDefinition.ReportName, inside a
structure the rule does not read. Without them UpdateBudget and
PutReportDefinition were checked only on their BillingViewArn, a
billing view's ARN by botocore's pattern, so a caller allowed on one
budget or report could give its ARN there and name another.

Verified Permissions minted a policy store's ARN with a Region, where
AWS gives none: its CreatePolicyStore example answers
arn:aws:verifiedpermissions::123456789012:policy-store/PSEXAMPLEabcdefg111111,
the Service Reference's format alike. It now mints it without one, in
the Region's partition.

Not read yet, each with its reason in NOT_COVERED: Verified
Permissions, whose policyStoreId may name a store by its alias, which
AWS authorizes as the action on the store the alias points to and
GetPolicyStoreAlias on the alias, and whose aliasName carries the
`policy-store-alias/` its format already gives; Auto Scaling, whose
group and launch configuration ARNs Floci mints without AWS's id
(`autoScalingGroup:<name>` for
`autoScalingGroup:<id>:autoScalingGroupName/<name>`), which ECS reads
back; SWF, whose domain format the Service Reference gives no Region
while the SWF Developer Guide gives one; and CloudHSM, whose formats
end in names while its requests give ids.
2026-10-29 07:54:58 -05:00
TATSUNO “Taz” Yasuhiro 385ffcfdd0 feat(lambdaweb): set the WebFunctionAuthType condition keys on endpoint routes (#6893) 2026-10-29 00:54:49 -04:00
lex00 5a84d08383 fix(iam): read iam:PermissionsBoundary from the stored role or user an action names (#6897)
On the 15 actions where the Service Reference lists iam:PermissionsBoundary and the request carries no boundary, such as AttachRolePolicy, PutUserPolicy and GetRole, the key is the boundary stored on the role or user named by RoleName or UserName. The generator writes these pairs to a fromTarget section, and IamConditionContextResolver looks the boundary up through IamService. A role or user without one carries no value for the key.
2026-10-29 00:07:50 -04:00
Priamo Germosen 407ac4e210 fix(iam): check CodeBuild and Kinesis Data Analytics on the resources their requests name (#6884)
Under IAM enforcement, CodeBuild and Kinesis Data Analytics (Amazon
Managed Service for Apache Flink) requests were checked on `*`, so a
grant scoped to a project, a report group or an application was
refused, and a deny scoped to one never applied.

The generated table of the resources requests name now reads them, 92
operations, from AWS's Service Reference and botocore as it reads the
first two batches: their namespaces move from the generator's
NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it
edited by hand; 614 operations over 12 namespaces. Each resource type's
ARN format is the one Floci's handler mints, which the tests check
against the ARN each create returns: `project/<name>`,
`report-group/<name>`, `build/<project>:<number>` and
`application/<name>`.

Kinesis Data Analytics v1, the KinesisAnalytics_20150814 target of SQL
applications, is not read: Floci serves v2 only, and v1's operations
share v2's names with other members. It joins EventBridge V2 in the
generator's CLIENTS_NOT_READ, with its reason.

CodeBuild authorizes a build on its project: the CodeBuild User
Guide's permissions reference gives BatchGetBuilds, StopBuild,
RetryBuild and BatchDeleteBuilds the resource project/project-name.
Their requests name builds by id, which is `<project>:<id>` (its
CODEBUILD_BUILD_ID example is codebuild-demo-project:b1e6661e-...), so
four corrections read the project from the id up to its `:`. For them
the table may read a member filling a variable up to a character
`before`, as it already read an ARN member, in the generator, the
loader and the reader. Without them a policy granting StartBuild and
BatchGetBuilds on a project, as a pipeline's CodeBuild action role
has, allowed starting a build and refused watching it.

A list filling a type's one variable may mix names and ARNs: CodeBuild's
BatchGetProjects takes either for each of `names`. Each value that is
an ARN of the type now names that resource and the others are read as
names, where the reader took ARNs as given only when every value was
one, and otherwise put an ARN inside the name's format, refusing a
caller granted both projects.

Not in this change: a build batch, whose id the documents give no
format for and which Floci does not serve, and a report, named by a
report ARN where AWS checks its report group, stay on `*`.
2026-10-28 21:59:51 -05:00
Priamo Germosen 6606657434 fix(iam): name the member without the offending value in a validation error (#6811)
IAM's constraint violations read `Value at 'roleName' failed to satisfy
constraint: Member must have length greater than or equal to 1`, with no
value beside the member, which is where the recorded messages point: the two
IAM messages in LocalStack's AWS-validated snapshot from 2025-03-06, a 2026
capture of a `UserName` over 64 characters, and the messages the Identity
Center guide lists as the ones that commonly appear in CloudTrail events.
The two captures that carry the value are from 2019 and 2024, so they read
as stale rather than as wrong when written. STS keeps the value, which its
own 2024 capture carries and which is the same split this package already
records for pattern and enum messages.

It is a reading rather than a published rule, so `docs/services/iam.md` says
so and names the captures behind it. A direct capture that shows IAM
carrying the value again moves it back in one edit.

The form is chosen in one place. `SmithyValidationErrors.Violations` writes
each sentence once and carries both forms; the statics stay the quoting one,
so every other service answers exactly what it answered before.
`IamValidationErrors` names IAM's side of the split for the handler, the
service and the service-last-accessed check, and the shared Query walk is
loaded with the form of the service reading it, IAM without the value and
STS with it.

Two messages are left alone, neither being this question: a list checked as
a whole carries the list as its value, which is what AWS does elsewhere, and
a required member the request leaves out keeps `Value null at '<member>'`,
which no capture covers in either form.

Two checks built the message by hand rather than through a helper and so are
swept here too: `GenerateOrganizationsAccessReport` and the delegation
request operations each composed the quoted value inline, which is why
neither shows up in a search for the literal form. Their entity path and
request id now assert the whole message rather than only the error code,
since asserting the code alone is what let that drift sit unnoticed.

The vendored shapes file carries 52 operations now rather than 13, so the
members the paging wave opted in answer in the shorter form as well, and the
table sweep over every paged operation asserts it that way.
2026-10-28 19:51:54 -05:00
Priamo Germosen 096d336fab fix(iam): check five more services on the resources their requests name (#6810)
Under IAM enforcement, Amazon Data Firehose, Cognito identity pools,
Cloud Map, ACM and CodePipeline requests were checked on `*`, so a
grant scoped to a delivery stream, an identity pool, a namespace or a
service, a certificate, a pipeline or a webhook was refused, and a deny
scoped to one never applied.

The generated table of the resources requests name now reads them, 149
operations, from AWS's Service Reference and botocore as it reads the
first batch: their namespaces move from the generator's NOT_COVERED to
NAMESPACES, and the table is regenerated, nothing in it edited by hand.
Each resource type's ARN format is the one Floci's handler mints, which
the tests check against the ARN each create returns:

- `deliverystream/<name>`, `identitypool/<id>`, `namespace/<id>`,
  `service/<id>`, `certificate/<id>` and a pipeline's bare name.
- A CodePipeline webhook: AWS's is `webhook:<name>` (the Service
  Reference's format, and the CodePipeline User Guide's
  "arn:aws:codepipeline:eu-central-1:ACCOUNT_ID:webhook:my-webhook"),
  where Floci minted `webhook/<name>`; it now mints AWS's.

Corrections, each with its reason:

- StartPipelineExecution and GetPipelineState name their pipeline by a
  bare `name` ("The name of the pipeline to start"), which the rule
  reads only for an operation named after the type, as Step Functions'
  StartExecution names its execution, not its state machine, by `name`.
- CreatePipeline and UpdatePipeline name it by `pipeline.name`, and
  PutWebhook the webhook by `webhook.name` and the pipeline it connects
  to by `webhook.targetPipeline`. `pipeline.roleArn` holds the role
  CodePipeline assumes, an IAM role's ARN by botocore's pattern, and
  names no pipeline: read as one, a pipeline-shaped value there was the
  only resource an UpdatePipeline was checked on, so a grant on one
  pipeline let a request change another.
- CreateCustomActionType and DeleteCustomActionType are checked on
  `actiontype:Custom/<category>/<provider>/<version>`: a custom action
  type's owner is Custom, which the request does not give, and AWS's
  CreateCustomActionType example answers "owner": "Custom".
- Cloud Map's CreateService names its namespace by NamespaceId or,
  when it gives none or a JSON null, by DnsConfig.NamespaceId, which
  botocore keeps ("Use NamespaceId in Service instead") and the handler
  reads then; read by NamespaceId alone, a deny on the namespace did
  not hold for a request giving it in DnsConfig. A member given a JSON
  null now counts as absent in a resource's `when` and `unless`, as a
  handler reading it with asText(null) takes it, unless the table reads
  it as a value through `absent` (EventBridge's bus, `default`).

For those, the table may fill a variable from a structure's field
(`pipeline.name`), and give a variable no member gives the one value
its handler uses (`fixed`), in the generator, the loader and the
reader.

A create that names another resource beside the one it makes has its
tags checked on the one it makes alone, which the table marks `made`:
the resource of the type, or with an ARN format's leading resource
word, related to the operation's name past its verb. PutWebhook's tags
go on the webhook, not the pipeline it connects to, and CreateService's
on `service/*`, not the namespace; no other operation in the table is
marked.

Application Auto Scaling stays unread, its reason in NOT_COVERED: a
scalable target's ARN ends in an id the service mints, while requests
name the target by ServiceNamespace, ResourceId and ScalableDimension,
and read as a member ResourceId would fill that id.

RequestResourceMembersTest's test of every resource in the table now
expects, with the resource a request names, the resources of its
operation that every request names: Cloud Map's CreateService names
the service it creates with every variable open.
2026-10-28 17:18:11 -05:00
lex00 52eb4b9a9c fix(iam): read condition keys a request carries in a member under another name (#6858)
BY_HAND in tools/aws/regen_iam_condition_keys.py names the member for four pairs: iam:ServiceSpecificCredentialServiceName from ServiceName and iam:ServiceSpecificCredentialAgeDays from CredentialAgeDays on CreateServiceSpecificCredential, and iam:DelegationDuration from SessionDuration and iam:TemplateArn from Permissions.PolicyTemplateArn on CreateDelegationRequest. --check fails when a BY_HAND member leaves botocore, its type no longer fits the key, or the reference stops listing the pair. The other notRead pairs now say where AWS takes the value from.
2026-10-28 16:42:22 -04:00
Allen Sanborn 3212ce3c15 fix(iam): page ListUsers, ListGroups and policy lists with MaxItems and Marker (#6267)
* fix(iam): page ListUsers, ListGroups and policy lists with MaxItems and Marker

ListUsers, ListGroups, ListAttached{User,Group,Role}Policies and
List{User,Group,Role}Policies read neither MaxItems nor Marker and always
answered IsTruncated=false with every entry. They now go through the same
paginate helper ListRoles and ListPolicies use: an omitted MaxItems returns
100 items as the API reference documents, a MaxItems outside 1 to 1000 is a
ValidationError, a Marker the handler did not issue is InvalidInput, and a
Marker appears only on a truncated page.

Users, groups and inline policy names are listed in name order and attached
policies in ARN order, so a Marker keeps pointing at the same place between
calls even when the entry it names is removed in between.

* fix(iam): resume the newly paged IAM lists only from their own markers

ListUsers, ListGroups and the attached and inline policy lists read a
Marker they could not verify as a list offset, so Marker=1 silently
skipped the first entry, and a marker issued for one role's list resumed
another role's list after the same policy. These lists have only ever
issued signed markers, so their cursor now carries the action and, for a
per-principal list, the principal, and any other marker is InvalidInput.
ListRoles, ListPolicies and the other readers keep their existing marker
handling.

Also covers the omitted-MaxItems default on ListUsers and ListGroups with
101 entries: 100 on the first page, IsTruncated and a Marker that fetches
the last one.

* fix(iam): bind the newly paged IAM lists' markers to the request account

IAM entities are stored per account, but the marker cursor named only the
action and principal, so a marker issued in one account resumed the same
listing in another account after the same name and skipped its earlier
entries. The cursor now carries the account the request reads from, and a
marker from another account is InvalidInput.

* feat(iam): generate the IAM paginator table from botocore

tools/aws/regen_iam_paginators.py writes src/main/resources/aws/iam-paginators.json
from botocore's iam/2010-05-08 model, as the other tools/aws generators do: every
operation whose request models Marker, with its input and output token, limit
key, truncation flag and result keys, the MaxItems bounds of maxItemsType
(1 to 1000), the default page size the limit's documentation states ("defaults
to 100"), and markerType's bounds.

The 34 operations botocore's paginators-1.json lists take their tokens and
result keys from it. The six that model Marker without a paginator
(GetServiceLastAccessedDetails, GetServiceLastAccessedDetailsWithEntities,
GetOrganizationsAccessReport, ListServiceSpecificCredentials,
ListDelegationRequests, ListPoliciesGrantingServiceAccess) are read from
their request and response shapes and marked paginator: false.
ListServiceSpecificCredentials documents no default and
ListPoliciesGrantingServiceAccess models no MaxItems; the table records
both as such rather than inventing a value.

make aws-data-sync regenerates it and make aws-data-check fails when it is
stale against the pinned botocore.

* fix(iam): page every IAM list through one path driven by the paginator table

IamQueryHandler paged eight lists by hand through paginateScoped, a few more
through paginate, and left the rest (the tag readers, ListAccessKeys,
ListInstanceProfiles, ListPolicyVersions, GetGroup, ListGroupsForUser,
ListEntitiesForPolicy, GetAccountAuthorizationDetails, the simulations and
others) ignoring MaxItems and Marker with IsTruncated=false. Every operation
the generated aws/iam-paginators.json lists now pages through one paginate
path that reads its entry: the limit's bounds and default, the members that
resume and continue it, and the result keys pagedList and pagedLists write
under. paginateScoped, paginateByMarker and the hardcoded 100/1000 are gone.
ListEntitiesForPolicy and GetAccountAuthorizationDetails page their several
lists as one, in the paginator's order.

Marker semantics, chosen deliberately: a Marker is opaque and resumes only the
listing that issued it, on every paged operation. AWS documents it as "the
value of the Marker element in the response that you received", so a value
Floci did not issue, a bare number included, is InvalidInput; ListRoles,
ListPolicies and the report readers no longer read one as an index. The
marker names the last item of its page, so a deletion or creation ahead of
it skips nothing and repeats nothing, and it is signed (not prefixed) over
the account, the operation and every request member except Marker and
MaxItems, so a marker from another operation, principal, filter or account
is refused while the page size may change between calls. Signing the scope
instead of carrying it keeps issued markers short. markerType's 320-character
bound is not checked separately: every other value is refused as unissued,
and a long ARN key could otherwise push an issued marker past it.

MaxItems is now checked before Marker, as a malformed request is rejected
before anything is read from it. An omitted MaxItems is the documented 100;
ListServiceSpecificCredentials, which documents no default, returns its whole
list.

IamListPaginationIntegrationTest.everyPaginatedOperationHonoursMaxItemsAndMarker
iterates the table's 34 paginated operations, each with a fixture listing two
items, and checks the MaxItems bounds, a one-item page, resumption without
loss or repetition, the default page, and refusal of an unissued, bare-index
or other operation's marker. Its fixture map must name exactly the table's
operations, so one AWS starts paging later fails until it has one.
ListAccountAliases can hold one alias, so it is checked for everything but a
cut page. The tests the table test subsumes are removed; the ordering, anchor,
cross-listing and cross-account tests stay. Two ServiceLastAccessed tests
that walked by bare index now use issued markers.

* fix(iam): hold paged requests to the model through IamRequestShapes

MaxItems and Marker are request constraints, and main now checks a
request against the model before it runs. Every operation the paginator
table pages joins that wave in regen_iam_shapes.py, and the bounds leave
iam-paginators.json (which keeps only defaultItems, the documented page
size) and limit(), which now only parses the number and applies the
default. A pytest pins that every operation the paginator table carries
is in the wave, so a list AWS starts paging later cannot slip past the
bounds.

Six paged operations join with Marker and MaxItems alone: the three
report readers, whose JobId is answered by hand as "length equal to 36"
and whose SortKey enum is checked by hand; ListPoliciesGrantingServiceAccess,
whose empty ServiceNamespaces is answered InvalidInput; and the two
Simulate operations, whose ContextEntries nest a list inside a list of
structures, which the walk refuses. Vendoring their whole request would
reword answers main already settled; vendoring nothing would leave their
paging unbounded (SimulateCustomPolicy with MaxItems=0 was a 500).

Markers fit markerType's 320 characters. A marker embeds the key of the
item its page ended on, so a policy ARN with a long path produced one
of 610 characters, which the model check would now refuse on the way
back. SignedMarkers takes a maximum length: a cursor that would exceed
it is carried as a SHA-256 digest (119 characters once signed and
encoded), and the instance keeps the digest -> key mapping. That keeps
the existing resume semantics exactly: the marker still resolves to the
full key, so a deleted anchor resumes at the first key after it, and
the signature still binds account, operation and filter. Two stateless
alternatives were rejected: a truncated key prefix plus digest cannot
order a deleted anchor against items sharing the prefix, and a position
index skips or repeats when items ahead of it are deleted. The cost is
one map entry per distinct long key a page has ended on, never evicted
(marked ponytail in the code); markers already do not survive a
restart, as the signing key is per instance. Keys short enough to embed
are carried as before.

Checkstyle (./mvnw checkstyle:check) reported six errors in files this
PR touches: javax import order and two inline org.w3c.dom.Node in the
pagination test, and an inline java.util.Base64 in SignedMarkersTest.
The test now parses through XmlParser.parseDocument instead of its own
DocumentBuilderFactory. The switch statements in ListEntitiesForPolicy
and the test's holder fixture are switch expressions.

Tests: aMarkerEndingOnALongPolicyArnFitsTheModelAndResumesPastItsDeletion
attaches three policies under a 391-character path, pages with
MaxItems=1, deletes the anchor and resumes through the model check.
Constructing SignedMarkers without the limit fails it (610 characters);
restoring the pre-wave iam-request-shapes.json fails the table-driven
test (MaxItems=0 answered 500, MaxItems=1001 answered 200).

* fix(iam): bind a caller-resolved list's marker to the resolved user

ListAccessKeys, ListMFADevices, ListSSHPublicKeys, ListSigningCertificates
and ListServiceSpecificCredentials default an omitted UserName to the
caller. The marker was signed over the raw request members, so two users
in one account who both omitted UserName shared a scope and one's marker
resumed the other's listing. These handlers now page over the request
with UserName set to the resolved user, so the marker is bound to the
user the list was read for, named or implicit.

* fix(iam): bound the SignedMarkers digest map and trim the pagination test

SignedMarkers held every long cursor it had issued a digest for, in a map
that never shrank. It is now an access-ordered LinkedHashMap capped at
10,000 entries, the idiom CloudWatch Logs uses for its Insights queries. A
marker whose digest was evicted resolves to null, the same as an unknown
digest, so callers refuse it as an invalid marker.

IamListPaginationIntegrationTest spent most of its time in RestAssured's
per-request overhead on the hundred-item fixtures. Those creates and
deletes now go concurrently through java.net.http. The users and groups
default test keeps its first-page checks of the default of 100 and drops
the second page, which the roles default test and the every-operation test
already cover. The SSH public key fixture is generated once per run.
2026-10-28 16:37:49 -04:00
galsuchetzky-act f926968167 fix(s3control): take TagResource and UntagResource tag condition keys from generated data (#6677)
The Service Authorization Reference lists aws:RequestTag/${TagKey} and
aws:TagKeys as condition keys for s3:TagResource, and aws:TagKeys for
s3:UntagResource. botocore's s3control model says where the request
carries them: TagResource's Tags list in the body, UntagResource's
TagKeys in the tagKeys query parameters.

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

tools/aws/regen_s3control_tag_condition_keys.py now generates
s3control-tag-condition-keys.json from the two sources, as the DynamoDB
condition key table is generated: every s3 action the reference gives
either key, and every S3 Control operation's request members that feed
them, found as the tag-on-create table finds tag members.
IamConditionContextResolver reads it for a request on an S3 Control
route. The make targets check the members offline against the pinned
botocore in CI and the actions online against AWS in the IAM data drift
workflow. S3's own bucket and object tag keys stay as written, since
they were measured against AWS and do not all match the reference.
2026-10-28 10:14:26 -04:00
lex00 967e87d7f7 fix(iam): set iam: condition keys from a table generated from the Service Reference (#6762) 2026-10-28 07:00:43 -04:00