Commit Graph
2938 Commits
Author SHA1 Message Date
Hector Ventura fe51d2996d test(partition): cover 46 more services in the cross-partition smoke test (#5432)
* test(partition): cover 46 more services in the cross-partition smoke test

PartitionCrossServiceSmokeIntegrationTest now creates a resource in every
non-commercial partition and checks its ARN or host for: accessanalyzer,
amazonmq, apigateway, applicationautoscaling, appsync, aps, autoscaling,
backup, bedrock, bedrockagentcorecontrol, ce, cloudfront, cloudmap,
cloudwatch, codedeploy, cognito, configservice, connect, controlcatalog,
controltower, datasync, dlm, dynamodb, ec2, ecs, eks, elasticache, emr,
emrserverless, eventbridge, guardduty, lambdamicrovms, memorydb, msk,
networkfirewall, oam, opensearch, ram, rds, route53resolver, s3tables,
scheduler, secretsmanager, ses, sqs, wafv2.

Their rows leave smoke-exemptions.tsv, which takes the not-yet-covered list
from 82 services to 34. detective and securityhub leave that list with a
reason instead of a case: neither can remove what a case would create, so it
would leak into the shared emulator.

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

* test(partition): check the region in smoke-test hosts and register the Cloud Map cleanup earlier

The EKS issuer, OpenSearch endpoint, AgentCore gateway and Prometheus
endpoint cases checked only the partition's DNS suffix, so a host naming
another region of the same partition passed. They now also require the
case's region in the host.

The Cloud Map case registered its cleanup only after GetOperation
succeeded, so a failure there left the namespace behind. The cleanup is
registered as soon as the operation id is known and resolves the namespace
from it.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-11 00:23:25 -04:00
Hector Ventura 98100054a8 feat(core): make the Docker call timeout configurable (#5431)
* feat(core): make the Docker call timeout configurable

Ordinary Docker calls failed after a hard-coded five minutes without a
response. floci.docker.api-timeout-seconds (FLOCI_DOCKER_API_TIMEOUT_SECONDS)
now sets it for both pools, defaulting to 300 so nothing changes by
default; a shorter value bounds how long a hung daemon can hold a request.
Like the connection request timeout, it must be at least 1, because
httpclient5 reads 0 as no limit. Long-lived streams (container waits, exec
and attach output, followed logs, streamed stats, events, image pulls and
builds) stay exempt.

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

* docs(core): say the Docker call timeout applies to each attempt

The control-plane pool retries a request that is safe to repeat up to six
times, and a response timeout is one of the failures it retries. The docs,
the config Javadoc and the application.yml comment said the setting bounds
a request; it bounds each attempt, so a silent daemon can hold a replayable
request for about six times the limit, plus backoff.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-11 00:17:11 -04:00
Aymen JAMAAOUI 61fe304619 feat(cloudformation): provision CloudFront public keys, key groups and functions (#5390)
* fix(cloudfront): reject CreateFunction when the name already exists

* feat(cloudformation): provision CloudFront public keys, key groups and functions

* fix(cloudformation): validate CloudFront function properties and always drop its tags on delete

* fix(cloudformation): require the CloudFront function comment and reuse resolveOptional
2026-10-11 00:16:51 -04:00
Hector Ventura cce4b5f6c0 chore(core): fail fast when an ARN is minted with a blank region (#5430)
* chore(core): fail fast when an ARN is minted with a blank region

Arn.of derives the partition from the region, so a blank region that arrives through a
variable silently mints arn:aws:, which the partition-check gate cannot see. The test build
now sets a JVM system property that makes such a mint throw, naming the call site; outside
it the ARN is minted as before and the call site is logged once, so production responses do
not change.

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

* test: give two fixtures the region the blank-region guard requires

GlobalAcceleratorServiceTest mocked RegionResolver.buildArn with Arn.of, which
the real resolver never calls for the blank region Global Accelerator passes:
it mints a global ARN. The mock now delegates to a real resolver.
EventSourceMappingSerializationTest built mappings with no region, which
LambdaService always sets on create; the fixtures set one.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-11 00:11:46 -04:00
Priamo Germosen 0ab58edb3c refactor(iam): measure session expiry on the injected clock (#5382)
IamService decided whether a temporary session had expired against
Instant.now(), while AWS Sign-In stamps the expiry of the sessions it
issues from the injected Clock. In production both read the system
clock, so nothing changes there. In tests the injected clock is a
MutableClock fixed at 2026-01-01, so a Sign-In session was already
expired when it was issued: no test could use its credentials, and no
test could move a session past its expiry without waiting.

IamService now takes the injected Clock and reads it everywhere it
decides whether a session has expired: the secret-key lookup (and with
it S3 signature validation and the EKS token webhook), account routing,
the caller context, the caller ARNs, the caller user ID, and the sweep
of expired sessions. The presigned URL generator ran that sweep on its
first URL with its own system-clock time, which in tests deleted every
Sign-In session issued before it; it now asks IamService to sweep on
its own clock. IamService's package-private constructors keep the
system clock.

Those checks now also agree on the boundary: a session is expired from
the instant its expiration names. The secret-key lookup and the sweep
already drew it there, while account routing, the caller lookups and
the enforcement check still accepted a session at that instant. The
injected clock can land on it exactly, so they now share one predicate.
In production that changes the answer at that one instant only.

IAM enforcement reads the same clock. The filter asks the
expired-session check and the caller lookup about one moment, on every
request and on a presigned POST, and now takes that moment from the
injected Clock. On the system clock a live Sign-In session was refused
with ExpiredTokenException in tests with enforcement on. The filter's
package-private constructors keep the system clock.

Issuers that stamp from the system clock keep doing so. Most of them
(STS, the EC2 metadata and ECS credential endpoints, EKS Pod Identity,
the SSO portal) report the expiry to an SDK client that compares it with
its own wall clock, the SDKs inside the Docker-backed tests included.
Their sessions stay valid in tests, as before. In tests IamService now
measures them on the MutableClock, months behind the system clock, so
there they never expire and no test can move one past its expiry. No
test relied on that.

Service-specific credentials read the same clock. One with a
CredentialAgeDays reports Expired once its ExpirationDate has passed,
and that date is counted from its CreateDate, so both the stamp and the
comparison now use the injected Clock. In production that is the system
clock, as before; in tests a one-day key, the shortest AWS allows, can
now be moved past its expiry instead of having a past date planted in
the store.

A unit test moves a session past its expiry on a MutableClock through
each of the five lookups, another checks that the sweep keeps a session
live on that clock, a third holds a fixed clock at a session's
expiration and checks that every lookup, the enforcement check and the
sweep treat it as expired, and S3ValidateSignaturesIntegrationTest signs
requests with Sign-In credentials until the clock passes their lifetime.
With enforcement on, ExpiredSessionEnforcementIntegrationTest accepts a
session stamped from the injected clock until the clock passes its
expiry, then gets ExpiredTokenException, and IamEnforcementFilterTest
checks that both enforcement paths ask about the clock's moment. All of
these fail without this change. ServiceSpecificCredentialStateTest's
two expiry tests now advance a MutableClock past a one-day key's
expiry.
2026-10-10 21:29:13 -05:00
Priamo Germosen ff20750d91 fix(cloudfront): serve viewer Range GETs (#5377)
A distribution ignored a viewer's Range header: an S3 origin answered
every GET with the whole object and 200, while advertising
Accept-Ranges: bytes, and a custom origin behind a cache or origin
request policy never saw the header, so seeking in a video or resuming
a download read the object from the start.

An S3 origin now serves the one byte range asked for as 206 with its
Content-Range, read from the snapshot GetObject serves, and answers 416
when the range starts past the end of the object. Any other Range gets
the whole object, as CloudFront answers a Range it does not accept and
as S3 does not serve several ranges in one request. A custom origin gets
the viewer's Range and If-Range on every GET or HEAD with a Range
whatever the forwarding settings, as CloudFront forwards a range GET to
the origin and a HEAD can then report the range's length, and its answer
is passed on. A custom error page is served whole.

A Range now applies only while the If-Range sent with it, if any, still
describes the object: a strong ETag equal to the object's, or an
HTTP-date equal to its Last-Modified, matched exactly as RFC 9110
section 13.1.5 requires. Otherwise the whole object is served. This
holds for GetObject, HeadObject and the S3 origin. A presigned URL that
signs Range must also sign an If-Range the request carries, as the S3
User Guide requires.

HeadObject honors Range as the API Reference describes: a satisfiable
range sets Content-Length to the length of the range, leaving out the
whole-object checksum as a ranged GetObject does, and one past the end
answers 416, while a Range that is not one valid range is ignored, as
before. An S3 origin answers a HEAD the same way.

A ranged GetObject is now recorded in CloudTrail like any other, with
the bytes of the range sent, and a range past the end of the object,
for GetObject or HeadObject, is recorded as InvalidRange.

The range parsing GetObject did is now ByteRange, which both use, and
UploadPartCopy's range stream becomes ByteRangeInputStream. GetObject
now matches the range unit in any case, as RFC 9110 section 14.1 has
it, and its InvalidRange error is the one S3 sends, as an AWS-validated
LocalStack capture records it: the message "The requested range is not
satisfiable", with no trailing period, and the RangeRequested and
ActualObjectSize fields.
2026-10-10 21:29:02 -05:00
Allen SanbornandPriamo 7d71df6ac9 fix(cloudformation): honour PermissionsBoundary on AWS::IAM::Role and AWS::IAM::User (#5266)
* fix(cloudformation): honour PermissionsBoundary on AWS::IAM::Role and AWS::IAM::User

Both provisioners ignored the PermissionsBoundary property: create called
the overloads without a boundary, and an update that adopts the existing
entity never touched it.

Create now passes the resolved boundary to createRole/createUser. On the
adoption path a changed boundary is put, and one the template dropped is
deleted (only when the entity currently has one). If a later step fails,
the prior boundary is restored alongside the existing trust-policy/path
rollback.

* fix(cloudformation): treat a blank PermissionsBoundary as absent

Fn::If with Ref AWS::NoValue resolves to an empty string, which the CDK
bootstrap template uses for CloudFormationExecutionRole when no boundary
is configured. The role and user provisioners passed that through and
failed with "Policy  does not exist." Resolve the property with
resolveOrDefault so a blank value means no boundary.

* fix(cloudformation): ID-verify permissions boundary writes on adopted IAM roles and users

The boundary write and its rollback restore went through name-only
IamService methods, so a role or user deleted and recreated under the
same name after adoption could receive them; a rollback restoring "no
boundary" would strip the replacement's boundary. Add put/delete
permissions boundary overloads that take the expected immutable ID, as
updateAssumeRolePolicy and updateUser already do, and pass the adopted
ID for both the primary write and the restore.

* fix(iam): verify role IDs under the name lock on boundary and trust-policy writes

The ID-verified role writes looked the role up and wrote it back outside
resourceNameLock, while createRole holds it. A role deleted and recreated
between the lookup and roles.put got the stale object written over it,
which is the case the ID check exists to stop. They now take the lock, as
the user-side writes already do.

updateUser and updateAssumeRolePolicy call requireSameUser and
requireSameRole instead of repeating the check inline.

* test(iam): stub the role lookup GetRole now makes

roleResponsesWriteMillisecondTimestamps builds a mock IamService and stubbed
getRole, but handleGetRole reads the role through getValidatedRole, which #5391
added so every role action validates its RoleName first. An unstubbed method on
a Mockito mock answers null, so the handler rendered a null role and all nine
parameterized rows failed with a NullPointerException on getPath().

Neither change is wrong on its own base. #5110 added this test and #5391 moved
the lookup it exercises, and each was green where it was written. Together on
main the class is red.

The stub names getValidatedRole because that is what the handler calls. Nothing
else moves: the handler's other role paths still read getRole, and so do the
CloudFormation provisioner tests that stub it.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-10 20:15:37 -04:00
David Phillips 23e6fce6ef fix(rds): report the default managed secret key (#5420)
* fix(rds): report the default managed secret key

Clients need the key identity for a managed master secret even when they
omit a customer key. Report the actual Secrets Manager default key in the
database's account and region so the returned ARN resolves through KMS.

* fix(rds): keep failed managed-key requests retryable

* fix(rds): recover managed keys for saved databases

* fix(rds): recover saved managed keys during startup

* fix(rds): reuse account scopes for saved key recovery
2026-10-10 19:39:13 -04:00
Matheus Oliveira b2b083ee91 fix(iam): validate RoleName in every role action (#5391)
Every action whose RoleName is roleNameType now answers a bad name with ValidationError instead of NoSuchEntity, as CreateRole does.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-10 17:58:43 -04:00
David Phillips 60837956de fix(rds): reject tag ARNs from another partition (#5419)
* fix(rds): reject tag ARNs from another partition

A tag request must identify the resource in the current account, region
and partition. An ARN from another partition must not read or change a
same-named local resource.

* fix(rds): preserve tagging in custom regions

* fix(rds): preserve event tags in custom regions

* fix(rds): repair saved custom-region event ARNs

* fix(rds): preserve restored proxy target group partitions
2026-10-10 17:25:27 -04:00
Andre KuraitandPriamo 3cdc9ef22d fix: serialize IAM and STS Query timestamps with millisecond precision (#5110)
* fix: format IAM and STS Query timestamps at millisecond precision

Truncate only the Query XML projection, preserving stored instants and
session expiration. Cover nanosecond inputs, millisecond and second
boundaries, and timezone offsets with direct mocked handler tests.

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

* fix(iam): write credential report times as AWS does, pin STS test time

The credential report CSV still wrote ISO_INSTANT at nanosecond
precision with a trailing Z. The IAM User Guide's example report writes
2014-10-15T16:31:25+00:00, whole seconds with a numeric offset, so the
report now uses that form.

The AssumeRole expiration test pinned time by static-mocking
Instant.now(). StsQueryHandler gains a package-private constructor that
takes a Clock (the CDI constructor keeps the system clock), and the test
moves into StsQueryHandlerTest on its existing harness. The IAM cases
move to IamQueryHandlerTest; input offsets, which only exercised JDK
parsing, are dropped.

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-10 16:46:17 -04:00
Vũ Thế Huy 972ff03f00 fix(redshift-serverless): return HTTP 400 for ResourceNotFoundException and ConflictException (#5409) 2026-10-10 15:16:21 -04:00
XuJian 58ac05433a fix(ses): return Easy DKIM signing hosted zone (#5068)
* fix(ses): expose DKIM signing hosted zone

* fix(ses): keep DKIM signing hosted zone constant

* fix(ses): align signing zone tests with review
2026-10-10 15:13:20 -04:00
Hector Ventura fb202cce6a fix(eks): accept a role ARN from another partition the way STS does (#5398)
* fix(eks): accept a role ARN from another partition the way STS does

An account keeps one IAM namespace whichever partition a request is for
(partitions.md, Known gaps). STS AssumeRole already resolved a role ARN
from another partition to the account's role, while EKS Pod Identity and
add-ons required the cluster's partition and an exact stored-ARN match.

Move the STS role-ARN matcher to IamService.roleArnMatches and use it for
the Pod Identity roleArn and the add-on role ARNs; targetRoleArn accepts
any well-formed partition. The Pod Identity session names the stored
role's ARN, as an STS session does. The EKS model sets no pattern on
roleArn or targetRoleArn.

* fix(eks): keep a role recreated under another path out of a pod identity session

The credentials endpoint finds the association's role by name only. Since
the session started naming the stored role's ARN, a role deleted and
recreated under another path gave the session its ARN and role id through
the old association. The found role now has to match the association's
role ARN the way roleArnMatches does everywhere else; one that does not is
treated as absent, as before this branch.

The association test also checks that a rejected role update leaves the
stored role ARN as it was.

* fix(eks): refuse pod identity credentials when the association's role is gone

EKS Auth assumes the association's role through STS, so a role that no
longer exists gets no credentials. The endpoint still issued them, and
since enforcement loads a session's policies by role name, a pod whose
role was recreated under another path ran with the replacement's policies.

A role that is missing, or that does not match the association's role ARN,
is now a 400 AccessDeniedException and no session is registered.
2026-10-10 14:54:12 -04:00
Sam Fakhreddine 29319fbfb5 fix(lambda): default event source mapping BatchSize by source type (#5362)
CreateEventSourceMapping stored BatchSize 10 for every event source when
the request omitted it. The Lambda model documents a per-source default:
10 for SQS and 100 for Kinesis, DynamoDB Streams, Amazon MSK, self-managed
Apache Kafka, Amazon MQ and DocumentDB. SQS mappings keep 10; every other
source now defaults to 100.

updateEventSourceMapping_invalidLaterField_leavesBatchSizeAndEnabledUnchanged
asserted the untouched Kafka mapping kept the old default of 10; it now
expects 100.

Fixes #4740
2026-10-10 14:02:20 -04:00
Mario Toffia 1082941bc2 feat(iot): search the supported fleet index subset (#4913)
Floci served the fleet indexing configuration but not SearchIndex, so
an application that finds its things by name, type, group or attribute
got "Unknown operation: POST /indices/search".

SearchIndex now runs on POST /indices/search over the things of the
caller's account and region, in thing name order. Its page token names
the last thing returned, so a page continues after it even when things
before it were deleted, as measured on AWS. Like AWS's, a token
continues only the request that issued it: another queryString, or an
indexName or queryVersion sent differently, is "nextToken was from a
request with different parameters", and an empty, forged, edited or
truncated token is "Invalid nextToken". A new parser,
IotFleetIndexQuery, evaluates field:value terms with case-insensitive
values, case-sensitive field names, * and ? wildcards, existence and
match-all, quoted values, AND, OR and NOT with their symbolic forms,
leading - negation and parentheses. Precedence is the one measured on
AWS, where whitespace is an AND that binds looser than OR. The fields
are thingName, thingId, thingTypeName, thingGroupNames and attributes.*.

Requests are validated with the messages and in the order measured on
AWS: a body that is not a JSON object and every member type, member
constraints, index name, query version, a disabled index, the query,
then the page token. Within the query a syntax error comes first, then
the 12-term limit, in which each value of a field group counts and the
field does not, then the first other error, where the field of a group
is checked like any other field. A range counts as one term, and a
malformed range or an unescaped bracket outside one is a syntax error.
AWS's limits hold: a queryString of at most 1000 characters, at most 12
terms, at most two * wildcards in a value and no value starting with ?.
maxResults takes any number, truncated toward zero and capped at the int
range as on AWS. A classic shadow field needs REGISTRY_AND_SHADOW
indexing, and a named shadow field named shadow indexing and a shadow in
its filter, or it is AWS's invalid field name. Constructs AWS accepts
but Floci does not evaluate, such as ranges, comparisons, free text,
field grouping and shadow or Device Defender fields, are refused with
InvalidQueryException instead of matching nothing, and so is a search of
AWS_ThingGroups. Connectivity fields are refused like shadow and Device
Defender fields: AWS's InvalidRequestException while connectivity
indexing is off, InvalidQueryException once it is on. Documents leave
out the members a thing lacks and never carry a shadow or a
connectivity member, where AWS adds connectivity while connectivity
indexing is on.
2026-10-10 13:56:54 -04:00
Aniket Shukla 2015d01864 fix(appconfig): support deleting environments (#5337)
* fix(appconfig): support deleting environments

* fix(appconfig): cascade environment deletion

* fix(appconfig): preserve deployment numbering

* fix(appconfig): resolve delete identifiers
2026-10-10 13:45:28 -04:00
Hector Ventura c6068e8cf5 chore(iam): generate the managed-policy catalog from iam-dataset (#5403)
* chore(iam): generate the managed-policy catalog from iam-dataset

The three managed-policy resources were hand-seeded in #2194, #3237 and #3275,
so nothing noticed when AWS added or revised a policy. tools/aws/
regen_managed_policies.py now rebuilds them from the local/aws/iam-dataset
checkout: names, paths, versions and update dates from
aws/managed_policies.json, documents from aws/managedpolicies/. Deprecated
policies leave the catalog except AWSLambdaFullAccess, which #2194 kept on
purpose. createDate (from the AWS managed policy reference pages) and the
curated descriptions are not in the dataset and are carried over.

It joins make aws-data-sync and aws-data-check. CI has no iam-dataset, so
there the check verifies the three files agree and keep their shape, the way
regen_region_facts.py handles its missing corpus.

This commit changes no data; only the catalog header gains a generated-by
line. The files were taken from three dataset days, and the generator
reproduces each from its own: the names from 2026-08-12 (f18cb038), the
versions from 2026-09-08 (a52abe16), and the documents from 2026-09-08 too,
except AWSCodeStarServiceRole, which matches 2026-09-07 (1c729479).

* chore(iam): refresh the managed-policy catalog from iam-dataset 2026-09-19

make aws-data-sync against the local/aws/iam-dataset checkout (72d2a4f62,
2026-09-19). Catalog 1566 -> 1578 policies:

- 12 added: AIDevOpsChannelAccessPolicy, AIDevOpsReleaseManagementVPCPolicy,
  AWSWellArchitectedAgentOrganizationsServiceRolePolicy,
  AmazonBioDiscoveryFullAccess, AmazonBioDiscoveryInAppFullAccess,
  AmazonODBAutonomousDatabaseAdmin, AmazonODBExadataVmClusterAdmin,
  AmazonODBExascaleStorageVaultAdmin, AmazonODBExascaleVmClusterAdmin,
  AmazonSageMakerHyperPodInferenceGatewayAccess, AssuranceServiceRolePolicy,
  NetworkSecurityManagerServiceRolePolicy. All are on v1, so their
  createDate is the dataset's date.
- 0 removed.
- 22 changed: 21 moved to a new default version with a new document and
  update date (among them ReadOnlyAccess and SecurityAudit), and
  AWSCodeStarServiceRole kept v12 but took the document and update date
  the dataset recorded on 2026-09-08.

No path or description changed, and the service-linked role table still
matches the documents (make slr-check).

* chore(iam): make the managed-policy generator's date fetch and offline check stricter

--fetch-create-dates now reads the reference page of every policy past v1
that has no creation date, not only of policies new to the catalog, so a
policy first vendored without the flag can be dated by a later run. A page
that cannot be read leaves that one policy undated with a warning instead
of ending the run with nothing written.

The offline check compares the catalog with a re-render of its parsed
entries, so content outside the generated header and policy entries fails
it instead of passing unnoticed.

* chore(iam): refresh the managed-policy catalog from iam-dataset 2026-10-09

The dataset moved after the first refresh. Regenerated against 2244bd78a
(2026-10-09) with --fetch-create-dates. Catalog 1578 -> 1586 policies:

- 11 added. Ten are on v1 and take the dataset's date;
  AWSCloudWatchOmniServiceRolePolicy is on v2 and takes its creation date
  from its reference page.
- 3 removed: the CloudWatch Evidently policies, which the dataset now
  marks deprecated.
- 45 moved to a new default version, among them SecurityAudit (v94) and
  ReadOnlyAccess (v190).

The generated header said createDate falls back to the dataset's date for
a policy with no reference page. It does so only for a policy that entered
the catalog on v1; one past v1 stays undated, and the header now says so.
AWSConfigRole is still the only policy without a creation date.
2026-10-10 13:40:04 -04:00
Hector Ventura a1f90453fb fix(apigateway): refuse EDGE REST APIs outside the commercial partition (#5397)
Edge-optimized endpoints exist only in the commercial partition.
CreateRestApi and an UpdateRestApi switch of /endpointConfiguration/types
now run the same check custom domains already use, so an EDGE REST API in
China, GovCloud, ISO or EUSC is a BadRequestException. REGIONAL APIs, and
a move away from EDGE, are still accepted everywhere.
2026-10-10 12:07:42 -04:00
Vũ Thế Huy 475d230ebc feat(cloudformation): provision ElastiCache cache clusters and subnet groups (#5307)
* feat(cloudformation): provision ElastiCache cache clusters and subnet groups

Add AWS::ElastiCache::CacheCluster and AWS::ElastiCache::SubnetGroup provisioners with Ref, Fn::GetAtt endpoint attributes, create-only replacement and update handling. Subnet group updates now carry tags through modifyCacheSubnetGroup, and Memcached clusters record their network type.

* fix(elasticache): validate cluster name, rollback subnet groups and preserve memcached tags

* fix(elasticache): align in-use error wire code and enforce schema required properties
2026-10-10 11:11:00 -04:00
Vũ Thế Huy 141fd747ee feat(redshift-serverless): add usage limit actions (#5378)
* feat(redshift-serverless): add usage limit actions

Add CreateUsageLimit, GetUsageLimit, ListUsageLimits, UpdateUsageLimit and
DeleteUsageLimit, following the botocore redshift-serverless model.

Usage limits are stored and echoed, not enforced: Floci does not meter RPU
consumption, so breachAction never fires. A limit belongs to a workgroup,
at most one per usageType, and disappears with it. The service checks the
workgroup on read instead of hooking deleteWorkgroup, so deletes through
CloudFormation are covered too.

* fix(redshift-serverless): reject malformed usage limit members and purge stale limits on read

- Usage limit string members of another JSON type (a numeric period,
  breachAction, resourceArn, usageType, usageLimitId or nextToken) were read
  as absent, so a create took the defaults, an update ignored the action and
  a list dropped its filter. They are now a ValidationException.
- maxResults accepted fractional and out-of-range numbers and truncated them.
  It must be an integer that fits an int.
- GetUsageLimit and the other id lookups answered 404 for a limit whose
  workgroup was gone but left the record in storage; they now delete it.
- Listing checked every limit with a full workgroup scan. It now takes one
  snapshot of the Region's workgroup ARNs per scan.
- Add a paging test that deletes the limit behind the nextToken.

* fix(redshift-serverless): permit multiple usage limits per type and return 400 on missing resources

- Remove the one-limit-per-usageType check on CreateUsageLimit so a workgroup can have multiple limits for the same usage type with different periods (e.g. daily and monthly serverless-compute).
- Align ResourceNotFoundException on usage limit actions with the AWS Redshift Serverless API specification by returning HTTP 400 instead of 404.
- Update documentation and test assertions accordingly.
2026-10-10 11:06:34 -04:00
Niels Kootstra 546d7e894e ci: abort hung tests with a thread dump and time out a stuck surefire fork (#4940)
* ci: abort hung tests with a thread dump and time out a stuck surefire fork

A hung test ran until the 20-minute job limit killed the shard, leaving no surefire report that named it.

Give every test and lifecycle method a 2-minute JUnit default with a thread dump, set through surefire configurationParameters so quarkus-junit's own junit-platform.properties (its profile-aware class orderer) is not shadowed. In CI, -Dsurefire.timeout=900 kills a fork whose test ignores the interrupt (deadlock, blocking I/O) before the job limit; shards' test steps take 10-11 minutes. SageMakerDockerIntegrationTest waits up to 150 s for real containers, so it gets a 3-minute timeout.

* test: give two Docker-backed tests a timeout that covers their own waits

EksRegistryHostsDockerIntegrationTest (three 60 s cluster-ready waits plus 105 s of polling) and TimestreamInfluxDbDockerIntegrationTest (three 180 s status waits) can legitimately run past the new 2-minute default.

* ci: size the fork timeout to the slowest shard and cover the remaining long tests

surefire.timeout caps a whole shard, and shard 2 already spends 903 s running tests, so 900 s would kill a passing run. Raise it to 1200 s and the job limit to 25 minutes so surefire still reports first. Give the Timestream test headroom beyond its 540 s of status waits, and the opt-in GPU SageMaker test a timeout covering its 300 s poll.
2026-10-10 09:22:05 -05:00
Hector Ventura 8b83892dff fix(eks): mirror the cluster's own region and account in the registry config (#5399)
The k3s registries.yaml listed the default account across the regions of
the deployment's partition, so a cluster in another account, or in a region
of another partition served by the same process, could not pull from
Floci's ECR through its own repository hostnames.

Build the mirror from the cluster's account (then the default account)
across every region of the cluster's partition. A commercial cluster in
the default account gets the same file as before.
2026-10-10 10:20:40 -04:00
Priamo Germosen 3ff5529fad feat(codeartifact): add PutPackageOriginConfiguration (#5381)
Sets a package's publish/upstream origin-control restrictions, matching
AWS's documented behavior that this operation can create the package
(with no versions) when it doesn't exist yet, so a caller can lock a
package down before anything is ever published to it.

DescribePackage now reflects a stored configuration instead of the
fixed ALLOW/BLOCK defaults it previously always returned, and
PublishPackageVersion rejects a publish with ConflictException once a
package's origin configuration sets publish to BLOCK, the one publish
path this operation can actually gate since PublishPackageVersion only
ever accepts the generic format. Maven/npm/pypi publish through their
own native wire protocols and are not yet gated by this setting,
documented as a known limitation.

The format/namespace coordinate validation shared with DescribePackage
is extracted into one helper instead of being duplicated a second time.
clear() (the Resettable reset path) now also clears the new store; it
previously left an origin-config-only package (no versions) visible to
DescribePackage after a reset that wiped everything else.

DescribePackage's existence check for an origin-config-only package now
short-circuits before the sidecar/generic check runs at all: for a
container-backed format that check would otherwise start the real
Maven/npm/pypi sidecar container just to answer a describe for a
package nothing was ever actually published to.

DeletePackage now agrees with DescribePackage on all of this instead of
drifting from it. Its deletedPackage.originConfiguration reports the
restrictions that were actually stored, not a hard-coded ALLOW/BLOCK;
it clears the stored configuration as part of the delete, so a deleted
package cannot resurrect as a zero-version one on the next
DescribePackage; and it now recognizes an origin-config-only package
(no version ever published) as something it can delete, rather than
404ing on a package DescribePackage itself reports as existing.
DeletePackage's own namespace/format validation, previously a second
inline copy of the same rules, now goes through the shared helper too.

A rejected PutPackageOriginConfiguration now also has a test asserting
an invalid/missing upstream value alone is rejected (the prior tests
only exercised publish) and that a rejection, on either a package that
didn't exist yet or one with a prior configuration, changes nothing.

deleteRepository now also removes any packageOriginConfigs entries
under that repository: unlike sidecarContainerIds, which already gets
a fresh id on every creation specifically so a repository recreated
under the same name never inherits the previous one's sidecar content,
packageOriginConfigs was keyed purely by name, so a recreated
repository would otherwise inherit a prior package's restrictions,
including a publish:BLOCK the new repository's owner never set.
2026-10-10 08:50:58 -05:00
Priamo Germosen 44ee88b829 test(iam): leave no user, key or bucket behind in the enforcement suites (#5379)
InactiveAccessKeyEnforcementIntegrationTest, CborAccessDeniedEnforcementIntegrationTest
and ExpiredSessionEnforcementIntegrationTest create their fixtures and have no
reason to remove them, so between them the classes finished with three IAM users
and their access keys still in the default account, one more in another account,
two buckets and an object, and two expired sessions. A QuarkusTest shares one
application across classes, so those outlived the class and were visible to
anything listing users or buckets unscoped. A class placed after these three
sees all three default-account users and both buckets without this change, and
sees none of them with it.

The cleanup goes through PartitionCleanup, which the tree already uses for
exactly this: a resource left in the shared application that the next class to
list unscoped can see. Each undo is registered before the create that needs it
runs, and the extension runs them in reverse after the test, each one
independent of the others. So a setup that fails part way through still has the
whole fixture taken away, and a bucket that will not delete cannot keep a
session from being unregistered.

The two removals that more than one class needs are in EnforcementFixtures.
Both read back what is attached rather than taking it as an argument, which
covers a key or a policy whose create the test never saw the response of, and
both return quietly when the thing is not there, which is what makes it safe to
register them before the create. removeUser takes the inline policies and
access keys first, because AWS lists both among the items to remove "before
attempting to delete a user" and Floci answers DeleteConflict for each.
removeBucket empties the bucket first, because S3 refuses to delete one that is
not empty.

The expired sessions go too. What that test pins is that a refusal leaves them
stored, so nothing takes them out until Floci's own sweep runs.

PartitionCleanup's javadoc was written for the partition case alone, although
CloudTrailSelfDeliveryTest was already using it outside that story. It now says
what it is for.

Refs #5346
2026-10-10 08:50:48 -05:00
Matheus Oliveira 47dae887f9 fix(lambda): list $LATEST first, then versions in numeric order (#5376)
Sort stored versions numerically so ListVersionsByFunction is stable and matches AWS.

* Fix #5121

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-10 09:41:44 -04:00
Kenshin Okinaka 6d76af0834 fix(ses): reject malformed send addresses with AWS's messages (#5380)
* fix(ses): reject malformed send addresses with AWS's messages

Sends accepted any address string. AWS checks every address of a send
with JavaMail's strict InternetAddress rules and answers with its
messages (probe-confirmed in us-west-2):

- no '@': Missing final '@domain'
- empty domain: Missing domain
- control, whitespace or non-ASCII in the local part:
  Local address contains control or whitespace
- the same in the domain: Domain contains control or whitespace

v1 returns InvalidParameterValue, v2 BadRequestException. Display
names, comments, encoded words, Punycode and dotless domains pass.
The check runs after the missing-sender check and before the
destination, configuration set, length and template checks, over the
sender, To, Cc, Bcc, return path and Reply-To, and on raw sends over
the Source and Destinations parameters and the From and To headers.
A bulk send reports a malformed or over-long sender as "Invalid email
address<addr>." ahead of a missing template, and a malformed bulk entry
recipient fails only that entry.

The field walk shared with the 320-character check moves to
SesSendAddresses so both checks visit the same fields in one order.

* fix(ses): check bulk reply-to and return path, quoted CR/LF and quoted '<'

Review follow-ups, probe-confirmed in us-east-1 with a verified sender:

- A malformed bulk Reply-To fails every entry with the JavaMail
  message, while a malformed bulk return path (v1 ReturnPath, v2
  FeedbackForwardingEmailAddress) rejects the whole request as
  "Invalid email address<addr>.", like the sender.
- A CR or LF inside a quoted local part is rejected, even when followed
  by whitespace, as "Invalid email address <addr>.".

A '<' inside a quoted local part is no longer taken for the start of
the angle-bracketed address, in both the syntax and the length check.
The syntax tests now also assert that a rejected send is not recorded.
2026-10-10 08:40:49 -04:00
Daniël van Ziel 517409a7aa fix(cloudcontrol): bound the worker queue and reject overflow (#4479)
Replace the unbounded fixed thread pool with a bounded worker queue,
sized by floci.services.cloudcontrol.create-worker-threads (default 4)
and create-queue-capacity (default 64). These are Floci limits, not AWS
quotas. A new CreateResource past them is refused with
ThrottlingException, HTTP 400, which is the status the Cloud Control
API reference gives it on CreateResource and in Common Errors. The
pending token is dropped so it is not left unfulfillable.

Startup replay of persisted CREATE requests does not apply that bound.
When the worker queue is full, an already-accepted request is parked
and handed to the executor by a daemon drainer once a slot frees,
instead of blocking the request that constructs Cloud Control until a
provisioning task finishes. Shutdown interrupts the drainer; parked
requests stay persisted and replay on the next start.

A create that fails while Cloud Control is shutting down is no longer
recorded as FAILED. Shutdown interrupts in-flight provisioning, so the
failure is the shutdown's: the request stays IN_PROGRESS and replays
on the next start, like the queued and parked ones. Worker threads are
now numbered.

Narrow the persisted-state parse catch so a submission failure is no
longer misreported as invalid JSON.

Document the limit and both settings.
2026-10-10 00:02:30 -04:00
Sam Fakhreddine c3133f14c3 fix(lambda): validate members the model bounds (ESM Topics, S3 code, alias, LicenseInfo) (#4989)
* fix(lambda): enforce Topics and SourceAccessConfigurations limits on event source mappings

CreateEventSourceMapping and UpdateEventSourceMapping only checked that
Topics was a non-empty list of strings. The model allows at most one
topic, each 1-249 characters matching [^.]([a-zA-Z0-9\-_.]+), and at most
23 SourceAccessConfigurations. Both paths now reject a violation with the
ValidationException message the other Lambda member checks use; the update
path checks before it applies any change.

EsmIntegrationTest.createSelfManagedKafkaEventSourceMapping created a
mapping with two topics, which AWS rejects, so it now uses one.

Refs #4607

* fix(lambda): validate the UpdateFunctionCode S3Bucket and S3Key members

UpdateFunctionCode passed S3Bucket and S3Key straight to the S3 fetch, so a malformed value came back as ServiceUnavailableException. The model limits S3Bucket to 3-63 characters matching [0-9A-Za-z\.\-_]*(?<!\.) and S3Key to 1-1024; both are now checked before the function changes, with the Lambda ValidationException format.

Refs #4607

* fix(lambda): validate alias FunctionVersion and Description

CreateAlias and UpdateAlias stored any FunctionVersion and Description. The model limits FunctionVersion to 1-1024 characters matching (\$LATEST(\.PUBLISHED)?|[0-9]+) and Description to 256; both methods now check them before touching the alias, with the Lambda ValidationException format.

Refs #4607

* fix(lambda): validate the PublishLayerVersion LicenseInfo length

PublishLayerVersion stored a LicenseInfo of any length; the model caps it at 512 characters. It now reuses LambdaService.validateMaxLength (made package-private, like validateEnumList, which the layer service already calls).

Fixes #4607

* fix(lambda): validate empty topics and cap SourceAccessConfigurations for every ESM source

An empty Topic now fails the Topic shape's min length with a ValidationException, the 23-entry SourceAccessConfigurations cap applies to ARN sources as well as self-managed Kafka, and the shared max-items check is reused. Tests: one-topic CloudFormation Kafka case, update leaves stored fields unchanged.
2026-10-09 23:34:44 -04:00
Sam Fakhreddine fdb21de095 fix(dynamodb): reject UpdateTable GSI changes AWS refuses (#4714)
* fix(dynamodb): reject UpdateTable GSI changes AWS refuses

UpdateTable accepted more than one GSI create or delete in one request,
and a GSI create or delete together with a BillingMode or throughput
change. Real DynamoDB answers the first with LimitExceededException
("Only 1 online index can be created or deleted simultaneously per
table") and the second with ValidationException ("You cannot create or
delete index while updating table IOPS"). Both checks run before the
table changes.

updateTableDeleteAllGsis deleted two GSIs in one request, which AWS
rejects, so it now deletes them in two requests; its end state is the
same.

Fixes #4572

* fix(dynamodb): share the online index limit across GSI and vector index changes

The limit now carries the AWS Subscriber limit prefix, counts GSI and vector index operations together, and an index change is also refused alongside table OnDemandThroughput.

* refactor(dynamodb): keep one copy of the UpdateTable index-count check

The service already refuses more than one online index operation before anything changes, so the handler's duplicate check is dropped. Integration tests for this change now use the deleteTable helper and clean up their tables.
2026-10-09 23:23:41 -04:00
Matheus Oliveira 8502565287 fix(ec2): serve IMDS instance identity credentials (#5289)
Adds identity-credentials/ec2/info, ec2-instance credentials and listings.

* Fix #5264

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-09 23:05:43 -04:00
Matheus Oliveira cb673802e0 fix(iam): validate RoleName in CreateRole (#5374)
Follow-up to #5289.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-09 23:00:28 -04:00
Priamo Germosen 477e3ef813 fix(iam): make the server certificate reference check atomic with the write (#5368)
DeleteServerCertificate checked the reference providers under its own lock, while
a referring service validated the certificate and then saved the resource naming
it. Nothing tied the two together, so a delete running between the check and the
write saw no reference, removed the certificate, and left a live distribution or
listener holding one that was gone. It reproduced in 233 of 400 trials.

CloudFront and ELB Classic now perform that check and the write while holding the
lock the delete takes, so only the two sensible orders remain: the delete loses
and answers DeleteConflict, or it wins and the create is refused.

The ordering runs one way only. deleteServerCertificate holds the lock while
calling serverCertificateReferences() on each provider, and those are plain reads
over the provider's own store that take no provider monitor, so IAM never waits on
a provider while a provider waits on IAM.

ELBv2 is untouched: it never validates certificate references, so a listener there
can name a certificate that was never present, which is a separate gap.

Removing a listener needs a lock too, for a different reason than adding one.
deleteLoadBalancerListeners removed from the listener list with no lock at all,
while the certificate delete walked that same ArrayList, and a structural change
to a list being walked ends the walk in ConcurrentModificationException. No mapper
covers that, so DeleteServerCertificate answered an unmapped 500 rather than 200
or DeleteConflict. A probe calling the scan exactly as the delete does, against a
loop of listener removals, hit it within two seconds.

That one is the list's problem rather than the lock's, so the listeners are held
in a CopyOnWriteArrayList, as Stack.events and IamUser.groupNames already are, and
the walk reads a snapshot of it. Removal then takes only this service's own
monitor, which the add shares so that a removal cannot land between the add's look
at the port and its decision, and a certificate delete no longer waits on either.
A unit test runs the scan against a loop of listener writes: with a plain list it
ends in ConcurrentModificationException inside a second, which is how the probe
became a test.

The two race tests keep their own fixtures and read their own failures. Each
trial's certificate, and its load balancer or distribution, now come back out in a
finally, so a trial that fails part way through leaves nothing behind in the
application the other test classes share, which matters against a 20 certificate
quota. The racing tasks' futures are read as well: each catches the AwsException
its order expects, and anything else used to stay in the future, leaving the trial
looking like the other order had won and the test passing green without the race
ever having run.

The load balancer name check moves inside the guard too. It was made before the
write and nowhere else, so two creates of one name both passed it and both
committed, and the first caller was told it had succeeded while holding a load
balancer that had been replaced. The check above the guard stays as the fail-fast
that keeps AWS's error precedence. Reverting the inner one has the new test report
two winners where there should be one.

That also showed the guard was not always a lock. Built without IAM, which is how
this service's unit tests build it, it ran the action with nothing held, so a
re-check there would have been worth no more than the first check. The name is
settled by putIfAbsent instead, which holds whether or not IAM is present and
needs no lock to carry it.

Neither service takes the lock for a write that cannot record an IAM certificate.
A distribution that names none, a listener with no certificate or one served by
ACM, and a listener removal cannot leave a resource holding a deleted certificate,
and the delete reads a copy of the distribution store and a snapshot of each
listener list, so an unguarded write cannot disturb its walk either. Holding it
for every write would instead have an unrelated load balancer, zone or health
check write delay a certificate delete, and the other way round.

The race tests stop accepting any AwsException as an order. Each task swallows only
the code its own order produces, InvalidViewerCertificate for the create and
DeleteConflict for the delete, and rethrows the rest into the future the trial now
reads. The load balancer trials record both statuses, and the run asserts every one
resolved as one order winning with the other told why, since two failures would
otherwise pass as a clean trial with the race untested.

The doc paragraph for this behaviour claimed the DeleteConflict refusal was what
AWS does, and nothing sources that. DeleteConflict is modeled on the operation,
but the API Reference describes it only as attached subordinate entities without
saying what counts as one for a certificate, and the operation's own page warns
that if Elastic Load Balancing does not detect the deletion of a bound certificate
it may continue to use it, which reads as the delete going through. The refusal
stays, being the more useful answer to a caller than a dangling reference, and is
now recorded as the intentional deviation it is. The ELBv2 note carries its
evidence too: CertificateNotFound is modeled on CreateListener, ModifyListener and
AddListenerCertificates, and none of the three checks anything.

Closes #5087
2026-10-09 20:16:43 -05:00
Priamo Germosen 46f9c23c8b fix(iam): refuse inactive keys and unreadable credentials in enforcement (#5346)
With enforcement on, three kinds of request got past the filter's
credential checks, and an expired session was answered as a key that
exists nowhere.

A deactivated access key could still be used. Account routing skips an
inactive key, so its requests landed in the default account. A key of a
user there kept that user's permissions, since resolveCallerContext
reads the user's policies whatever the key's status. A key of another
account matched no user in the default account, and isKnownAccessKey,
which counts every key in every account, let the request through as a
credential the filter could not map, with no policy check at all.
Deactivating a key of a user allowed nothing let it create IAM users
and mint session tokens. The IAM User Guide ("Manage access keys for
IAM users") says that once deactivated a key "can no longer be used by
API calls" until it is activated again.

An Authorization header the filter could not read a credential from made
it return before any check. That covered a header naming no access key
at all (a Bearer token, SigV2, a Credential without the SigV4 scheme or
with the key left out) and a SigV4 scope missing a part, such as its
aws4_request terminator. Any caller could make any call that way,
including the management calls an unsigned request is refused. Such a
request is now refused as AWS refuses a header it cannot read:
IncompleteSignature for Query services and IncompleteSignatureException
for JSON and CBOR ones (the common errors, and the IAM User Guide's
SigV4 troubleshooting section), and S3's AuthorizationHeaderMalformed
with the wording S3HeaderSignatureFilter already uses, all 400. A
presigned S3 URL sends no header, and S3 answers a mal-formed
X-Amz-Credential with AuthorizationQueryParametersError, so that is
what it gets. Otherwise the request is treated as an unsigned one is: an
operation AWS serves without credentials is left alone, and a REST
request is refused only when the header claims SigV4 and its route maps
to an action, since AppSync, CodeArtifact's package endpoints, Identity
Store's SCIM endpoint and API Gateway's authorizers take Bearer and
Basic tokens of their own. An empty header with nothing else to read is
refused the same way, not as a missing one; next to a presigned URL's
X-Amz-Credential it still defers to that credential. Where the guide
gives the message, the refusal uses it: "Authorization header cannot be
empty." and, for a SigV4 header with no Credential, "Authorization
header requires 'Credential' parameter.". The other shapes get the
common errors' "The request signature does not conform to AWS
standards.".

sts:GetCallerIdentity answered a key that exists nowhere, as the
default account's root, because its exemption ran before the
unknown-key check. The exemption is about permissions only, so the key
checks now run first.

An expired session was refused with InvalidClientTokenId or
UnrecognizedClientException, because resolveCallerContext deletes it and
the known-key check then finds nothing. The common errors of the IAM,
STS, EC2, SNS, CloudFormation, Lambda and Step Functions API references
give ExpiredTokenException, 403, "The security token included in the
request has expired", and S3's error list gives ExpiredToken, 400. The
filter now asks isExpiredSession before resolving the caller, so it no
longer deletes the session, and later uses get the same answer. Both
lookups are asked about one moment: read apart, a session expiring
between them would be deleted and answered as unknown, or on the
presigned POST path below allowed with no policy check. Once Floci's own
sweep has removed the session (the first presigned URL it generates in a
process runs one), the key reads as unknown again, as
docs/services/iam.md says.

The inactive-key, expired-session and unknown-key checks run before the
action is used, on every Query, JSON and CBOR call and on every REST
request whose route maps to an action. A REST request no rule maps is
left alone, as an unsigned one already is: the filter cannot tell it
from the API Gateway execute path, Lambda function URLs and the other
paths it sees that are unsigned by design, and the execute path answers
a bad AWS_IAM signature in its own shape. Every refusal to a CBOR call,
AccessDenied included, now arrives CBOR-encoded, where only the
unsigned-call refusal did before; the others were JSON bodies the client
could not read. AccessDenied keeps its 403, the status the Kinesis and
CloudWatch common errors give it. The filter's JSON errors are now
written from AwsErrorResponse, as AwsExceptionMapper writes every other
JSON error, rather than built as strings. That gives a REST JSON
refusal, such as Lambda's, the X-Amzn-Errortype header the rest of
Floci's REST JSON errors carry.

A presigned POST carries its credential in the form body, which the
filter never sees, so authorizeAdditionalResource is the only IAM check
it gets. That evaluated an inactive key with its user's policies, and
resolved an expired session, which deleted it. Both are now refused
there as the filter refuses them, before the caller is resolved:
InvalidAccessKeyId, 403, and ExpiredToken, 400. A key that exists
nowhere, or a credential that cannot be read, is still left to S3's own
presigned-POST check, and uploads as an unsigned request would when that
check is off. docs/services/iam.md now says so.

isKnownAccessKey keeps counting inactive keys: GetSessionToken relies
on it, so a session minted with an inactive key has no issuer rather
than acting as the account root. resolveCallerContext keeps returning
an inactive key's user policies rather than null, which AppSync and RDS
read as allowed; both verify the signature first, which an inactive key
fails. isInactiveAccessKey looks in the request's account before
scanning the others, since routing sends an active key to its own
account.

Integration tests cover a same-account and another account's inactive
key (including GetCallerIdentity, GetSessionToken, S3, a JSON service,
a presigned POST, and reactivation); an expired session on Query (asked
twice), JSON (with its X-Amzn-Errortype header), S3 and presigned POST
calls; an unreadable credential on Query (eight header shapes, none of
which creates the user), JSON, CBOR and S3 calls, on a presigned S3 URL,
and with the guide's two messages; the cases left alone (a Cognito flow
AWS serves without credentials, a Bearer token on S3, a REST route no
rule maps); an unknown key on GetCallerIdentity and on a CBOR call; and
AccessDenied on a CBOR call. Every refusal fails without this change.
IamServiceTest and IamEnforcementFilterTest check that the expiry check
and the caller lookup are asked about one moment. The SDK compatibility
suite's IamEnforcementTest adds a deactivated key, refused by STS and S3
with the codes the SDK reads and accepted again once activated.
docs/services/iam.md lists the cases in both enforcement tables and
under unsigned requests.
2026-10-09 20:16:31 -05:00
Priamo Germosen 4793f1aa77 test(iam): leave no role or instance profile behind in the service-linked role suite (#5322)
Most tests in IamServiceLinkedRoleIntegrationTest create a role as a fixture and
have no reason to remove it, so the class finished with a dozen roles still under
/aws-service-role/, plus the instance profile the protection test needs. A
QuarkusTest shares one application across classes, so those outlived the class
and were visible to anything listing roles or instance profiles unscoped. Nothing
fails on it today, because every unscoped ListRoles in the tree picks its own role
out of the result by name instead of asserting over the whole list, which makes
this a hazard waiting for the first test that does not.

The cleanup is an @AfterAll. Quarkus points RestAssured at the application only
for the duration of a test method and resets the port afterwards, so a teardown
going through RestAssured has to say where the application is; the test port is
random, which leaves the injected test URI as the only place to read it from.
With the port supplied, the application answers normally there, and a failure in
@AfterAll is reported by surefire against the class, so a cleanup that stops
working does not pass quietly.

It creates a role of its own before sweeping and asserts the listing sees it,
because nothing else in this class pins ListRoles by PathPrefix. Without that, a
listing that stopped returning anything for the path would leave the sweep with
nothing to delete and the run would still finish clean. Deleting the instance
profile expects 200 for the same reason: this action answers NoSuchEntity once
the profile is gone, so the status is the evidence that there was something to
clean.

Once at the end rather than after each test, on purpose. Orders 1 to 8 are one
narrative where a role created by one test is the next one's fixture and the
delete in order 6 is itself under test, so cleaning between tests would take it
apart.

Which roles are this class's own is decided against a snapshot of the path taken
before its first test, rather than by a list of the principals it uses or by
sweeping the path whole. A list goes stale the first time a test is added. The
whole path is not this class's to clear: other classes create service-linked roles
in the same shared application, and a class running later can still be holding one.
A class placed after this one in the same run saw /aws-service-role/ come back
empty with the sweep unscoped, and sees ElastiCache's role, created by an earlier
class, still there with the snapshot in place. The profile goes by name, since
other classes keep their own profiles at the same path.

The snapshot is taken on the first test rather than in @BeforeAll, where the
injected URI is still null and nothing can reach the application yet. If no test
got that far, the teardown returns without sweeping: it created nothing and has no
record of what was already there, and failing there would bury whatever stopped
the snapshot.

The profile delete is guarded by a flag the creating test sets, because a focused
run of a single method fires the teardown too and would otherwise demand a profile
nothing had made. The probe role the teardown creates is removed in a finally, so
an assertion that stops the sweep cannot leave it behind; nothing is asserted there,
since a throw would bury whatever failed first.

Two kinds of role live under that path and the cleanup has to know both. Most are
service-linked and only DeleteServiceLinkedRole will take them, while the
protection tests park ordinary roles there with CreateRole, and that action
answers NoSuchEntity for those because the mark comes from the minting action
rather than from the path. A 404 while deleting is what surfaced the difference,
and only a 404 falls through to DeleteRole: any other status leaves the role for
the closing assertion to name rather than hiding behind a second attempt.

One fixture sits outside that path. The test that puts DeleteServiceLinkedRole in
front of an ordinary role parks it at the account root, where a listing by
PathPrefix never reaches it, so that test removes it itself with DeleteRole.
Expecting 200 there is also the assertion that the rejected delete left the role
alone, which is what the sibling test at a service-linked path reaches for GetRole
to say.

Also renumbers a duplicate @Order(24), which left two tests with an unspecified
order relative to each other in a class that is ordered on purpose.

Refs #5293
2026-10-09 20:16:21 -05:00
Priamo Germosen ceab47e785 feat(codeartifact): add DeletePackage for all package formats (#5320)
DeletePackage deletes a package and every one of its versions, matching
PackageSummary's own field name (package, not name, confirmed against the API
reference) in the deletedPackage response. A nonexistent package answers
ResourceNotFoundException instead of silently succeeding.

Existence and deletion go where the package actually lives: stored
generic-format versions and their asset bytes for generic, and each format's
sidecar for maven, npm, and pypi. Validates package and namespace shape, and
requires or rejects a namespace per format, the same boundary describePackage
already enforces, before touching repository or sidecar state.

Synchronized like every other mutating method on this service, so a publish
and a delete racing the same generic package cannot interleave. Within one
generic version's own delete, its metadata record is removed before its asset
bytes are cleaned up, so a cleanup failure on one asset can never leave a
surviving record pointing at bytes that are now gone; the failure is logged
and the rest of the package's assets still get cleaned up.

Verdaccio and Reposilite can each remove a whole package in one call,
confirmed against live containers: Verdaccio needs the packument's own _rev
appended as npm's real unpublish protocol does (a bare DELETE with no revision
is not a route at all), Reposilite removes everything under the group/artifact
directory in a single DELETE. pypiserver has no single whole-package route,
but its own management endpoint (POST / with :action=remove_pkg) does delete
a named version for real, confirmed live against the pinned v2.4.2 image:
every version is listed first through the same image's PyPI JSON API
endpoint, then each file removed under its own, unnormalized name (an sdist
and a wheel of the same release can legitimately differ there, so deleting by
one shared name alone could silently leave the other file behind).
RepositorySidecarManager.deletePackage's default still throws
UnsupportedOperationException for a sidecar that genuinely cannot do this,
and the service turns that into a documented InternalServerException rather
than claiming a success it cannot back up or leaving an unhandled 500.
2026-10-09 20:16:10 -05:00
Mathieu Charpenel d0c2774564 fix(scheduler): do not base64-decode BinaryValue in universal sqs target (#5314)
Real EventBridge Scheduler uses the UTF-8 bytes of a universal SQS
target's MessageAttributes.*.BinaryValue string as the attribute value and
never base64-decodes it. Floci required base64 and rejected anything else,
so schedules that deliver on AWS failed with "not valid base64".
2026-10-09 19:05:45 -04:00
Mario Toffia f413a667d0 feat(iot): indexing configuration (#4896)
AWS IoT fleet indexing had no routes in Floci, so a stack or script
calling UpdateIndexingConfiguration or GetIndexingConfiguration failed
with "Unknown operation: POST /indexing/config", and there was no
stored configuration for a later SearchIndex to consult.

A new IotFleetIndexingService and IotFleetIndexingController, wired
into the iot descriptor beside the domain configuration controller,
serve UpdateIndexingConfiguration and GetIndexingConfiguration on
/indexing/config and DescribeIndex on /indices/{indexName}. There is
one configuration per account and region, kept through StorageFactory;
a region never updated reports the OFF shape AWS returns.

The behaviour follows what real AWS returned when measured: an update
that carries only one of the thing and thing group configurations
keeps the other, turning thing indexing OFF clears the whole thing
configuration, and managedFields are derived from the modes rather
than stored. Client sent managedFields are only checked against the
fields AWS manages and their types. Validation uses AWS's messages for
a missing configuration, null and out of set enum values (the modes,
field types, filter socket information and geolocation order),
secondary modes without thing indexing, named shadow indexing without
shadow names, unknown managed fields, and a thing custom field named
after a managed field. A geolocation sent without an order is stored
with LatLon, the default AWS returns. DescribeIndex returns the
schema the modes select and is ACTIVE at once, a disabled index is
ResourceNotFoundException and an unknown name InvalidRequestException.

Thing group managedFields are checked the same way, also while group
indexing is OFF, and neither group managedFields nor customFields are
stored. A member of the wrong JSON type is a SerializationException,
as on AWS. The fleet indexing, domain configuration and authorizer
controllers now share one strict body reader, so a malformed body or
content after it is a SerializationException on all three, which is
what AWS returns there.

ListIndices, SearchIndex and the statistics APIs are not modeled.
2026-10-09 16:52:30 -04:00
David 9f224d9de6 fix(core): verify SigV4 header signatures for every service under validate-signatures (#5268)
* fix(core): verify SigV4 header signatures for every service under validate-signatures

FLOCI_AUTH_VALIDATE_SIGNATURES verified signatures for S3 only, so SQS,
KMS, IAM, Scheduler and every other service accepted a request signed
with the wrong secret. SigV4HeaderSignatureFilter verifies the
Authorization header of every request outside S3 and execute-api when
the flag is on, rebuilding the canonical request from the request as it
arrived and answering in the protocol the request used. Unsigned
requests are left alone, and the default configuration is unchanged.

The filter runs after matching so it can hash the body. The SQS
queue-URL router now records the bytes it appends to a Query body, and
the CBOR content type is read from the header that preserves it, so
neither rewrite breaks a valid signature.

With the flag on, an unknown or synthetic access key is now refused by
every service, as S3 already refused it.

Closes #5195

* fix(core): skip signature checks by matched resource, strip the spoofable content-type header

The filter skipped any request whose credential scope named s3 or
execute-api, so a caller could sign an SQS or KMS call under either and
pass with the wrong secret, and S3 Control was never checked. It now
steps aside only for the resources another verifier owns: S3Controller
and the API Gateway execute controllers.

AwsCborContentTypeFilter removes any client-sent
X-Floci-Original-Content-Type, so a signed Content-Type cannot be
swapped behind a forged copy. REST-XML services (Route 53, CloudFront,
S3 Control) get XML errors. Header and scope parsing reuse
SigV4AuthorizationHeader and CredentialScope, and the canonical request
moves into SigV4Canonicalization, shared with ExecuteApiSigV4Authorizer.

* fix(core): leave AppSync GraphQL signatures to AppSync's own check

AppSync's GraphQL endpoint verifies IAM signatures itself and answers a
failure with the UnauthorizedException envelope AppSync clients parse.
With validate-signatures on, the header filter reached it first and
answered with a JSON InvalidSignatureException. AppSyncExecutionController
joins the resources the filter steps aside for.
2026-10-09 16:31:22 -04:00
David Wooldridge 91c15be74a fix(rds): apply PostgreSQL startup parameters to IAM sessions as the token's role (#5304)
* fix(rds): apply PostgreSQL startup parameters to IAM sessions as the token's role

* fix(rds): refuse a session_authorization change and match PostgreSQL's parsing for IAM startup parameters

* test(rds): share the IAM integration tests' setup and document RESET for IAM startup parameters
2026-10-09 16:22:21 -04:00
Salil Chincholikar 84dbed14af fix(ec2): resolve interface endpoint fallback address collisions (#5347)
* fix(ec2): resolve interface endpoint fallback address collisions

Different subnet IDs can have the same modulo-256 hash, giving an interface
endpoint duplicate fallback IPv4 addresses. Reserve configured and
IPv4-derived addresses first, then resolve fallback collisions in stable
subnet order.

Cover colliding subnet hashes, missing IPv4 CIDRs, address reservations,
and stable addresses across repeated reads and subnet reordering.

Closes #5345

* fix(ec2): reserve endpoint IPv4 addresses by numeric value
2026-10-09 16:15:02 -04:00
Vũ Thế Huy 5d5e39a15e fix(sqs): reject batch requests with more than 10 entries (#5331)
* fix(sqs): reject batch requests with more than 10 entries

SendMessageBatch, DeleteMessageBatch and ChangeMessageVisibilityBatch now
fail with TooManyEntriesInBatchRequest before processing any entry, on
both the Query and JSON protocols. The JSON type mapping is keyed on the
prefixed Query code so the JSON error type matches what botocore expects.

Fixes #5319

* fix(sqs): address review findings for batch entry limit validation

- Count distinct batch entry indices in Query handler across numbering gaps and missing IDs
- Reject missing or non-array Entries in JSON batch handlers with 400
- Seed messages and verify receipt handles in integration tests to detect partial mutations

* fix(sqs): reject empty batch requests and tidy batch limit tests

Return EmptyBatchRequest for a batch with no entries on all three batch
actions, and share the queue-count and receipt-handle entry helpers in the
JSON protocol test.

* fix(sqs): match AWS EmptyBatchRequest message per action and tidy query tests
2026-10-09 16:06:35 -04:00
Vũ Thế Huy 1a6f336e9f feat(redshift): run Data API statements from Step Functions and Scheduler (#5312)
* feat(redshift): run Data API statements from Step Functions and Scheduler

Step Functions: add the arn:aws:states:::aws-sdk:redshiftdata:<action> Task
integration. It reuses RedshiftDataJsonHandler, so every Data API action
Floci implements works for provisioned clusters (ClusterIdentifier) and
Serverless workgroups (WorkgroupName). Arguments and results keep the wire
PascalCase names, CreatedAt and UpdatedAt are ISO-8601 at any depth, errors
surface as RedshiftData.<Code>Exception, and the task fails when redshift
or redshift-data is disabled. .sync resources are rejected, as AWS has no
such variant.

Scheduler: add the redshiftdata:executeStatement and
redshiftdata:batchExecuteStatement universal targets. The call runs as the
schedule's account and region, because the dispatcher thread carries no
request account and cluster and statement storage is account-aware. A SQL
error stays on the statement; a request the Data API rejects propagates so
the existing retry and dead-letter handling applies.

* fix(redshift-data): validate task input and isolate statement storage by account

* fix(redshift): run scheduled Data API statements off the dispatcher thread

Keep the request check on the dispatcher so a rejected request still
retries, and run the SQL on its own thread under the schedule's account.
Ask ServiceRegistry whether redshift-data is enabled instead of repeating
the rule, keep the resolver and connection factory package-private, and
cover the provisioned-cluster account in the resolver test.

* fix(scheduler): await scheduled Redshift Data statement in docker test
2026-10-09 15:51:11 -04:00
XuJian 07b529e150 feat(cloudformation): add optional-value and delete cleanup hooks (#5067) 2026-10-09 15:04:03 -04:00
Ovidiu (Ovi) 4f34a903fc feat(ssm): support UnlabelParameterVersion (#5339)
* feat(ssm): support UnlabelParameterVersion

Remove one or more labels from a parameter version. Labels attached to
the version are returned in RemovedLabels; labels that are not on that
version, including ones attached to a different version, are returned in
InvalidLabels and left in place. A missing parameter is ParameterNotFound,
a missing version ParameterVersionNotFound, and an omitted ParameterVersion
or an empty or oversized label list a ValidationException.

* fix(ssm): match AWS errors and ordering in UnlabelParameterVersion

Verified against real AWS (us-east-1):

- Report every missing or invalid member in one ValidationException, in
  the order name, parameterVersion, labels, and render the label list
  the way AWS does ('[prod, ]').
- Reject a string or boolean ParameterVersion and a non-string Name or
  label with SerializationException; truncate a fractional version and
  clamp one outside the range of a long, as AWS does.
- Reject an ARN, a malformed or ssm-prefixed name, and deny an
  aws-prefixed one before the lookup; ignore surrounding whitespace in
  the lookup but echo the name as sent in error messages.
- Word ParameterVersionNotFound as AWS does.
- Return RemovedLabels in the order the labels are stored on the
  version, and InvalidLabels in request order.

LabelParameterVersion shares the label-list parsing, so its label
validation messages and non-string labels now match AWS too.

* fix(ssm): take the service monitor when deleting parameters

PutParameter, LabelParameterVersion and UnlabelParameterVersion already
run under the SsmService monitor, but DeleteParameter and
DeleteParameters did not. A delete landing between a label or unlabel
call's lookup and its history write left orphaned history that a later
PutParameter of the same name appended to.

Also pin LabelParameterVersion's AWS-verified label validation messages
and its SerializationException for a non-string label in its own
integration test, and share the parameter-name format rule between the
two reserved-name messages.
2026-10-09 13:11:29 -04:00
Salil Chincholikar 07ebc33d28 feat(scheduler): substitute schedule context attributes in target Input (#5194)
* feat(scheduler): substitute schedule context attributes in target Input

Replace <aws.scheduler.schedule-arn>, <aws.scheduler.scheduled-time>,
<aws.scheduler.execution-id> and <aws.scheduler.attempt-number> in the
target Input for templated and universal targets, using the occurrence's
scheduled time and the retry attempt the dispatcher tracks.

* test(scheduler): share one harness between the scheduler integration tests

SchedulerContextAttributesIntegrationTest copied its schedule creation,
scoped dispatcher, unique names and cleanup from
SchedulerStepFunctionsIntegrationTest. Both now use SchedulerTestHarness,
which also builds the at() expression they each formatted by hand.

* fix(scheduler): keep dead-letter context aligned with the last attempt

Materialize the target request before every invocation so an exhausted
occurrence's dead-letter body carries the same execution id and attempt
number as its last attempted delivery. Preserve that request when the
occurrence expires before another retry.

Share scheduled-time formatting across context attributes, default events
and dead-letter attributes. Cover retry-count and event-age exhaustion
and remove the documented first-attempt body limitation.

* style(scheduler): fix shared harness static import order

Place ROLE_ARN before atExpression to satisfy the ImportOrder rule used
by the PR's merged Checkstyle configuration.
2026-10-09 12:08:34 -04:00
Aniket Shukla 5dfb45d71f fix(cognito): run missing post-confirmation triggers (#5207)
* fix(cognito): run missing post-confirmation triggers

* fix(cognito): forward confirmation client metadata
2026-10-09 10:23:06 -04:00
Mario Toffia 0ec64add2d fix(cloudformation): wait for a stable ECS service (#4880)
AWS CloudFormation reports an AWS::ECS::Service CREATE_COMPLETE or
UPDATE_COMPLETE only once the service is stable: it polls
DescribeServices until the desired number of tasks of the current
task definition are running. Floci reported the resource complete as
soon as CreateService or UpdateService returned. The tasks were
started later by the ECS reconciler, every five seconds, and the
service's runningCount only caught up a tick after that, so a client
reading the service right after the stack operation saw runningCount
0.

EcsService.awaitServiceStable now waits, like
Ec2Service.awaitContainerLaunch, for runningCount to equal
desiredCount, for the current deployment to run that many tasks, and
for no task of an earlier deployment to be running. Instead of idling
until the next tick it submits up to three reconcile passes to the
single reconciler thread, so they never overlap a scheduled tick.
After five minutes it fails with "Service <arn> did not stabilize.".

The wait ends at once when the service's tasks cannot start. The
reconciler now keeps, in memory, why its last attempt to launch a
task for a service failed, for example an unknown subnet, and the
deployment it was launching for. Only a failure of the deployment
being awaited ends the wait, so a pass that began before an update
cannot fail the update. The record is cleared on a successful launch,
on DeleteService and on a state reset. A task that stops with
TaskFailedToStart during the wait ends it too. A task the reconciler
launches is stamped with the deployment read before its task
definition, not after the launch, so a launch that an update overtakes
counts as the earlier deployment's and is replaced.

The ECS provisioner calls the wait after an in-place update and after
a create. A created service stays marked as owned by the stack while
it waits, so the create rollback deletes it. A replacement created by
a stack update is deleted when it does not stabilize. A service
updated in place that does not stabilize is put back on the task
definition, desired count and network configuration it had, and the
provisioner waits for that to stabilize too, as CloudFormation's
rollback does. A restore that fails or does not stabilize is reported
as a rollback failure, so a rolled-back stack does not claim the prior
configuration is running when it is not.

The ECS service test in CloudFormationIntegrationTest used subnets
and a security group that do not exist, so its tasks could never
start. It now uses the default VPC's.
2026-10-09 10:05:39 -04:00
Hector Ventura 3b36a4d0d8 fix(core): reuse pooled Docker connections and validate them after a second idle (#5333)
Every control-plane Docker call carried Connection: close, so that pool
never reused a connection: each call opened a new socket. The header was
there because docker-java disables httpclient5's stale-connection check,
so a socket the daemon or Podman had closed could be leased again and fail
on its next write.

With the Unix socket honouring read timeouts since #5294, that check works.
Both pools now validate a connection idle for more than a second before
reusing it, replacing it if the daemon closed it, and close idle
connections after 30 seconds. The retry wrapper passes requests through
unchanged.
2026-10-09 07:03:53 -04:00
David Phillips b28eac9142 fix(rds): reject malformed instance boolean flags (#5332)
* fix(rds): reject malformed instance boolean flags

* fix(rds): reject malformed modify placement and password flags
2026-10-08 22:40:48 -05:00