Commit Graph
237 Commits
Author SHA1 Message Date
Robin Baeckman 07f2d62c17 feat(eks): vendor AWS's add-on version catalog for every supported Kubernetes version (#6735) 2026-10-30 07:21:01 -04:00
Mohith 628beeef85 fix(rds): report the RDS hosted zone id on clusters and instances (#6826)
* fix(rds): report the RDS hosted zone id on clusters and instances

DescribeDBClusters omitted HostedZoneId and DB instance endpoints omitted
Endpoint.HostedZoneId, so Terraform's aws_rds_cluster.hosted_zone_id was
empty and Route 53 alias records pointing at RDS endpoints failed.

Add a per-region rdsHostedZoneId fact to region-facts.json through the
generator, with the us-east-1 value from the AWS CLI RDS documentation,
and read it through AwsRegionFacts.rdsHostedZoneId. Regions without a
captured value fall back to the us-east-1 zone; Floci's Route 53 resolves
alias targets by DNS name, so the fallback does not affect resolution.
The value is looked up when the response is built, so existing clusters
and instances report it too.

Closes #6778

* fix(rds): read the RDS hosted zone from the CLI example and keep the fallback in RDS

AwsRegionFacts.rdsHostedZoneId now returns an Optional like every other
accessor there, and RdsQueryHandler owns the fallback zone for regions with
no captured value, the way API Gateway keeps its own placeholder. A missing
us-east-1 entry can no longer break a describe call.

The generator reads the us-east-1 zone from a snapshot of the AWS CLI
describe-db-instances example under aws-docs/partition-guides, as the
GovCloud API Gateway zones come from the GovCloud guide, instead of a
typed-in constant. The parse is required and fails on a missing,
wrong-region or ambiguous example. Adding another region is now a data
change.
2026-10-30 07:05:41 -04:00
Hector Ventura 4d3f3b664d refactor: read and check ARNs through AwsArnUtils in IAM, KMS, EC2, SSO and the core condition resolvers (#6969)
The arn-probe, arn-split and arn-concat sites in these files now go through looksLikeArn, isArn, parse, accountOrDefault and regionOrDefault instead of startsWith("arn:") and split(":"). A well-formed ARN reads the same as before. tools/partition/baseline.tsv drops from 24 to 0, the last baselined sites, and AGENTS.md no longer says the arn-* categories have any.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 22:26:38 -04:00
Hector Ventura 9e7bcc4029 refactor: mint and match ARNs through AwsArnUtils in Step Functions, Route 53 Resolver, SES, AppSync and three more (#6971)
The arn-concat sites in these files now build ARNs with Arn.of, Arn.global and new Arn, and match stored ARNs by their parsed partition, service and region instead of a hand-built prefix. The ARNs they produce are unchanged. tools/partition/baseline.tsv drops from 44 to 34.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 21:48:21 -04:00
Hector Ventura 5bf89a5061 refactor: read and check ARNs through AwsArnUtils in Bedrock, AgentCore and SageMaker (#6970)
The arn-probe and arn-split sites in these services now go through looksLikeArn, isArn, parse and regionOrDefault. The four AgentCore services share BedrockAgentCoreArns.resource, which reads an ARN's resource without its qualifier. A well-formed ARN reads the same as before. tools/partition/baseline.tsv drops from 44 to 34.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 21:39:02 -04: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
Kenshin Okinaka 361b3177b8 docs(ses): correct the SES and SES v2 operation counts in the service matrix (#6922) 2026-10-29 21:32:00 -04: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
Aniket Shukla 8270cc7c41 feat(ecr): support pull time update exclusions (#6856)
* feat(ecr): support pull time update exclusions

* refactor(ecr): remove duplicate exclusion validation
2026-10-29 16:20:51 -04:00
galsuchetzky-act 981b885348 fix(apigateway): authorize management calls against the path ARN they name (#6825) 2026-10-29 14:51:56 -04:00
Jackson Price fee688bd05 feat(cloudformation): support four AWS::AppConfig resource types (#6791) 2026-10-29 12:59:23 -04:00
Hector Ventura 85813108c1 chore(rename): add a script that moves an open branch across the rename (#6790)
* chore(rename): add a script that moves an open branch across the rename

Part of #6589. After the cut, a branch that forked before it conflicts on
every Java file it touches. tools/rename/rebase_across_rename.sh runs
rename_package.py apply on the branch's merge-base and on its tip, and
cherry-picks the renamed tip onto the target with the renamed merge-base as
the merge base, so only real conflicts remain. The branch becomes one commit
carrying every original message in order, sign-offs included, and the first
commit's author; the old tip is kept as <branch>-before-rename and nothing
is pushed.

rename_package.py now imports the partition lexer only for report, so apply
runs on a bare python3 without PyYAML.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(rename): run the rebase script from any directory of the checkout

git rev-list pathspecs and git archive paths are relative to the current directory, so a run from a subdirectory found no cut and reported that the rename had not landed. The script now changes to the top level first.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 12:52:49 -04:00
Hector Ventura 3e8369664e refactor: read and check ARNs through AwsArnUtils in SES, SWF, Verified Permissions, AppSync and five more (#6905)
Twelve startsWith("arn:") probes become AwsArnUtils.looksLikeArn. The SES tenant resource reader, the SWF tag region, the Verified Permissions Cognito user pool check (now AwsArnUtils.isArnFor) and the AppSync data source region read ARN fields with AwsArnUtils.parse and regionOrDefault instead of a split.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 10:17:45 -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
Priamo Germosen 34269655ba feat(sts): read every modelled operation's constraints from the model (#6925)
The seven operations that still answered an absent member from a check of
their own are read against the vendored shapes now, which leaves every STS
operation that models a member reading its constraints from the model:
`AssumeRole`, `AssumeRoleWithSAML`, `AssumeRoleWithWebIdentity`, `AssumeRoot`,
`DecodeAuthorizationMessage`, `GetDelegatedAccessToken` and
`GetFederationToken`. `GetCallerIdentity` carries no member, so there is
nothing to read for it.

Two answers move, both onto the form the model and the rest of this package
give. A member the request leaves out is named as a constraint message spells
it, `roleSessionName` rather than `RoleSessionName`, and every absent member
is reported together in the order the model lists them, where the check it
replaces answered the first it found. A member sent empty is a value the
request carries, so it breaks its own minimum length rather than reading as
absent. That is the reading #6811 settled for the two services and what
`validateRequired` was the last of in this handler.

What the seven gain is every bound beside the required members, none of which
was read at all: `RoleArn` at 20 to 2048 characters, `RoleSessionName` at 2 to
64, `ExternalId`, `SourceIdentity`, `SerialNumber`, `TokenCode`, `Policy`,
`PolicyArns`, `Tags`, `TransitiveTagKeys` and `ProvidedContexts` on
`AssumeRole`, `SAMLAssertion` at 4 to 100000, `WebIdentityToken` at 4 to
20000, `ProviderId` at 4 to 2048, `Name` at 2 to 32, `EncodedMessage` at 1 to
10240, and the `DurationSeconds` and `MinimumSessionTokenSize` ranges each
operation declares. `AssumeRoot`'s own length check on `TargetPrincipal` said
what the model says, so it comes off with the rest.

One reading is this emulator's own, and `docs/services/sts.md` says so.
`TradeInToken` is required and declares no length, so a request sending it
empty carries a value: it reaches the lookup and is answered
`ExpiredTradeInTokenException`, the refusal any token that cannot be redeemed
gets, where the check it replaces called it absent. Nothing published says
what AWS answers an empty trade-in token.

Each operation keeps the refusals it answers ahead of the constraints:
`GetFederationToken` and `GetSessionToken` turn away session credentials
first, and `AssumeRoot` refuses the global endpoint first.

Three test fixtures carried values AWS refuses and now carry values it takes.
A `RoleSessionName` of `s` is one character where the model declares two, and
a `WebIdentityToken` of `jwt` three where it declares four, so the fixtures
that sent them are a character longer, as are the two assertions that read a
session name back out of an assumed-role ARN and a condition key.

The name the shared role-session fixture opens under has one writer now,
`EnforcementFixtures.SESSION_NAME`, read by every test asserting on that session
rather than spelled again in each: an `aws:userid` condition, a `PrincipalArn`
condition, two authorization-denial messages and the ARN two trust-policy cases
read back. Each of those carried the one-character name, which is a 403 where
the case wants a 200, or a prefix match that no longer pins the whole ARN.
2026-10-29 07:54:47 -05:00
TATSUNO “Taz” Yasuhiro c4ae11c414 feat(cloudformation): expose RegionalEndpoints of a web function endpoint to Fn::GetAtt (#6907) 2026-10-29 08:25:24 -04:00
Aniket Shukla e24bc36f64 feat(ecr): support account settings (#6855)
* feat(ecr): support account settings

* fix(ecr): validate account settings against request model
2026-10-29 07:36:05 -04:00
Hector Ventura 03da5da997 refactor: read and check ARNs through AwsArnUtils in RAM, Resource Groups, CloudWatch, Service Catalog and four more (#6904)
Seven startsWith("arn:") probes become AwsArnUtils.looksLikeArn. RAM, the Resource Groups Tagging visibility check, the CloudWatch dashboards cross-account ARN and Service Catalog read ARN fields with AwsArnUtils.parse and regionOrDefault instead of a split; the dashboards ARN without its region is rebuilt as an AwsArnUtils.Arn.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 07:31:03 -04:00
Priamo Germosen c9c1c0990b feat(sts): read a Query request's declared constraints from the model (#6891)
`GetAccessKeyInfo`, `GetSessionToken` and `GetWebIdentityToken` are held to
the constraints botocore's STS model declares, which
`tools/aws/regen_sts_shapes.py` vendors into `aws/sts-request-shapes.json`
and `StsRequestShapes` reads through the same `QueryConstraintCheck` walk
IAM reads its own file with. The two services share the protocol, the
message wording and the generator, so what is new is which operations are
read rather than how.

What it adds is on `GetSessionToken`: `SerialNumber`, `TokenCode` and
`MinimumSessionTokenSize` are declared and nothing read them, so a serial
number under 9 characters, a token code that is not six digits and a size
past 4096 answer `ValidationError` where they answered credentials. The size
is still only validated, the token staying the length this emulator mints.

`GetAccessKeyInfo` and `GetWebIdentityToken` keep the messages they already
answered, from the same bounds and the same patterns, and about 130 lines
of hand-written audience, tag and access-key checks come out. One answer moves:
a value breaking two constraints is answered for both, where the if-else
chain stopped at the first. That is the reading #6402 settled and #6580
already took for an empty role name.

`jwtAlgorithmType` publishes a fixed length of 5 and no enum, the two values
coming from the reference, so the walk takes a documented constraint keyed
by member name and reports it in that member's place, which keeps a
collected message in the model's order. It is reported only for a member the
request carries that breaks nothing the model declares, which is the
exclusivity the hand-written helper had.

A value that is no number at all stays `InvalidParameterValue`, answered
before the constraints, since the model declares a range and says nothing
about what counts as a number; a digit string is a number of any width, so a
`DurationSeconds` of `99999999999` breaks the maximum rather than being
called no integer, as #6625 settled for an oversized `MaxItems`. Each
operation asks for its violations where its own check ran rather than ahead
of the switch, because `GetSessionToken` refuses session credentials before
it reads anything.

The whitespace around a number comes off wherever this handler reads one. The
check takes a padded value and holds it to its range, so the read behind it
parses the same text: parsing the value as the request spelled it threw there
and fell back to the default, so a ` 3600 ` asking for an hour would have been
handed the twelve hours `GetSessionToken` defaults to, or the five minutes a
web identity token defaults to. IAM reads its own `MaxItems` that way already.

The generator is not new code. `request_shapes.main` already drives the five
generators that vendor member types, so it takes an `operations` argument
now and both Query-protocol generators hand it their model, output and
operations the same two-line way, which takes the hand-rolled driver out of
`regen_iam_shapes.py` as well. ECR and Resource Groups still carry theirs
and are a refactor of their own.

The generator contract tests move with it: that a vendored file carries
exactly the operations its generator lists and resolves every shape it names
is one parametrized test over all four constraints generators rather than a
copy per generator, and `build_constraints`'s own properties are tested
once, where the shared module already tested them. The model transform the
driver takes is driven through it as well, the file it writes carrying what
the transform left and the staleness check calling that file current only
when it prepares the model the same way, and IAM's own tests read the
vendored file for each paged request reduced.

Three sentences this handler wrote out by hand go the same way. The two
range refusals and the length refusal on `TargetPrincipal` come from
`SmithyValidationErrors`, which already wrote them word for word, and the
"Must be an integer." refusal has one writer and three callers. The length
comparison counts code points rather than UTF-16 units as a result, which is
the reading the rest of the package uses.
2026-10-29 00:34:23 -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
Hector Ventura d7204696d4 refactor: read and check ARNs through AwsArnUtils in DataSync, DynamoDB, Glue, Lake Formation, Redshift and S3 Tables (#6903)
Ten startsWith("arn:") probes on name-or-ARN parameters become AwsArnUtils.looksLikeArn. DataSync's private arnRegion and arnAccountId copies are deleted in favour of AwsArnUtils.regionOrDefault and accountOrDefault, and its resource, Glue's resource and Redshift's integration source type are read with AwsArnUtils.parse instead of a split.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 00:41:03 -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
Hector Ventura 63aa7710d0 refactor(lambda): tell names from ARNs and read regions through AwsArnUtils (#6881)
The startsWith("arn:") probes in Lambda, Lambda MicroVMs and the API Gateway v2 quick-create target become AwsArnUtils.looksLikeArn. The runtime version ARN and the MicroVM image region read the region with AwsArnUtils.regionOrDefault instead of a split. LambdaTagController keeps its split, marked: Lambda reads the fourth field of any tag target, ARN or not, which IamRestRouteEnforcementIntegrationTest pins.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-28 22:17:14 -04:00
Hector Ventura 9cea537cfa refactor(ecs): tell names from ARNs through AwsArnUtils.looksLikeArn (#6879)
The eleven startsWith("arn:") probes in EcsService, EcsContainerManager and EcsCfnProvisioner become AwsArnUtils.looksLikeArn, which is the same check, and the null guards it already makes are dropped.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-28 22:16:51 -04:00
Hector Ventura 42b4bf4245 refactor(rds,docdb,neptune,cloudformation): tell names from ARNs through AwsArnUtils (#6880)
* refactor(core): add AwsArnUtils.looksLikeArn for name-or-ARN parameters

A parameter that takes a name or an ARN, where AWS answers a malformed ARN with its own error, needs to treat any value starting arn: as an attempted ARN. isArn needs all six fields and would send arn:aws:rds down the name path, so the sites the earlier migration PRs left on purpose still probe with a hand-written startsWith. looksLikeArn is that probe, in one place, so the area PRs that follow can move them off the arn-probe baseline without changing the error a caller sees.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* refactor(rds,docdb,neptune,cloudformation): tell names from ARNs through AwsArnUtils

The startsWith("arn:") probes on name-or-ARN parameters in RDS, DocumentDB, Neptune, CloudFormation and the EC2 instance provisioner become AwsArnUtils.looksLikeArn, the same check, so a malformed ARN still gets the operation's own error. NeptuneQueryHandler reads a resource's region with AwsArnUtils.parse instead of a split.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-28 20:48:48 -04: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
Vũ Thế Huy d3c4732b31 feat(cloudformation): provision Redshift event subscriptions (#6664)
* feat(redshift): support event history and SNS notifications

* fix(redshift): guard stale delivery failures and prune all event scopes

* feat(cloudformation): provision Redshift event subscriptions

* fix(redshift): scope snapshot events and serialize subscription tag mutations

* feat(cloudformation): provision Redshift event subscriptions

* fix(cloudformation): resolve Redshift subscription list parameters

Use the shared list reader for SourceIds and EventCategories. Cover CommaDelimitedList and List<String> parameters through the AWS SDK and verify concurrent tag requests preserve CloudFormation tag updates.

* fix(redshift): honor event disablement and restore rollback attributes

Check the EventBridge external service key before publishing API events. Snapshot and restore CloudFormation resource attributes alongside subscription state during in-place rollback.

* fix(redshift): drop API event publisher and share subscription setup

Remove RedshiftApiEventPublisher, its handler hook, tests and docs, which are not part of the CloudFormation resource and emit CloudTrail-style events without a trail. Route createSubscription and replaceSubscription through one helper that normalizes the subscription fields.
2026-10-27 23:28:52 -04:00
Hector Ventura 02cc40bb40 chore(rename): rewrite the Quarkus env-var form of the package (#6773)
Quarkus spells a log category in an environment variable upper-cased with underscores (QUARKUS_LOG_CATEGORY__IO_GITHUB_HECTORVENT_FLOCI_...). The rename tool matched only the dotted and path forms, so apply left those references on the old package and report did not count them. Both now handle the env-var form, and the leftover check in the test is case-insensitive so a missed uppercase form fails it.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-27 19:16:53 -04:00
TATSUNO “Taz” Yasuhiro 3370d0ff62 chore(style): remove var and inline qualified names from more files no open PR touches (#6768)
Each var now names the type javac inferred for it, and each fully qualified type name is
imported instead. The suppression list keeps only the files that open pull requests edit.
2026-10-27 17:53:15 -05:00
TATSUNO “Taz” Yasuhiro 33e74f7728 chore(style): remove var and inline qualified names from files no open PR touches (#6710)
* chore(style): remove var and inline qualified names from files no open PR touches

Each var now names the type javac inferred for it, and each fully qualified type name is
imported instead. The suppression list keeps only the files that open pull requests edit.

* chore(style): catch qualified names before a member, a nested type or .class, and on annotations

UnnecessaryFullyQualifiedType does not report those. A MatchXpath rule under the same id now
does, with the same exemption for a simple name that another type in the file uses. The files
no open PR touches import them instead.
2026-10-27 11:38:32 -04:00
Vũ Thế Huy 3d30bbcf7a feat(redshift): add event subscriptions with SNS delivery (#6705)
* feat(redshift): add event subscriptions with SNS delivery

Add Create, Modify, Delete and DescribeEventSubscriptions, subscription tagging, and publication of matching events to the subscription's SNS topic, honouring the topic policy.

* fix(redshift): deliver events from a consistent subscription snapshot and reject nameless subscription ARNs

Delivery copied no state under the lock modifySubscription holds, so a concurrent
update could change the topic between matching and publishing. Match and publish
from a snapshot taken under that lock.

A tag ARN ending in eventsubscription: passed an empty name to
describeSubscriptions, which lists all subscriptions. Reject it up front.
2026-10-27 11:34:38 -04:00
Hector Ventura 108110563e chore: import fully qualified types in lambda and s3 (#6737) 2026-10-27 10:21:23 -04:00
Hector Ventura 52a2e37f69 chore: import fully qualified types, appsync to iot (#6738) 2026-10-27 10:17:55 -04:00
Hector Ventura 2eaf268727 chore: import fully qualified types, lifecycle to verifiedpermissions (#6739) 2026-10-27 10:15:26 -04:00
Matheus Oliveira 97ecbdd656 fix(iam): authorize S3 Control routes as their own s3 actions (#6681)
* fix(iam): authorize S3 Control routes as their own s3 actions

S3 Control clients sign with the s3 scope, so under IAM enforcement its
/v20180820 routes fell through to the S3 data-plane rules and were
checked as s3:GetObject, PutObject or DeleteObject on a bucket named
v20180820, which no policy can name: a role allowed
s3:ListTagsForResource on a bucket was denied its tag list, and
Terraform's AWS provider, which reads bucket tags through S3 Control,
never fell back to GetBucketTagging, leaving aws_s3_bucket unrefreshable.

Map the routes to the actions the Service Authorization Reference gives
them: ListTagsForResource, TagResource and UntagResource are checked
against the ARN the route names, as written and decoded as the handler
decodes it; ListAccessPoints and the account-level Block Public Access,
to which the S3 User Guide gives no resource, against every bucket in
the request's partition; the account control takes the
PutAccountPublicAccessBlock and GetAccountPublicAccessBlock actions. A
data-plane operation under the same prefix keeps its own bucket-and-object
ARN. A denial now answers in S3 Control's own ErrorResponse envelope, the
only one the s3control SDK deserializers read, so the message naming the
missing action survives to the client.

Closes #6537

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* fix(iam): answer the three control-route gaps the review found

A tagging query on a control route still reached the data-plane override,
so GET /v20180820/tags/<arn>?tagging was checked as s3:GetObjectTagging
while the handler read the bucket's tags: the control rules now match
before the query overrides, and a caller holding only the object action
is denied where one holding the control action passes. A tagging ARN in
the regional form was rewritten to the global form downstream and its
bucket misread, so a policy naming the regional form the API reference
requires was denied; the provider now keeps a control tagging ARN as
written and reads the bucket it names. The account actions returned
arn:<partition>:s3:::*, which a bucket-scoped statement matches; they
now return the literal wildcard, so a bucket-scoped statement grants no
account-wide action, the convention the KMS no-resource actions
follow.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* fix(iam): drive S3 Control route authorization from AWS's own data

The s3control model is vendored in rest-routes.json, regen_rest_routes
carries it under the s3 scope, as s3control signs with s3, and
IamRestRouteCoverageTest checks every S3 Control route Floci serves
against the Service Reference. The hand-written S3_CONTROL_RULES and
S3_CONTROL_ACTIONS lists are gone: the control routes are entries of the
one rules table, flagged to match before the S3 data-plane query
overrides so ?tagging on a tagging route cannot re-point the
authorization, and a denial answers in S3 Control's ErrorResponse
envelope by following the route instead of an action-name list. The
account-level Block Public Access is the one written-down exception, as
the reference files S3's and S3 Control's Get, Put and
DeletePublicAccessBlock under the bucket actions and the Block Public
Access page gives the account level its own actions.

A tagging ARN is read once, by the handler, the IAM check and the
bucket-policy lookup together: S3ControlArnUtils decodes and parses it
with AwsArnUtils.parse, and the regional form's account is the account
whose bucket the request acts on, so a grant on
arn:aws:s3:us-east-1:222222222222:bucket/reports no longer lets a
caller in 111111111111 read and change the tags of its own same-named
bucket: it reads and writes 222222222222's bucket, and answers
NoSuchBucket when that account holds no bucket of the name.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* fix(s3): read the policy provider's ARNs without decoding them

The provider received every ARN already decoded, the data plane's from
the request path and a control tagging one re-minted by the rule that
read it off the wire, but the one-parse helper decoded again, so an
object key carrying a plus sign or a literal percent sequence changed
its bytes before IAM checked it: a policy on arn:aws:s3:::example/a+b.txt
denied the very object it named. The provider parses without decoding
now; the wire decode stays where it belongs, at the control request
boundary.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-27 10:12:51 -04:00
Hector Ventura 6b10bf24c9 chore: import fully qualified types in events, pipes and scheduler (#6736)
Replaces inline fully-qualified class names with imports in five files and drops the two NoFqcn suppressions that covered them. ScheduleInvoker and its test each import one of the two NetworkConfiguration types and keep the other qualified, with a comment naming the clash.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-27 10:08:57 -04:00
Andre Kurait 52c9c51a7b fix(dynamodb): enforce the default Select for IAM (#6702)
* fix(dynamodb): enforce effective read selection in IAM policies

Preserve generated action and request-member coverage, effective read projections, PartiQL attributes and independent BatchGetItem contexts. Rebase on current main and scope condition data verification to its vendored file, generator, tests and imported modules, retaining all existing IAM data gates.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(dynamodb): derive transaction read conditions from modeled members

Use the generated transaction Get member paths before GetItem IAM extraction, so ignored legacy projection members cannot authorize whole-item reads.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-27 10:05:55 -04:00
Hector Ventura 31b48c30be refactor(cloudformation): check ARNs through AwsArnUtils (#6486)
* refactor(rds): read and check ARNs through AwsArnUtils

RdsQueryHandler read the region of an instance ARN and rebuilt its subnet
group ARN by splitting it; those now use regionOrDefault and parse, and the
service-local regionFromRdsArn copy is gone. Six startsWith("arn:") probes in
RdsService become isArn where the result is the same for every input: replica
link names Floci stored itself, the instance and cluster list filters, the
tag-resource region default and the cluster lookup by reference.

The seven other probes stay. They treat any value starting with arn: as an
attempted ARN, so a malformed one gets InvalidParameterValue (or its own not
found error); isArn would send it down the identifier path and change the
error.

No behaviour change. The partition baseline drops from 144 to 136.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* refactor(cloudformation): check ARNs through AwsArnUtils

Seven startsWith("arn:") probes become AwsArnUtils.isArn where the result is
the same for every input: the deleted-stack and live-stack lookups by ARN,
where a malformed ARN resolves to no stack either way; the change set ARN
check that only runs after resolveChangeSetName has rejected malformed ARNs;
and the Batch, Bedrock AgentCore and IAM policy provisioners' checks of
physical ids Floci minted itself.

The six other probes stay: DeleteChangeSet, DeleteStack, the change set name
resolver and the change set's stack lookup give a malformed ARN its own
ValidationError or no-op, and the EC2 instance and ECS provisioners read
template values, where isArn would change how an "arn:" value resolves.

No behaviour change. The partition baseline drops from 136 to 129.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-26 22:59:04 -05:00
Hector Ventura 78278f4a04 refactor(rds): read and check ARNs through AwsArnUtils (#6485) 2026-10-26 23:34:32 -04:00
TATSUNO “Taz” Yasuhiro b0cd70401b feat(iam): check lambda:PassNetworkConnector from a table generated from the Service Reference (#6699)
* feat(lambdaweb): check lambda:PassNetworkConnector as AWS does

A revision that sets egressNetworkConnectorArn needs
lambda:PassNetworkConnector on the connector version ARN as given.
Lambda checks it after the connector ARN checks and before it looks
the connector up.

A refusal names the first policy type that refuses, in the order
identity policies, permissions boundary, session policy. An explicit
deny in a managed policy or a boundary also names that policy's ARN.

* fix(lambdaweb): apply service control policies to the account root when passing a connector

* fix(lambdaweb): name the managed policy that denies a session token caller

* feat(iam): check lambda:PassNetworkConnector from a generated table

Move the check out of Lambda Web into the IAM enforcement filter, where
iam:PassRole is checked. tools/aws/regen_iam_passed_network_connectors.py
joins AWS's Service Reference and botocore's models into
src/main/resources/aws/iam-passed-network-connectors.json, and the filter
reads it for Web Functions, MicroVM images and MicroVMs.

A MicroVM request that names no egress connector, or an empty list, passes
the Lambda-managed INTERNET_EGRESS connector, and RunMicrovm with no ingress
connector passes HTTP_INGRESS, as AWS checks them. AppSync's data source
operations are listed too, but botocore's model has no member for their
connector, so they are not read.

The refusal text now comes from AccessDeniedMessages, which
LambdaTaskAuthorizer and GetStackOutputRoleAuthorizer use as well.
2026-10-26 23:26:25 -04:00
Hector Ventura e8ef0b147e chore(ci): name the Java package in one place for tools and CI (#6596)
The docs tools, the partition gate and their registries each spelled
out src/main/java/io/github/hectorvent/floci/. tools/java_sources.py
now holds the package path, the tools import it, and services.yaml and
service_matrix.yaml list sources relative to the package root, so the
move to io.floci.aws changes one line here. A registry entry still in
the repo-relative form fails with a message naming the new form.
prefetch-images.sh finds TestImages.java by name.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-26 23:06:11 -04:00
Priamo Germosen 0410a2b4ea fix(iam): check PutEvents on each entry's event bus (#6704)
PutEvents was checked on `*`: the request-resources table gave it no
resources, as its bus is a field of each entry, which no rule read. A
policy allowing or denying events:PutEvents on one event bus therefore
did not hold for publishing.

Each entry's EventBusName is "the name or ARN of the event bus to
receive the event", and "if you omit this, the default event bus is
used". Bus policies grant events:PutEvents on `event-bus/<name>`. The
EventBridge User Guide checks events:PutEvents against "the bus, once
per entry in the request", and says "Publishing is authorized against
the bus ARN for every entry in the request. If one entry fails an
authorization condition, EventBridge denies the whole request." It says
so in its section on the Custom Event Bus, which keeps the events: IAM
namespace of the Classic one; nothing in the guide says otherwise for a
Classic bus, whose API model lists AccessDeniedException among the error
codes of an entry without saying when.

The table now reads PutEvents' `Entries[].EventBusName`, a field of each
of a list's structures, one resource for each entry:

- The generator takes a correction filling a variable from such a field,
  and finds a field whose pattern takes an ARN before a name inside a
  list's structures, as it does a top-level member, so the field gets
  `arnOf` from botocore.
- The loader reads `Name[].Field` in `fill`, and in `absent` and `arnOf`
  when it fills a variable.
- The reader gives one value for each entry, the `absent` value for an
  entry that names no bus, gives a null or a blank, as the handler's
  `asText(null)` does, and none for no entries, which stay on `*`. Each
  value that is an ARN puts its own entry's bus in that ARN's account and
  Region, checked as given and as the caller's, which the handler
  publishes to; until now the first ARN a request gave set the account
  and Region of every value.

The filter checks every resource, so one entry for a bus the caller may
not publish to refuses the whole request, as the guide gives it.

Not in this change: the events:source and events:detail-type condition
keys (Floci supplies neither), EndpointId (the handler ignores it), and
PutPartnerEvents, which stays on `*`.

The upstream drift check on a pull request now verifies only the
vendored IAM files the pull request changes, each with its generator,
its tests and the modules that generator imports. It verified all six
files whichever one a pull request touched, so this change, which
touches only the table of the resources requests name, failed on the
service namespace list, which AWS's index stopped matching when it
dropped `codestar`: drift in a file the change leaves alone. The
pull request's job passes the paths its merge commit changes to
`make iam-data-verify CHANGED=...`, which names each check it skips;
the weekly and manual runs, and a diff that cannot be read, still
check every file, so the namespace list's drift is reported there.
2026-10-26 21:52:09 -05:00
Priamo Germosen 0ec28aee68 feat(iam): read a Query list's constraints from the model (#6625)
The Query walk the managed-policy family reads its constraints through read
scalars only, and refused an operation whose input carries a list when the
vendored file loaded. It reads a list now, and a structure, which is what the
rest of this track is gated on: 34 of IAM's 180 operations carry a list or a
map, and 6 of STS's 11 do.

A list arrives numbered under its own name, Audience.member.1 or the bare
Audience.1, and a member of a list of structures carries its fields under that
prefix, as Tags.member.1.Key does. Each is named in a message the way this
package already names one, filter.1.member and tags.1.member.key, under the
index the request spelled rather than the position the member sits at, which is
what #6478 settled. The count is held to the list's own bounds with the value
left out of the message, which is the form checkListLength and the audience
check both already answer: quoting it would echo every member of the list back.
A list of no members is how an absent list arrives on this protocol, so a
required one reads as null rather than as a list breaking a minimum of 1, and
only a minimum above 1 is reachable at all. A structure member arrives as
TaskPolicyArn.Arn and is named taskPolicyArn.arn, and a request naming none of
its fields is a request without the member.

GetAccountAuthorizationDetails is the operation this wave opts in, and the one
where the model adds refusals rather than rewording an answer already given:
the handler reads none of its three declared members, so a Filter outside the
model's enum, a MaxItems outside 1 to 1000 and a Marker breaking its length or
its pattern are all answered with a 200 today. They are a 400 ValidationError
now, which is the ordering #6402 settled for this package.

A map is still refused when the file loads, and so is anything nested deeper
than a list of structures. The refusal is the point rather than a gap: this
package answers a map against the whole map today, Map keys must satisfy
constraint on PutAccountProperties, where the protocol numbers a map's entries
as Properties.entry.N.key, and no source here says which of the two AWS
answers. Reading one would reword a merged answer on the strength of a guess.

The reader the walk needs went into AwsQueryLists rather than into a third
copy. That file already reads a list's values, and StsQueryHandler holds a
private copy that captures the prefix and the index for the same reason this
one does; the STS wave is where that copy goes.

A number too large for a long is a number all the same, which the range check
reads as one now. It compared through a long before, so a MaxItems of
9223372036854775808 failed to parse, read as no number at all and reached the
operation past a maximum of 1000. The bound it breaks is one that fits in a
long either way, so the comparison carries no width of its own, and the value is
written as the number reads rather than as the request spelled it, a leading
plus or zero gone, which is what a parsed value already answered.

Seven unit tests cover the new forms, two of them on the reader, which is where
one of them found that a key naming its own member read as a member numbered
after it: the index is a number or the key is not a member's. Four wire tests
cover the operation. Removing the list branch fails four of the six list and
structure tests and two of the four wire tests: the two that stay green are
MaxItems and Marker, scalars the walk already read, so they prove the operation
was opted in rather than the walk.
2026-10-26 19:17:09 -05:00
Hector Ventura 45d4c28e33 chore(ci): start Checkstyle suppression paths below the package root (#6584) 2026-10-26 19:53:46 -04:00
David d10db3ce9b feat(ecr): repository creation templates (#5955)
* feat(ecr): repository creation templates

CreateRepositoryCreationTemplate, DescribeRepositoryCreationTemplates,
UpdateRepositoryCreationTemplate and DeleteRepositoryCreationTemplate store
templates per account and Region, keyed by prefix, with each field checked
against the service model. An update replaces the fields it sets, and an
empty string or list clears one. Templates are recorded, not applied, as
nothing in Floci creates repositories through replication, pull through
cache or create-on-push.

Closes #5804

* refactor(ecr): check repository creation templates against the vendored model

The four template actions join the registry settings in
ecr-request-shapes.json, so the handler checks their requests against the ECR
model's types, lengths, patterns and enums and answers in ECR's
"failed to satisfy constraint" form. The handwritten copies of those rules
go. What the model can't state stays in the service: appliedFor naming at
least one value, and policy text being a JSON object.

The model gives imageTagMutabilityExclusionFilters at least one entry, so an
update sending an empty list is now refused rather than clearing the filters.
Terraform omits the member when the filters are removed and moves to a mode
without exclusions, so an update that leaves the template in such a mode now
drops the filters. Before, they stayed, and every plan showed them again.

* fix(ecr): lock creation template writes, share one JSON object check and fold a trailing slash

Create, update and delete each read a template and then wrote it without a
lock, so two creates of one prefix could both succeed and an update racing a
delete wrote the deleted template back. They now take the registry lock the
registry settings use. The template policies and the registry policy share one
JSON object check that also refuses text after the object, such as {}{}.
ECR assumes a / after every prefix, so prod and prod/ are now one template.
The test helper imports Executable.

* fix(ecr): describe each template once when prefixes differ only by a slash

Describe removed duplicate prefixes before folding the trailing slash, so
prefixes prod and prod/ returned the template twice, and with maxResults 1 a
token followed by an empty page. It now removes duplicates by template key.
The lock tests use the shared testing ParkingStore instead of their own copy.
2026-10-26 19:36:42 -04:00