Commit Graph
189 Commits
Author SHA1 Message Date
TATSUNO “Taz” Yasuhiro 385ffcfdd0 feat(lambdaweb): set the WebFunctionAuthType condition keys on endpoint routes (#6893) 2026-10-29 00:54: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
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
Attila Kis 84442d83ce fix(build): build the amd64 native binary on Ubuntu 24.04 so it runs on x86-64-v2 CPUs (#6644)
On Ubuntu 26.04, which ubuntu-latest is moving to, the amd64 native
binary asks glibc for x86-64-v3 whatever -march says, so it does not
start on x86-64-v2 CPUs. Pin the amd64 native jobs to ubuntu-24.04, as
the arm64 jobs are, and check the ISA level after the nightly and
release builds, so CI catches it next time.
2026-10-26 23:02:10 -05: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
Hector Ventura 45d4c28e33 chore(ci): start Checkstyle suppression paths below the package root (#6584) 2026-10-26 19:53:46 -04:00
Hector Ventura 383315194a chore: add the package rename tool (report and apply) (#6556)
Floci's Java package moves from io.github.hectorvent.floci to io.floci.aws,
the convention the other emulators already use. The rename lands as one
mechanical cut, prepared by smaller PRs, and this is the tool for both.

tools/rename/rename_package.py report counts every reference to the old
package by where it sits: package and import lines, inline names in
code, strings, comments, non-Java files, and anything the cut would not
rewrite. Each prep PR can show its count going down. apply performs the
cut in the two commits it lands as: --moves-only renames the trees with
git mv so every file is a 100% rename, and --rewrite-only rewrites the
references, including the Maven groupId and the native-image directory.
The artifactId stays floci. CHANGELOG.md and the tool itself are left
alone.

It reuses code_text from tools/partition/partition_literals.py, so
comments and strings are read the way the partition gate reads them.
make rename-test runs its tests in the Partition Literals workflow, so a
change to that shared lexer cannot break the tool silently.

A dry run on main moved 5,966 files and rewrote 26,016 lines with no old
name left outside CHANGELOG.md; main and tests compile, and 245 focused
tests pass. Checkstyle then fails only in the 357 files whose
suppression paths start with /floci/, which a follow-up makes
package-independent.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-25 23:10:14 -04:00
Priamo Germosen 932af22f4a fix(iam): check requests on the resources they name (#6511)
Under IAM enforcement a request is checked against the resources it acts
on. ResourceArnBuilder builds their ARNs by hand for 17 namespaces;
every other request was checked on *, so a grant scoped to a resource
was refused and a deny scoped to one never applied.

AWS's Service Reference lists the resource types each action acts on and
each type's ARN formats, but not which request member names a resource;
botocore's models give the members. A new generator,
tools/aws/regen_iam_request_resources.py, joins the two into
src/main/resources/aws/iam-request-resources.json: for each operation,
the action it is checked as, that action's resource types and the
resources its request names, by a member holding a resource's ARN or by
members filling the variables of a type's format, matched by name. A
variable nothing fills is left open, as a service mints a new resource's
id; a type nothing names is not checked, as an action lists the optional
resources its requests may use; and types named only through the same
members are alternatives, of which the one named in full is kept.
Corrections give a v2 CreateLoadBalancer the load balancer of its Type,
application when it gives none (a Type outside application, network and
gateway is now refused, as AWS refuses it, rather than read as an
application load balancer the table does not name), and read
StartExecution's and StartSyncExecution's stateMachineArn up to a #, as
Floci runs the machine before Step Functions Local's test case. A state
machine's version or alias, stateMachine:<name>:<qualifier>, is checked
on the state machine's ARN, as Step Functions authorizes it, so an
execution started through one is the state machine's too.

RequestResources reads them from a JSON or CBOR body or a Query form,
for the namespaces the table reads, and ResourceArnBuilder uses them
where it has no branch. They are read for the operation the request is
dispatched as, which IamEnforcementFilter resolves and checks the action
of (the Query action, the JSON target or the Smithy RPC v2 path's
operation), never for an X-Amz-Target or Action the request names again,
and as the handlers read them: a list only from a list, a number or a
null as its text. A member whose botocore shape is an account id gives
the account of the types named by variables: ECR's registryId selects
the registry its handler acts in, and a JSON null is no registry, the
caller's, as ECR reads it. ECR's
BatchGetRepositoryScanningConfiguration, whose AWS request has no
registryId, no longer reads one: it acts in the caller's registry, where
IAM checks it. An ARN value counts when it matches the format of a type
the action acts on; one naming another account or Region is checked as
given and as each resource of that name a handler may act on instead, in
its account or the caller's and its Region or the request's (ECR's tag
handlers keep the ARN's account in the request's Region). A request
naming none, or whose action acts on no resource type, stays on *, as
AWS checks it. A create's tagging action is checked on the same
resources, except where the create makes a resource under a parent its
action acts on: CreateListener acts on a load balancer and CreateRule on
a listener, and their tags are checked on the new listener or rule,
built from the parent's ARN with the type word replaced and its own id
open. The table gives these from the formats: a child type's is its
parent's with one id appended. So the AWS Load Balancer Controller's
policy, which allows AddTags at creation only on target groups and
application and network load balancers, and on listeners and rules, now
holds.

The first namespaces read are Elastic Load Balancing, ECR, Step
Functions and Cognito user pools (298 operations); the 99 others Floci
serves are listed as not read yet, with their reason, and
RequestResourceNamespacesIntegrationTest fails for a served namespace in
none of the lists. make iam-request-resources-check, part of
aws-data-check, re-derives every operation from the pinned botocore;
make iam-request-resources-verify, part of iam-data-verify, checks the
actions, types and formats against AWS, and the IAM data drift workflow
also runs on a change to the table or its generator.

Not in this change: the 99 other namespaces, Query lists other than
Name.member.N, identifiers inside structures (SetRulePriorities,
CreateStateMachineAlias' routing configuration) and EventBridge.
2026-10-25 14:51:39 -05:00
Priamo Germosen 64f4f9e489 fix(iam): check a create's tags on its own and its tagging action (#6452)
Under IAM enforcement a request that tags the resource it creates was
checked only for the operation's own action. AWS also checks the
service's tagging action, as the SNS API reference says: "To be able to
tag a topic on creation, you must have the sns:CreateTopic and
sns:TagResource permissions." A caller allowed to create but not to tag
could set at creation the tags that a tag-based policy trusts. The
operation's own action did not see the tags either: aws:RequestTag and
aws:TagKeys were set only for Logs, S3 and EC2 RunInstances, so a
policy allowing sqs:CreateQueue only with aws:RequestTag/team never
matched, and one denying it when aws:RequestTag/team is null refused a
tagged create.

AWS's Service Reference lists the tagging action among each operation's
authorized actions and marks the actions that only tag, but does not say
which request member carries the tags; botocore's models do. A new
generator, tools/aws/regen_iam_tag_on_create.py, joins the two into
src/main/resources/aws/iam-tag-on-create.json: 581 operations over 69
namespaces, those Floci authorizes by operation. An
operation is in it when the reference lists, beside its own, an action
that only tags and adds tags; its tags are read from a top-level member
named Tags, TagList, TagSpecifications or the like that holds a tag list
or map. 569 are read from the table (579 members), CloudWatch Logs
CreateLogGroup is checked by hand as before, and 11 carry no tags this
file can read, each with its reason. A correction gives SQS's Query
name, Tag.N, and one drops an EC2 IPAM pool's allocation rule, which
tags nothing.

When a request carries tags, IamEnforcementFilter checks the tagging
action for each resource's tags apart, with them as aws:RequestTag/<key>
and aws:TagKeys, and, where the action takes it, the operation as its
namespace's CreateAction key (ec2:CreateAction is RunInstances for an
instance launched with tags). A tag specification's tags are checked on
the resource of the type it names, from the ARN the reference gives the
type with its name left open (arn:aws:ec2:<Region>:<account>:instance/*),
which the table carries for EC2 and RDS; other tags on the resources the
operation is checked on. Lambda's CreateFunction is now checked on the
function its body names, which the reference gives it, rather than on *,
so a grant scoped to the function covers both its action and its tags.
The operation's own action is checked with the
same two keys, once for each resource's tags, where the reference lists
them for it or for a resource it acts on (542 of the 569), keeping any a
service's own condition keys set. The table is keyed by operation, so
the filter now carries the operation it resolved beside the action,
which differs for an operation AWS authorizes under another name
(Budgets' CreateBudget is budgets:ModifyBudget).

The tags are read as the Floci handler that applies them reads them, so
the check sees the tags the resource gets. A form's are read under the
SDK's spelling, from 1 to the first number with no key, and under the
further spellings the RDS, DocumentDB, Neptune, ElastiCache and Redshift
handlers read, numbered as each numbers them; EC2's from every tag
specification under either TagSpecification spelling, to the first
naming no resource type. A body's member is read under its own name, and
CloudWatch's PutMetricAlarm and PutCompositeAlarm also under tags, and a
CodeDeploy tag as Key and Value or key and value, each as text whatever
it holds, as its handler reads. The
tagging action is also checked for tags under any other spelling a
handler might read (a name, key or value in any case, any list spelling
and number, an object's structures), so none a handler applies goes
unchecked. The operation's own action is checked with every reading, its
handler's, any other spelling's, and none where its handler reads none,
and refused if any is denied, so a deny on a tag holds and a required tag
counts only where the handler applies it.

make iam-tag-on-create-check, part of aws-data-check, re-derives every
member from the pinned botocore; make iam-tag-on-create-verify, part of
iam-data-verify, checks every operation against AWS, and the IAM data
drift workflow also runs on a change to the table or its generator.

Not checked: sts:TagSession in a role's trust policy, service-specific
request tag keys such as rds:req-tag, EC2 RequestSpotFleet's nested
tags, and the REST services whose routes no rule maps yet.
2026-10-24 22:12:56 -05:00
Hector Ventura afb4afd2f1 test(compat): build partition-aware ARNs in the partition nightly's failing tests (#6451)
The partition nightly has failed every night since 2026-10-20. Every failure is
on the test side:

- ApiGatewayV2WebSocketDataPlaneTest hard-coded arn:aws:lambda:us-east-1
  integration and authorizer URIs. Since #6001 Floci invokes the function in
  the region the ARN names, so $connect answered 500 in any other region.
- RedshiftOperationsTest tagged a us-east-1 literal ARN, which #6026 rejects.
- EmrServerlessJobRunTest expected createdBy to start with arn:aws:.
- Ec2TagRegionTest failed in a partition with one region; it now skips there.

ResourceGroupsTest#capacityPoolLifecycle is allowlisted for eusc-de-east-1:
the Resource Groups model's GroupStringV2 and ResourceArn patterns cannot
match any eusc-de-east-1 ARN, and Floci enforces the model as published.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-24 18:38:59 -04:00
Priamo Germosen 1276a8857f fix(iam): check iam:PassRole from a table generated from the Service Reference (#6422)
Under IAM enforcement a request that names a role is checked for
iam:PassRole only where PassedRoles has a case for its operation, so most
of the operations AWS's Service Reference lists with iam:PassRole went
through without it: a caller allowed to create a CodeBuild project, a
Firehose stream, a Glue job or an SSM association could hand it any role
in the account. Adding a case per operation took one pull request per few
services.

The Service Reference names, for each operation, the services its role
goes to, but not the request member that names it; botocore's models give
the members. tools/aws/regen_iam_passed_roles.py joins the two into
src/main/resources/aws/iam-passed-roles.json: every operation listing
iam:PassRole in the namespaces Floci serves over JSON, Query and Smithy
RPC v2 CBOR, and in the REST services whose routes are authorized as
operations, each either read from the table, read by hand in PassedRoles,
or not read with a reason. Generation fails on an operation in none of
the three.

A member names a role when its name ends in Role, RoleArn or RoleName (a
plural, or one followed by Update or Override) and it holds a string or a
list or map of them, not an enum. A member whose documentation says it
takes a role by name is checked on the ARN IAM holds the role under. A
role the Service Reference passes to no named service, as it does
Cognito's, is checked with no iam:PassedToService. The generator records
its corrections with their reasons: members that pass no role (the roles
a Budgets action attaches a policy to, a CodePipeline action's role,
which the pipeline's role assumes, SSM target accounts' execution roles,
the roles a Glue job's generated nodes assume with STS, Firehose's
Snowflake role), members the rule does not see (a Cognito user pool's SMS
caller roles, a Glue connection's ROLE_ARN property and a view's definer,
Service Catalog's AssumeRole and LAUNCH_ROLE keys), and which service a
member's role goes to where the reference names several.

PassedRoles reads a table member from a JSON or CBOR body, or from Query
form parameters in either list form. Its own cases now return null for an
operation they do not read, and the table covers the rest. New cases read
SNS's role attributes (a topic's delivery status roles, a platform
application's, a Firehose subscription's and the SMS one, as the SNS
handlers read the map; an attribute with no value names none), a
CloudWatch Logs subscription filter policy's RoleArn, a Service Catalog
launch constraint's role, by the type Service Catalog holds for the
constraint on an update and in any case, since Floci keeps the type as
given, and an SWF decision's Lambda role from the attributes its type
names.

Not read: requests that name no role, roles that are a runbook's
parameter, operations whose roles go to several services without the
reference saying which member goes where (EMR RunJobFlow, EKS
UpdateClusterConfig, CloudWatch Logs CreateImportTask, SageMaker
CreateTrainingSession), XML bodies (S3 PutBucketReplication), EC2's
RequestSpotFleet, and REST services whose routes no rule maps yet.

make iam-passed-roles-check, part of aws-data-check, re-derives every
member from the pinned botocore; make iam-passed-roles-verify, part of
iam-data-verify, checks every operation against AWS; the IAM data drift
workflow now also runs on a change to the table or its generator.
PassedRoleNamespacesIntegrationTest fails for a namespace Floci serves
that the table neither reads nor names as not read yet.
2026-10-24 08:38:14 -05:00
joão pedro brito b58947c70a fix(rdsdata): refresh backend endpoints before JDBC connect (#6148)
* refactor(rdsdata): carry backend runtime identity

* fix(rdsdata): resolve runtime endpoint before JDBC connect

* test(rdsdata): cover backend endpoint refresh

* refactor(rds): make backend gates runtime-only

* test(rds): enforce proxy runtime identity

* test(rdsdata): reuse proxy endpoint refresh backends

* docs(rds): fix backend gate Javadoc link
2026-10-22 16:02:10 -04:00
Alessandro Lattao e5a206554f refactor(cloudformation): read property types from the vendored resource schemas (#5988)
* refactor(cloudformation): read property types from the vendored resource schemas

Follow-up asked on #5958: the types EventsCfnProvisioner checked a rule
target's members against were written by hand from describe-type, and
LambdaCfnProvisioner named the JSON type of each property it reads. They
now come from src/main/resources/aws/cfn-property-types.json, which
tools/aws/regen_cfn_property_types.py generates from the resource
schemas AWS publishes for us-east-1, in the request shapes' layout so
RequestShapeModel reads it: a structure, list, map or scalar per shape,
and "json" for what a schema leaves free.

The schemas come from AWS's live archive rather than a pinned package.
cfn-lint ships copies, but widens some types: a Lambda environment
variable's value takes any JSON type there and a string in the published
schema, where CloudFormation refuses an object or a list with "Property
[AB] expected type: String, found: JSONObject" (measured). The archive
keeps no older copy, so the generator follows the IAM data's split:
--check is offline and structural and runs on every pull request,
--verify compares a fresh generation with the vendored file and runs in
cfn-schema-drift.yml, weekly and on changes to the file or its generator.

CfnPropertyTypes.Reader walks the vendored shapes instead of type trees,
maps included: a map's values are read as its value shape, and a
mismatch names the key, as CloudFormation does ("Property [h] expected
type: String, found: JSONObject", measured). Every member of a rule
target is now read against its schema type, not only the four #5958
typed, and Lambda reads the properties it already typed through the same
reader, nested members included (VpcConfig.SubnetIds, EphemeralStorage.
Size, ImageConfig.Command, TracingConfig.Mode, Environment.Variables).
The messages for the newly checked members were measured on
CloudFormation (eu-west-1) and are in the tests.

* fix(cloudformation): keep a literal list's blank entries where the template put them

Review of #5988: the reader read every list of strings through the
engine's resolveStringList, which drops blank entries, so a rule
target's HttpParameters.PathParameterValues ["", "b"] became ["b"]
and moved "b" into the first wildcard. CloudFormation passes a literal
list on as written (measured: SecurityGroups ["", "sg-..."] reaches the
target as both). A literal list is now read through the engine's new
resolveLiteralList, which keeps blanks and still expands a list-valued
intrinsic in place; a list an intrinsic yields keeps the engine's
reading. Lambda's literal lists, read through the same reader, keep their
blanks too, for Lambda to judge as on AWS.

resolveLiteralList delegates to the private resolveListElements rather
than opening it: tests that mock the engine and call resolveStringList's
real code would otherwise get the mock's empty list from it, as
IamUserCfnProvisionerTest did.

* refactor(cloudformation): read a launch configuration's MetadataOptions by its schema shape

Review of #5988: #5964, merged after this branch opened, read
AWS::AutoScaling::LaunchConfiguration's MetadataOptions through the type
trees this PR removes. The generator now vendors that resource type too,
and AutoScalingGroupCfnProvisioner reads the block by the shape its
published schema declares (HttpTokens and HttpEndpoint strings,
HttpPutResponseHopLimit an integer, the same types #5964 wrote by hand),
so its tests pass unchanged. The hop limit's type is an anchor of the
generator's offline check.
2026-10-19 12:40:17 -04:00
Hector Ventura 9dcb1b65ae feat(core): translate LocalStack variables in Java instead of the entrypoint (#5851)
* feat(core): translate LocalStack variables in Java instead of the entrypoint

The LocalStack-to-Floci variable mapping (PERSISTENCE, EDGE_PORT,
LOCALSTACK_HOST, GATEWAY_LISTEN, LS_LOG/DEBUG, the Lambda and Docker
variables, the DNS suffixes, USE_SSL, CUSTOM_SSL_CERT_PATH) lived in
docker/localstack-parity.sh, sourced by the image's entrypoint. A JVM run or
a native binary on the host never saw it.

LocalStackParity now computes the same mapping and LocalStackParityConfigSource
serves it at ordinal 301, just above environment variables, as the exported
variables did. A key is produced only when its Floci variable is unset, so an
explicit Floci setting still wins; the DNS suffixes are still appended to any
configured ones; LOCALSTACK_PARITY=false still turns it all off.
TlsConfigSource, which reads its properties before the configuration exists,
consults the mapping too.

The script, its shell test and every Dockerfile copy of it are removed; the
test cases move to LocalStackParityTest.

Refs #5767

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

* fix(core): keep TLS backends on loopback, keep configured DNS suffixes, and pass LocalStack settings to hooks

Review follow-ups for the Java LocalStack translation:

- Dockerfile.compat took docker-entrypoint.sh from the published native
  image, which still sourced the removed localstack-parity.sh, so the compat
  image never became healthy. It now copies the entrypoint from the build
  context, as it already does healthcheck.sh.
- At ordinal 301 the parity source outranked TlsConfigSource's loopback pin
  (300): with TLS on and GATEWAY_LISTEN set, the backends bound the gateway
  address while the proxy dialled 127.0.0.1. It now sits at 299, below
  environment variables and the TLS source and above .env and
  config/application.yml, where the exported variables used to be.
- floci.dns.extra-suffixes is no longer a translated property, which on JVM
  and native runs replaced suffixes set in application.yml. The five
  readers append LocalStack's and Floci's suffixes to the configured list
  through LocalStackParity.withDnsSuffixes instead.
- GATEWAY_LISTEN=0.0.0.0:4566 (or [::]:4566, or a list) gives the host to
  quarkus.http.host and the port to floci.port when EDGE_PORT is unset,
  instead of a host Floci rejects as malformed.
- Init hooks get the translation as FLOCI_*/QUARKUS_* variables again, as
  they did when the entrypoint exported them.

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

* fix(core): parse LOCALSTACK_HOST and GATEWAY_LISTEN the way LocalStack does

Both take LocalStack's host-and-port forms (HostAndPort.parse in its
config.py): host:port, host, :port, [v6]:port and [v6].

- LOCALSTACK_HOST is <hostname>:<port>, localhost.localstack.cloud:4566 by
  default. Its port went into floci.hostname, so the base URL came out as
  http://localhost.localstack.cloud:4566:4566. floci.hostname now gets the
  host alone.
- GATEWAY_LISTEN=:4566, LocalStack's default host on 4566, did not match
  and stopped startup with "Refusing to listen on malformed host". An empty
  host now keeps Floci's own bind address and takes just the port.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 17:37:15 -04:00
Andre Kurait 720f95bebe fix(ci): retain Docker fixture sockets and bound result uploads (#5877)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-17 14:09:42 -04:00
Hector Ventura 5370920012 chore(release): publish standalone floci-aws binaries as release assets (#5844)
* chore(release): publish standalone floci-aws binaries as release assets

The release already built Linux native executables, but only to package them
into the images; they were discarded after a day and releases carried no
assets. Users without Docker had nothing to download.

release.yml now also builds macOS (arm64, and x86_64 under Rosetta) and Windows
x86_64 binaries with GraalVM Community, smoke-tests every binary on its own
runner with .github/scripts/smoke-binary.sh (version matches the tag, SQS and
DynamoDB round trips, clean stop on SIGTERM), and checks that the Linux amd64
binary still starts on glibc 2.34 (Ubuntu 22.04). A new publish-binaries job,
the only one with write access to the release, stages the six executables as
floci-aws-<os>-<arch>, writes sha256sums.txt, signs every file with keyless
cosign sign-blob, attests build provenance, and uploads them to the release
semantic-release created. Build artifacts are kept 7 days so that job can be
re-run on its own.

make native-install now installs floci-aws, since floci is the CLI.

Refs #5767

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

* fix(release): check the glibc 2.34 floor on every Linux binary and wait for the release

Review follow-ups for the binary release jobs:

- The floor check started the amd64 binary on Ubuntu 22.04, whose glibc is
  2.35, so a binary that needed 2.35 would have passed. check-glibc-floor.sh
  now reads the newest GLIBC_ symbol version the binary requires with
  readelf and fails above 2.34, then starts it in UBI 9, whose glibc is 2.34.
- The two arm64 builds had no floor check at all; they run the same script.
- publish-binaries waits up to 10 minutes for semantic-release to create the
  GitHub Release before uploading, instead of failing if it is not there yet.

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

* fix(release): build darwin-amd64 with a pinned, checksummed GraalVM Community

The macOS x86_64 job downloaded Oracle GraalVM from download.oracle.com's
"latest" URL: not the Community build the job's comment names, unpinned and
unchecked, though its output is then signed and attested as ours. It now
fetches GraalVM Community 25.0.1, the last release with a macOS x64 build,
from graalvm-ce-builds and checks it against the published SHA-256 before
extracting it.

The publish-binaries header said semantic-release creates the release
before pushing the tag; it pushes the tag first, as the upload step says.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 12:36:20 -04:00
TATSUNO “Taz” Yasuhiro 6e01216f88 feat(lambdaweb): serve endpoint domains from a Node.js environment per revision (#5760)
* feat(lambdaweb): serve endpoint domains from a Node.js environment per revision

A request whose Host is an endpoint's domainName goes over HTTP/1.1 to
a container that Floci starts from the revision's S3 code on the first
request: public.ecr.aws/lambda/nodejs:24 with the code in /var/task,
index.js or AWS_LAMBDA_NODEJS_ENTRYPOINT as the entry file, the node
flags and the environment variables AWS sets, ten seconds to listen,
SIGTERM and one second when idle, and a fresh environment after the
process exits between requests.

The forwarded request carries the headers AWS adds and loses the ones
AWS drops. The response carries lambda-web-request-id and
lambda-web-logstream and streams as the app writes it. Two revisions in
revisionWeights split the traffic by weight. The platform pages for an
unsupported method, an unknown domain, HTTP/1.0, a server that does not
listen, a timeout, a crash and a disabled endpoint are the AWS pages.

Part of #5699

* fix(lambdaweb): index endpoint domains and claim only the minted host shapes

A request looked its domain up by scanning every stored function across
accounts and iterating live endpoint maps outside the function lock. The
service now keeps a domain index, filled from storage at start and kept
by the create and delete paths, and copies the function under its lock.
The data plane claims only hosts shaped like the domains Floci mints, in
any case and with any port, so a dotted S3 bucket with a lambda-web
label still reaches S3.

* fix(lambdaweb): reserve environments against the idle reaper and track exits

acquire now reserves the environment under the same lock the idle
reaper takes, so a request cannot start on a container the reaper is
about to stop. Docker faults in the reaper and in discard are contained
so one error does not end the periodic run or skip the removal. The exit
watcher records the exit time and arms itself again when its stream
drops, and a request that found a dead process is replayed only when
that recorded exit came first, never because the container is gone. The
unpacked code directory is removed on every path. The container gets the
execution role's session credentials when the role exists, and the
function account's credentials otherwise, as the Lambda launcher does.

* fix(lambdaweb): bound the whole exchange by timeoutSeconds and forward chunked bodies

timeoutSeconds is a deadline on the whole request, as recorded against
AWS: a response that has not started by then is the 504 page, one that
is still streaming is cut, and a slow upload gets its 504 once the body
is in, since the edge takes the body before it answers. A body without a
Content-Length is sent chunked instead of carrying the client's
Transfer-Encoding header. A failure of the upload stream ends the
exchange and releases the environment once.

* test(compat): probe the unknown Lambda Web domain in the shape Floci mints

The data plane claims only hosts shaped like the domains it mints, so
the unknown-domain check needs a 16 character id to reach it.
2026-10-15 22:50:05 -05:00
Hector Ventura 1ec4f957af ci: drop the em-dashes from the release-cut concurrency comment (#5704)
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-14 23:36:17 -05:00
Hector Ventura cb58b12b41 ci: cut a release at 00:30 Central on the 15th and last day of the month (#5698)
Schedule release-cut.yml at 00:30 on the 15th and on days 28-31 with timezone America/Chicago, so GitHub handles DST. A gate job passes only on the 15th or on the actual last day of the month; manual dispatch is unchanged. The release-cut concurrency group moves to the release job so skipped scheduled runs never hold or replace a pending cut.

README.md, CONTRIBUTING.md and the docs/ pages now describe the new train: stable releases on the 15th and the last day of each month, cut automatically at 00:30 US Central time.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-14 23:29:36 -05:00
dependabot[bot] ad68ae3248 chore(deps): bump the actions-minor-patch group with 3 updates (#5682)
Bumps the actions-minor-patch group with 3 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact) and [actions/setup-node](https://github.com/actions/setup-node).


Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

Updates `actions/setup-node` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-14 18:31:52 -05:00
Hector Ventura 7f0da8ba2b chore(deps): bump Quarkus to 3.40.1 and the native-safe minor and patch updates (#5617)
Takes the updates from the Dependabot group in #5335 that do not break
the native image:

- quarkus-bom and quarkus-maven-plugin 3.39.2 to 3.40.1
- jackson-bom 2.22.2 to 2.22.3
- h2 and h2-mvstore 2.4.240 to 2.5.252
- bcprov-jdk18on 1.85.2 and bcpkix-jdk18on 1.85 to 1.86
- neo4j-java-driver 6.2.1 to 6.3.0
- checkstyle 14.1.0 to 14.3.0
- Maven 3.9.16 to 3.10.0 in the wrapper properties

and holds back three, each now ignored in dependabot.yml so the group
stops proposing them:

- proto-google-common-protos stays at 2.49.0. This is what failed the
  native build on #5335: from 2.65.0 on the artifact is generated for
  protobuf-java 4 and its classes need com.google.protobuf.GeneratedFile,
  which the pinned protobuf-java 3.25.9 does not have, so initializing
  apicurio's FileDescriptorUtils at image build time ends in a
  NoClassDefFoundError.
- httpcore5 and httpcore5-h2 stay at 5.3.6, and httpclient5 at 5.5.1.
  Both pins are deliberate and explained in pom.xml: httpcore5 5.4 breaks
  every Docker call in the native image, and httpclient5 5.6 needs
  org.tukaani:xz at native link time.

The mvnw and mvnw.cmd scripts are left as they are: regenerating them
drops the check from #4751 that refuses the unverifiable .tar.gz fallback
when a distribution checksum is set.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-14 18:54:40 -04:00
Hector Ventura d3999ad416 chore(compat): run the partition nightly in GovCloud and EUSC too (#5616)
The partition compatibility nightly ran the Java SDK suite in cn-north-1
only. GovCloud (IAM signs us-gov-west-1, no CloudFront) and EUSC (no
global endpoints) take their own code paths and had no end-to-end check.
The job is now a matrix of cn-north-1, us-gov-west-1 and eusc-de-east-1;
a dispatch that names a region runs that region alone.

Measured locally on main 367ae0b2d with a JVM image: a us-east-1 control
run and one run per new region, 2461 tests each. Beyond the control
run's one failure, GovCloud showed one and EUSC four, all in tests that
assumed the commercial partition, so they are fixed here and both new
allowlists start empty:

- WafV2Test.cloudfrontScopeIsolated created a CLOUDFRONT-scope IP set,
  which Floci refuses where CloudFront does not exist. It now runs only
  in the partitions that have CloudFront.
- S3Test built its LocationConstraint through the SDK enum, which has no
  value for eusc-de-east-1 and is then sent as the literal "null". It
  passes the region id as a string.

The workflow checks the suite out at the commit the nightly image was
built from, so the new legs first run with these fixes on the nightly
after this lands.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-13 23:58:24 -04:00
Priamo Germosen eba058266b fix(iam): authorize an operation as the action AWS checks for it (#5604)
Under enforcement a request naming its operation, in a Query Action or an
X-Amz-Target header, was authorized as <namespace>:<Operation>, the operation's
own name. AWS authorizes some operations as an action of another name: SQS
SendMessageBatch, DeleteMessageBatch and ChangeMessageVisibilityBatch as
sqs:SendMessage, sqs:DeleteMessage and sqs:ChangeMessageVisibility, and SNS
PublishBatch as sns:Publish. None of the batch names is an IAM action, so a policy
AWS honours for a batch call was denied, and a policy naming the batch operation
granted something AWS does not check.

AWS publishes the mapping in the Operations of each Service Reference file.
tools/aws/regen_iam_authorized_actions.py vendors the operations authorized by
exactly one action of their own namespace under another name, 235 over 33
namespaces, into src/main/resources/aws/iam-authorized-actions.json. Everything else
keeps its own name. The generator leaves out operations that list:
- several actions, whose extras apply only when tags or a role are passed;
- no action, which is missing data;
- an action of another namespace;
- another action while one of the operation's own name exists;
- a tagging action alone;
- the same action for several SDK clients, which AWS can authorize differently,
  as S3 and S3 Control's GetPublicAccessBlock;
or whose name is listed again with another answer. A record of the wrong shape
fails the run instead of being skipped.
make iam-authorized-actions-check gates the file's shape on pull requests that touch it, and
iam-authorized-actions-verify, run by the IAM Data Drift workflow, checks every
entry against AWS.

IamAuthorizedActions reads the file through the new core.common
VendoredResources, rather than adding one more copy of the read-or-fail block a
dozen catalogs carry, and the Query and X-Amz-Target paths ask it for the action.
DynamoDB TransactGetItems, which AWS authorizes as dynamodb:GetItem, keeps its own
name: the transaction check recognizes the call by it and checks every Get as
dynamodb:GetItem on its own table, with its own dynamodb:LeadingKeys. Renamed, the
call would skip that check and be authorized as one GetItem whose body has no
top-level Key, which a ForAllValues condition accepts, so a fine-grained policy
would grant every key.

The check for operations AWS serves without credentials reads the Query action
directly, rather than through resolve with a placeholder scope, now that resolve
returns the authorized action. A Query request naming no action is not one of them.

An SDK compatibility test covers SendMessageBatch and PublishBatch, granted by
the single-item action and refused under the batch name, with enforcement on.
2026-10-13 22:29:06 -05:00
Priamo Germosen d884d55c26 fix(iam): evaluate every IAM action against the resource it acts on (#5404)
Under enforcement, almost every IAM action reached the policy evaluator with
* as its resource, because ResourceArnBuilder named only the server-certificate
operations and everything else fell through to the wildcard. A statement naming
an IAM resource was therefore ignored, and wrongly in both directions, because
the evaluator globs the statement's pattern against the request's resource and
a resource of * is matched as that literal string. So a Deny on
arn:aws:iam::000000000000:user/bob did not stop DeleteUser for bob, while an
Allow scoped to that same user did not permit DeleteUser on anyone at all: a
least-privilege policy naming the resource it meant to grant refused the call.
Measured both ways by reverting this resolver to the wildcard, which turns the
permitted call in aResourceScopedAllowGrantsThatUserOnly into a 403 and the
refused call in aDenyNamingOneUserLeavesTheOthersAlone into a 200. Nothing
failed and nothing warned, which is the dangerous shape for an emulator people
test policies against.

The resource type each action is evaluated against now comes from AWS's own
authorization metadata for IAM, action by action. That is not the parameter an
action happens to take: AddUserToGroup and RemoveUserFromGroup are evaluated
against the group, AddRoleToInstanceProfile and RemoveRoleFromInstanceProfile
against the instance profile, and EnableMFADevice, DeactivateMFADevice and
ResyncMFADevice against the user rather than the device they name. Mapping those
from the request's parameters would have scoped them to the wrong resource and
let a deny on the right one pass.

An action acting on a resource that exists is checked against that resource's
stored ARN. The reference gives the formats as user/${UserNameWithPath},
group/${GroupNameWithPath} and so on, so the path is part of the ARN a policy
names, and only the store knows it; the stored ARN also carries the partition
the resource was created in, which re-minting from the caller's signing region
would get wrong. A create has nothing stored, so its ARN is minted from the
request's own Path: reading a stored path there would authorize a create into
/team/ against the root path.

A policy, MFA device, SAML provider, OIDC provider or principal is named by an
ARN the request already carries, so that is passed through rather than rebuilt
from parts. Only an ARN is: a hardware MFA device's SerialNumber is a bare
serial, and naming the request after it would produce a resource no policy could
be written against.

That table is read before the one keyed by resource type, so an action in both
would silently take its ARN parameter and the mistake would look like a resource
that never matches rather than like a bug. An attach is the case that makes it
worth pinning down: it carries both a user and a policy ARN, and the reference
gives it the user alone, so it stays out of that table and
iamNamesTheUserRatherThanThePolicyOnAnAttach is what holds it there.

UpdateUser and UpdateGroup join UpdateServerCertificate in naming both the old
resource and the one the request would produce. Both are documented, which the
certificate case was not: UpdateUser's reference says the requester "must have
appropriate permissions on both the source object and the target object", and
UpdateGroup's that a principal allowed to update the old group but not the new
one has the update fail.

Two actions name their role indirectly and are derived rather than looked up.
CreateServiceLinkedRole does not name the role it creates, so the check reads
the same ServiceLinkedRoles table the create reads and cannot name a different
role. GetServiceLinkedRoleDeletionStatus carries only a DeletionTaskId, and its
reference publishes that identifier's format as
task/aws-service-role/<service-principal-name>/<role-name>/<task-uuid>, which is
the role's own path and name with a prefix in front and a uuid behind; the role
is already deleted by the time the status is asked for, so there is no stored ARN
left to read either way. The /aws-service-role/ path moved to that class, so there is one copy of
it rather than a second in the builder. GetAccessKeyLastUsed names only a key,
and is evaluated against a user: the User Guide's own iam:*AccessKey* example
scopes exactly that set to user/${aws:username}, so the owner is resolved from
the key.

That covers all 130 of the IAM actions this emulator dispatches that AWS gives a
resource type, out of 164 in total. The remaining 34 have no resource type in the
reference, such as ListUsers, GetAccountSummary and SimulateCustomPolicy, so *
is the right answer for them. An action that names its target only by defaulting
to the calling user, such as GetUser or ChangePassword with no UserName, is
resolved from the credential instead, which the last paragraph here sets out.

Nine enforcement tests drive the whole path rather than the ARN the builder
returns, since the defect was invisible: a scoped statement was ignored, not
rejected. They cover a deny that must bind to one user and leave another alone,
the stored path being part of the ARN, the group and the instance profile being
the resource where two entities are named, a managed policy named by ARN, a
create authorized against the path it asks for, a rename refused on its
destination alone, and a scoped Allow granting one user only. Reverting the
mapping to the wildcard fails all nine.

The map is vendored rather than written out here, because a hand-written copy of
AWS's metadata is exactly what tools/aws exists to prevent.
regen_iam_action_resources.py generates src/main/resources/aws/iam-action-resources.json
from the same reference, 190 actions with the resource types each is authorized
against plus the ARN format of all 15 resource types, and it gates the file the
way regen_service_namespaces.py gates the namespace list: --check offline for
shape, --verify online against AWS. A type the file claims and AWS does not fails,
since that would authorize against a resource AWS does not use, which is the one
outcome worse than the wildcard. A type or an action AWS has added is reported
without failing, because being behind leaves that action on * and failing there
would break this build for someone else's launch. make
iam-action-resources-check runs per pull request beside the namespace check, and
make iam-action-resources-verify weekly in the drift workflow. Its unit tests need
no step of their own: make aws-data-test in that same job already runs every
generator's.

So no list of actions is written down here. What stays in code is the half that is
Floci's rather than AWS's: the parameter each resource type arrives in, the nine
creates and the name each spells, the actions whose request carries an ARN, the
three resolved from something other than a name, and the three resource types
that belong only to actions the handler does not dispatch. IamActionResourcesTest
checks the code against the data: every resource type AWS uses must be resolved
or declared unresolved, every create must have exactly one type to mint, and
every minted prefix must match the ARN format AWS publishes for that type. A
regeneration that brings in a new resource type then fails a test naming the
type, rather than quietly putting that action back on *, which is the permissive
answer and a silent one. The create check reads the resolver's own map rather
than restating it, so a create added there is checked too, and the minting falls
back to the wildcard instead of indexing an empty list: a create AWS authorizes
against no single type has no ARN to build, and a request should not fail on
what is a defect in this class.

The reason each declared-unresolved type gives is a claim about the handler, not
about the builder, so nothing inside the builder can check it, and getting it
wrong is silent and fail-open: dispatching such an action without teaching the
resolver its type leaves it evaluated against *, which is the gap this closes.
UnresolvedResourceTypesIntegrationTest therefore sends every action carrying one
of those types and holds it to answering UnsupportedOperation, naming the action
and what to do if it no longer does. No other vendored-data loader validates at class init
either, so the checks read the data the way AwsPartitions and
AwsServiceNamespaces do: parse, and let the gate and the tests have the opinion.

The nineteen user actions whose UserName the model marks optional act on the
user who signed the request, so that user is the resource they resolve to. The
access key id in the credential names the identity, which is the same lookup
GetAccessKeyLastUsed already makes on a key passed as a parameter, and the
stored ARN carries the path and partition as everywhere else here. The wildcard
still stands when the signer is not an IAM user, an account's root stand-in and
a session credential having no user record to name.

What stays at the wildcard is what AWS gives no resource type, 34 of the 164.

Closes #4979

The online gate verifies the ARN formats as well as the action mapping. A format
drifts invisibly otherwise: the offline check only asks whether it still looks
like an IAM ARN, and a changed one does, while the minting reads that string to
place the resource type. So a right-looking file could build a wrong ARN.

The resource types this class covers are worked out from its own tables rather
than restated in the test, so a type cannot be waved through by adding it to a
list in the test file. That is the check the earlier startup guard made.

The three actions whose resource the request carries in some other form hold
their own resolver, rather than being listed in one place and routed by name in
another. A list cannot then say an action is handled while the dispatch has
nothing for it, since adding a key means supplying the resolver that goes with
it.

The enforcement suite removes what it creates. The emulator is shared, so a user,
group, role, profile, policy or provider left behind turns up in the next class
to list one, and the shared fixture helper grew the prerequisites IAM enforces
before a delete: group memberships and attached policies for a user, inline and
managed policies for a role and a group. A rename leaves its destination name
behind rather than the name that was created, and the create test goes through
the enforced path, so both register their own removal.

The drift workflow stays one check, and make iam-data-verify is what keeps that
honest. Two sequential steps stop at the first failure: while the namespace list
was stale, the action resource check this change adds never ran at all, so the
gate arrived unexercised in CI. The target runs both regardless of the first
result and then fails, naming the file that drifted rather than leaving a reader
to guess from one message. The workflow file is renamed to match what it covers,
and the IAM targets it uses join .PHONY, which they should have done when they
were added.

That namespace check was red because AWS retired evidently and iotevents, and
the vendored list still claimed both. Regenerating it drops those two, picks up
end-user-messaging and startups, and leaves the count at 456. A retired
namespace only narrows wildcard expansion; a policy naming one literally is
still reported, since a namespace written out is kept whether or not the catalog
knows it.
2026-10-11 09:12:29 -05:00
Hector Ventura 379086f818 ci: let a running main CI run finish instead of cancelling it (#5396)
* ci: let a running main CI run finish instead of cancelling it

A CI run takes about 18 minutes and merges often land closer together
than that, so cancel-in-progress on refs/heads/main stopped runs partway
through: from 2026-10-05 to 2026-10-09, 77 of 138 CI runs on main were
cancelled, leaving most main commits without a result and a break
pointing at the wrong commit.

Cancel only on pull requests. On main the concurrency group still holds
one pending run that a newer merge replaces before it starts, so a burst
of merges is tested once, at its newest commit, and no run stops halfway.

Refs #5085

* ci: stop cancelling main runs in the other workflows that run on pushes to main

Checkstyle, Docs in sync and Partition Literals run on pull requests and
on pushes to main, so they get the same rule as ci.yml: cancel a superseded
run only on pull requests. The docs deploy never runs on pull requests, so
it stops cancelling altogether.

The remaining workflows named in #5085 (compatibility, compat-partitions,
iam-namespace-drift, nightly) have no push trigger, so a merge to main
never cancels them and they are left as they are.

Refs #5085

* ci: state the measured cancellation figures in the ci.yml comment

The comment quoted one-day figures (30 of 47 runs, a 13 minute median gap, 546 runner-minutes) that the run history does not reproduce. Replace them with the count measured from it: 77 of 138 CI runs on main cancelled from 2026-10-05 to 2026-10-09.

Refs #5085

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-11 00:06:59 -05: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
TATSUNO “Taz” Yasuhiro e4278a800c chore(style): Enforce no-FQCN rule on new files, existing bad files later (#5094)
* chore: flag unnecessary fully qualified type names with Checkstyle

Use the built-in UnnecessaryFullyQualifiedType check. It allows a
qualified name when another type with the same simple name is used in
the same file.

The 379 files that have such names today are listed in
suppressions.xml, so only new files are checked for now. Remove an
entry once its file is clean.

* docs: drop the written no-FQCN rule now that Checkstyle checks it

* docs: keep the written no-FQCN rule for files Checkstyle still skips

The baselined files are not checked, and the comment that names a clash
is not something the check can enforce.
2026-10-10 09:22:14 -05: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
dependabot[bot] 2444c52811 build(deps): bump graalvm/setup-graalvm (#5336)
Bumps the actions-minor-patch group with 1 update: [graalvm/setup-graalvm](https://github.com/graalvm/setup-graalvm).


Updates `graalvm/setup-graalvm` from 1.6.6 to 1.6.7
- [Release notes](https://github.com/graalvm/setup-graalvm/releases)
- [Commits](https://github.com/graalvm/setup-graalvm/compare/0426e2e191540e8514dff98dc52a5f5146a2a276...27b360dbb857524eaf0b4c4cef364d38e5b4f173)

---
updated-dependencies:
- dependency-name: graalvm/setup-graalvm
  dependency-version: 1.6.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-08 23:14:18 -05:00
Hector Ventura 408cd8feac chore(deps): let Dependabot move the botocore pin behind the AWS data (#5295)
src/main/resources/aws/*.json is generated from the botocore version
pinned in tools/aws/requirements.txt, and nothing moved that pin, so a
region, partition or service AWS added later was never flagged. A
monthly Dependabot pip update, allowed for botocore only, now proposes
the bump; its PR runs the Partition Literals workflow, whose
aws-data-check fails when the new release changes the vendored data,
and the comment in dependabot.yml says how to regenerate it.
2026-10-08 23:37:02 -04:00
dependabot[bot] 52985a2f19 build(deps): bump the actions-minor-patch group with 8 updates (#4867)
Bumps the actions-minor-patch group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [graalvm/setup-graalvm](https://github.com/graalvm/setup-graalvm) | `1.6.4` | `1.6.6` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.0` | `8.0.1` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.3.0` | `4.4.1` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `7.3.0` | `7.4.0` |
| [actions/setup-java](https://github.com/actions/setup-java) | `6.0.0` | `6.0.1` |
| [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `6.2.3` | `6.3.0` |
| [aws-actions/amazon-ecr-login](https://github.com/aws-actions/amazon-ecr-login) | `2.0.1` | `2.1.7` |


Updates `graalvm/setup-graalvm` from 1.6.4 to 1.6.6
- [Release notes](https://github.com/graalvm/setup-graalvm/releases)
- [Commits](https://github.com/graalvm/setup-graalvm/compare/5298d94fb55a4f185c602eeac5de1b553882abe2...0426e2e191540e8514dff98dc52a5f5146a2a276)

Updates `actions/upload-artifact` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v7...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

Updates `actions/download-artifact` from 8.0.0 to 8.0.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v8...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c)

Updates `docker/setup-buildx-action` from 4.3.0 to 4.4.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/37fe631027851001ddb9b187196cc803df7f5f0e...f87e5991a6d7451dcb8d9637bfbc97413f497069)

Updates `docker/build-push-action` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/53b7df96c91f9c12dcc8a07bcb9ccacbed38856a...c3c9e263c25d99ce0380d002d59b67737d91b0dc)

Updates `actions/setup-java` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/dd06d9cba3e5552c54d9f8ea23572deb30010f7c...de7274f081f381c8f8158605e0321c36c376e2e6)

Updates `aws-actions/configure-aws-credentials` from 6.2.3 to 6.3.0
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/e6de054238d6b7531b4efff3b6587d9aade6a06c...e1253824e5c10ff9df46874f81ed3ec929e19cfd)

Updates `aws-actions/amazon-ecr-login` from 2.0.1 to 2.1.7
- [Release notes](https://github.com/aws-actions/amazon-ecr-login/releases)
- [Changelog](https://github.com/aws-actions/amazon-ecr-login/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/amazon-ecr-login/compare/062b18b96a7aff071d4dc91bc00c4c1a7945b076...03f1aad4c6c7ffd436567f42f9384779290529bd)

---
updated-dependencies:
- dependency-name: graalvm/setup-graalvm
  dependency-version: 1.6.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: docker/build-push-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: actions/setup-java
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: aws-actions/configure-aws-credentials
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: aws-actions/amazon-ecr-login
  dependency-version: 2.1.7
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-08 22:18:24 -05:00
David Phillips da6a7dd085 build: enforce Java import order with Checkstyle (#5326)
* style: align Java imports with project guidelines

* build: enforce consistent Java import order

* style: follow IntelliJ import order
2026-10-08 20:50:53 -04:00
Vũ Thế Huy dc41417e79 fix(ec2): avoid Docker waits on the first CreateVpc (#5179)
* fix: avoid Docker waits on first EC2 CreateVpc

* fix(ec2): reseed default VPC resources after a state reset

Ec2Service now implements Resettable: clear() forgets the seeded account
scopes and seeds the default region again, so a reset followed by
DescribeVpcs still returns the default VPC and subnets.

Also run Ec2CreateVpcLatencyTest in the non-mock EC2 compatibility job,
where VPC planning is active and a regression of the first-call Docker
wait would be caught.

* refactor(ec2): share one default-region seeding method between startup and reset

Ec2Startup and Ec2Service.clear() repeated the same enabled check and seed call. Both now go through Ec2Service.seedDefaultRegionIfEnabled() so they cannot drift apart. Also reorder the Resettable import.
2026-10-08 19:25:31 -04:00
Priamo Germosen df4fa58ea1 fix(iam): take service-linked role names and suffix support from AWS evidence (#5293)
CreateServiceLinkedRole guessed both things it cannot derive. The role name came
from capitalising the principal, which is wrong for 141 of the 162 services the
table covers: acm.amazonaws.com is AWSServiceRoleForCertificateManager on AWS and
was AWSServiceRoleForAcm here. And a CustomSuffix was accepted for every service,
where AWS refuses one for 68 of the 71 it has been recorded against, so the
emulator minted roles AWS would have rejected outright.

Both now come from iam/service-linked-roles.tsv, generated by
tools/slr/service_linked_roles.py and gated by make slr-check. One table, because
both facts come out of one pass over the same AWS-validated snapshot: the name
from a recorded create response, the suffix verdict from the test's own
parameterisation. Writing either by hand only captures what someone noticed, and
every finding behind this change came from grepping.

Sources, each row recording its own: recording, actual create responses and the only
source that can establish suffix support; policy-documents, role ARNs in the vendored
AWS managed policies, names only; and docs, from AWS's own service-linked role
pages, quoted and linked in the generator. Counts live in the table's header, where
this script keeps them right.

Two shapes in the policy documents have to be refused rather than read, and both
were being read. A name followed by `*` is a prefix pattern: the policy writes
AWSServiceRoleForAmazonCognitoIdpEmail* where the recorded create returns
AWSServiceRoleForAmazonCognitoIdpEmailService, so reading the prefix invents a role
AWS never mints. Twenty-one principals rested on nothing but such a prefix. And a
role name is unique per account, which these documents ignore: they point
maintenance.elasticbeanstalk at the parent's AWSServiceRoleForElasticBeanstalk, so
taking that at face value made the sibling's create fail as a duplicate of a role
it does not own. A collision guard drops the weaker row back to the derived
fallback and says so; an unresolvable collision is an error for a human.

KNOWN_SOURCE_CONFLICTS is empty as a result. Its one entry was never a
disagreement between sources, only that truncated prefix read as a name. The
mechanism stays for a real one.

make slr-check runs offline: policy-documents rows must still match the vendored
JSON, every vendored service must be in the table, it must be sorted, and a suffix
verdict on a non-recording row is an error because nothing but a recording can
establish one. Three extraction traps have a test each, all three being ones the
real data walked into: an underscore can be part of a name, so splitting on the
CustomSuffix separator truncates ApplicationAutoScaling_CassandraTable; a policy
matching suffixed roles writes the prefix with a trailing separator; and a
wildcard ARN names a role without saying which principal mints it, which is how an
earlier pass handed plain GuardDuty the MalwareProtection role's name.

The name was not only wrong against AWS, it was inconsistent within the tree.
ConnectService built an ARN for AWSServiceRoleForAmazonConnect while
CreateServiceLinkedRole minted AWSServiceRoleForConnect for the same principal:
two roles for one purpose. GuardDutyService, MacieController and RamController
each hard-coded their own name too, and all four were right where IamService was
wrong. They read the table now, and a test fails if a principal any of them builds
an ARN for loses its row, since the fallback would quietly derive a name again.

ApplicationAutoScalingService was wrong a different way. It maps a namespace to a
dimension itself, and had no arm for appstream, cassandra, ec2 or sagemaker, so
all four fell to CustomResource where AWS names them AppStreamFleet,
CassandraTable, EC2SpotFleetRequest and SageMakerEndpoint. It prefers the table
now and keeps its switch for the namespaces nothing records, where the shape is
right even when the dimension is a guess. Its dynamodb arm is gone with the rest:
the table covers that namespace, so the arm was unreachable and a second copy of a
fact the table owns, free to disagree with it while never running. A test pins
dynamodb resolving through the table, since removing the arm is what left nothing
else covering it.

Two behaviour changes worth calling out. rds.amazonaws.com is AWSServiceRoleForRDS
rather than the derived Rds, which flipped one existing expectation. And two table
names are long enough that a suffix alone breaches the 64-character RoleName
limit, ApplicationDiscoveryService's ContinuousExport role leaving three
characters and SageMakerEndpoint six, so that check now reports "The role name"
rather than "The derived role name", which stopped being true.

cloud9 is in the table because deleting IamService's three-entry override map
dropped it: autoscaling and ram were covered, cloud9 was not, and it regressed to
the derived AWSServiceRoleForCloud9. Two tests caught it. Rather than restore the
literal, which is the circular sourcing this work exists to remove, its User Guide
settles it and the row carries that citation.

The table is registered in quarkus.native.resources.includes rather than exempted
from it. AwsManagedPolicies is exempt because parsing its 3.5 MB at image build time
and keeping the result in the heap beats shipping the source twice; at 13 KB that
saving is not worth depending on the static initialiser running at build time, and
NativeImageResourceIncludesTest is the thing that says so.

The header records the sha256 of the snapshot the recording rows came from, because
that half cannot be rechecked offline and --check can only say so rather than fix
it. A digest makes the next --refresh a diff against a known source: an unchanged
digest means any difference in the table came from the vendored policy documents,
and a changed one says the recordings moved with it. --check cannot verify the
digest without the snapshot, but it does reject a table that has quietly lost the
line, or one claiming no snapshot while carrying recording rows.

Refs #5084
2026-10-08 07:49:50 -05:00
Hector Ventura d1fc2654a9 ci: cap open PRs at 4 with drafts and 2 ready for review (#5283)
Describe the new open-PR limits (floci-loft decision 0021) in CONTRIBUTING.md
and the PR template, and grant the caller contents: write, which the shared
workflow needs to convert a PR back to a draft.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-07 17:49:31 -05:00
Hector Ventura 6d417e522f fix(ci): pass VERSION to the nightly native image build (#5165)
The native nightly step built docker/Dockerfile.native-package without the VERSION build argument, so FLOCI_VERSION fell back to latest and a nightly reported itself as latest on the health endpoint. The compat step and release.yml already pass it.
2026-10-05 23:56:39 -05:00
Hector Ventura fde5170335 test(compat): take the partition and region from TestFixtures in the last 33 suites (#5052)
Third and last batch of the cn-north-1 allowlist burn-down (#4272). The 41
remaining entries all pinned commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., arn:aws: prefix assertions, us-east-1 zones,
hosts and filter strings, and clients or signers created for us-east-1
next to the cn-north-1 fixture clients. Among them, the RDS IAM-token tests
signed their tokens for us-east-1, OrganizationsTest built its invited
account's client for us-east-1, Route53Test associated VPCs as us-east-1
that live in the fixture region, and SesEventPublishingTest failed in setup
on a us-east-1 event bus ARN.

All 33 classes now derive those values from TestFixtures, so the allowlist
is empty: any failure in the China nightly fails the run.
2026-10-03 23:46:21 -04:00
Hector Ventura 6deb0d4d2b test(compat): run the China-absent tests per partition instead of allowlisting them (#5027)
* test(compat): run the China-absent tests per partition instead of allowlisting them

Third batch of the cn-north-1 allowlist burn-down (#4272): the 13 tests that
exercised something AWS does not offer in China. Seven keep running there
with the China shape:

- S3Test: only the us-east-1 endpoint creates a bucket in another region, so
  elsewhere the location-constraint round trip names the client's own region.
- StsTest: the SAML assertion's Recipient is the partition's console sign-on
  URL (the CDK region facts), signin.amazonaws.cn in China.
- Ec2Tests: China names its interface endpoint services cn.com.amazonaws, so
  the S3 gateway and interface offerings are two services there.
- IamTest: GetAccountSummary reports GlobalEndpointTokenVersion only in the
  commercial partition, the one with a global STS endpoint.

Six skip where the service has no endpoint: the five Marketplace tests (the
regions botocore publishes for each) and Lightsail (commercial only).

The allowlist's China-absent section is gone, 13 entries, 73 to 60.

* test(compat): derive VPC endpoint names from the DNS suffix and keep Marketplace guards to us-east-1

The ECR interface service is named under the partition's DNS suffix reversed
in every China, EUSC and ISO region (eu.amazonaws, gov.ic.c2s, ...), not only
in China, so describeVpcEndpointServices now takes that prefix from the SDK's
partition metadata. S3 keeps the China-only split, the only regions where
AWS lists it.

Floci serves Marketplace Agreement and Entitlement only in us-east-1, so
their guards no longer admit the other regions AWS runs them in; widening
both is a separate change.
2026-10-03 17:53:57 -04:00
Hector Ventura dfe2117fed test(compat): take the partition and region from TestFixtures in five more suites (#5025)
Second batch of the cn-north-1 allowlist burn-down (#4272). These tests pinned
the commercial partition, so they failed against a China deployment for the
test's own reasons, not Floci's:

- AppSyncTest asserted the arn:aws:appsync: prefix on four ARNs.
- Ec2DescribeSpotPriceHistoryTest filtered on us-east-1a and us-east-1b.
- PipesTest built its role, SQS and Kinesis ARNs in arn:aws and us-east-1.
- IamTest looked its user up by an arn:aws ARN; its AWS managed-policy prefix
  and the SimulatePrincipalPolicy source now follow the partition too.
- CloudWatchLogsMetricFilterTest replaced the recorded @aws.region dimension
  with us-east-1, and MetricFilterQueryAssertions signed its Query request for
  us-east-1, so it read another region's metrics.

All now derive the partition and region from TestFixtures. The allowlist drops
19 entries, from 73 to 54.
2026-10-03 15:54:55 -04:00
Hector Ventura fa30cd7834 test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests (#5017)
* test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests

The cn-north-1 nightly allowlists 25 cases in SesTagResourceTest,
SsoAdminAccountAssignmentTest and SesConfigurationSetEventDestinationTest
that fail only because the tests pin commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., the arn:aws: AWS-owned SSO application
provider and managed policies, and a us-east-1 primaryRegion. Floci answers
correctly in China.

TestFixtures gains region(), partition() (from the SDK's region metadata)
and arn()/globalArn() builders, and the three classes use them. The
rejected-bus cases move from @CsvSource, which only takes constants, to a
@MethodSource whose mismatched-region bus is another region of the fixture
partition. The 25 entries leave the allowlist (98 to 73). Part of BL-020.

* test(compat): keep the SES bus rejection cases running in a single-region partition

Greptile on #5017: the method source threw when the fixture partition has no
second region (aws-eusc and aws-iso-e list one), so the custom-bus and
mismatched-account cases, which need no second region, never ran there. The
other region is now optional: the two cases always run, and only the
mismatched-region case is left out of a single-region partition.
2026-10-03 14:12:29 -04:00
Hector Ventura c800cc375e test(compat): keep the China nightly allowlist free of an order-dependent entry (#4891)
The first Partition Compatibility run (36963820252) went red on one stale
entry: SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passed. It
only fails when OrganizationsTest#testFullLifecycle leaves its organization
behind, which made the caller the management account for every later test,
and that happened because the organization's own assertions, including the
arn:aws: one that fails in cn-north-1, ran before the try whose finally
deletes it.

The assertions now run inside the try, so the organization is deleted however
they end, and the stale entry is gone from the cn-north-1 allowlist. Part of
#4272.
2026-10-02 09:28:41 -04:00
Hector Ventura d72923ab33 fix(core): compare ARN partitions with the resource's region, not the literal aws (#4791)
* fix(core): compare ARN partitions with the resource's region, not the literal aws

Part of #4272 (P10b). Running the Java SDK suite against a Floci deployed in
cn-north-1 (#4790) found five checks comparing a parsed ARN with "aws" and a
seeded ARN fixed to the commercial partition:

- RdsService.hasRdsResourceIdentity required partition aws, so DB instances,
  clusters, DB and cluster snapshots and subnet groups created outside aws
  failed their own ownership check and were not found right after creation.
  The proxy target group check had the same comparison, and CopyDBSnapshot
  refused any source ARN outside aws; it now requires the target region's
  partition, since a snapshot copies within its partition.
- ElastiCache ListTagsForResource rejected every arn:aws-cn: ARN; it now
  expects the request region's partition and names it in the message.
- RAM ignored organization principals outside aws; any published partition is
  accepted, the organization id ties the principal to the caller's.
- The seeded IAM Identity Center instance was arn:aws:sso:::instance/... in
  every deployment, so China permission sets never found it. It now takes the
  partition of the deployment's home region, and AddRegion compares against
  the instance's own primary region instead of a fixed us-east-1.

* fix(sso): move a persisted bootstrap instance to its partition, and drop the fixed China allowlist entries

Greptile on #4791: a deployment persisted before the seeded instance took its
partition keeps it as arn:aws:sso:::instance/..., while its permission sets were
already minted in the instance's own partition, so the fix would not reach it.
ensureBootstrapInstance now rewrites a stored bootstrap instance whose ARN is
not in its primary region's partition.

pgermosen on #4791: with #4790 on main, the cn-north-1 allowlist entries this
fixes would turn stale and fail the nightly. Measured against this branch in
cn-north-1: CloudFormationRdsDynamicReferenceTest, the ten RdsControlPlaneTest
entries, RdsJdbcCompatTest#createDbInstanceAndConnectWithPassword and
SsoPortalTest now pass and are deleted. The four IAM-token connection tests
still fail because they sign their tokens for a pinned us-east-1, which a
cn-north-1 database rightly refuses; they move to the group of tests that pin
commercial values.

* fix(ram): answer the listing operations for the request's region only

Greptile on #4791: with organization principals accepted in every partition,
a commercial GetResourceShares from a member of the organization returned a
China share. The cause predates this PR: GetResourceShares, ListResources,
ListPrincipals and GetResourceShareInvitations walked every stored share, so
a share created in eu-west-1 was listed through us-east-1 too, while a
resource share is a regional resource. RamController now passes the request
region and the four operations keep only shares (and invitations to shares)
in it, which also keeps a share out of another partition.

* fix(ram): resolve a share or invitation to mutate in the request's region only

pgermosen on #4791: after the listings were scoped to the request's region,
findOwnedShare still walked every stored share, so a share invisible to
GetResourceShares in one region could still be deleted, updated, associated,
disassociated or retagged from there; AssociateResourceShare would add a
resource the same endpoint's ListResources does not report. Accept and
RejectResourceShareInvitation had the same gap.

The six share mutations and the two invitation responses now take the request
region from RamController and resolve only a share or invitation in it: one
from another region gets UnknownResourceException or
ResourceShareInvitationArnNotFoundException, like an ARN that does not exist.
2026-10-01 21:00:35 -04:00
Hector Ventura 8d056e9456 ci: limit contributors to 2 open pull requests (#4864)
Call the shared floci-io/.github pr-limit workflow on opened, reopened and
ready_for_review, and on closed and converted_to_draft to clear stale
labels. Runs for the same pull request queue rather than cancel, and manual runs use their own concurrency group. Contributors
keep at most 2 open, non-draft pull requests: the 3rd and 4th get the
over-pr-limit label and a reminder, and from 2026-10-08 the 5th and later
are closed automatically. Bots and maintainers are exempt.

This replaces the advisory bot that labelled authors with more than 5 open
pull requests: the limit is now 2, drafts no longer count, and the logic and
wording live in one shared workflow.

CONTRIBUTING.md and the pull request template describe the policy.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-01 17:44:05 -05:00
Hector Ventura ea06896984 test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures (#4790)
* test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures

Part of #4272 (P11). The partition work is covered by unit and integration
tests over all eight partitions, but nothing ran a real SDK whose own
partition logic (arn:aws-cn: ARNs, China signing scopes, the LocationConstraint
S3 CreateBucket sends) has to round-trip.

The Partition Compatibility workflow runs after each Nightly against the image
it published, or on dispatch with an image and region: Floci starts with
FLOCI_DEFAULT_REGION=cn-north-1 and sdk-test-java runs with AWS_REGION set,
which TestFixtures now reads (default us-east-1, so the per-PR legs are
unchanged). It runs once a night rather than per PR, to keep the shared runner
pools free.

compat-allowlist-check.py compares the JUnit results with
compat-partition-allowlist-<region>.txt and fails on a failure the list does
not name, on an entry that no longer fails, or on missing results, so the list
only shrinks. The cn-north-1 list holds the 112 failures measured locally on
main plus #4787: 96 tests that pin commercial ARNs, regions or zones, 13 that
exercise commercial-only behaviour, and 3 still to explain.

* test(compat): pin the nightly China run to its image's commit and catch an aborted suite

Greptile on #4790: the workflow checked out the Nightly run's head_sha but
pulled the mutable floci/floci:nightly tag, so the image and the tests could
come from different commits; it now pulls the image first and checks out the
commit in its org.opencontainers.image.revision label. And Maven exits
non-zero for allowlisted failures too, so a suite that stopped partway could
pass; the checker now takes --test-sources and requires a report for every
test class in that tree.

The cn-north-1 allowlist groups its entries by the verified cause: the RDS and
SSO portal entries are Floci bugs (an RdsService ownership check against the
literal partition "aws", and an arn:aws: seeded Identity Center instance),
and SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passes alone
and fails only after OrganizationsTest leaves an organization behind.
2026-10-01 00:33:54 -04:00
TATSUNO “Taz” Yasuhiro 76adb9a97e chore(style): Enforce NoVar rule on new files, existing bad files later (#4362)
* chore: ban var with Checkstyle in CI

Checkstyle runs tools/checkstyle/checkstyle.xml over src and compatibility-tests/sdk-test-java in its own workflow. It stays out of the Maven lifecycle because a full run takes about 30 seconds.

Code that already uses var is listed in tools/checkstyle/suppressions.xml, one entry per service and one per compatibility-tests file, so each can be cleaned and removed in its own PR.

* docs: point AGENTS.md and CONTRIBUTING.md at Checkstyle

* chore: load Checkstyle suppressions from checkstyle.xml

IDE plugins such as CheckStyle-IDEA set config_loc to the config directory and now apply the same suppressions as CI. Maven sets config_loc through propertyExpansion.

* chore: exclude files, not directories, from the var check

New files in services that still use var are now checked too.

* chore: exclude the renamed NativeDynamoDbJsonHandler files from the var check
2026-09-30 21:53:14 -05:00
Abhigya d73e33fe4b fix(ecs): pull task images at launch so a moved tag reaches the next task (#4583)
* fix(ecs): pull task images at launch so a moved tag reaches the next task

Floci resolved an image reference to an image id the first time it saw it and
reused that id for the life of the process, so a rebuilt :latest pushed to the
registry never reached a new task, even through a new task definition revision
and a forced deployment, and nothing reported the mismatch.

ECS now pulls every container image when a task starts, before creating any of
its containers, following the agent's ECS_IMAGE_PULL_BEHAVIOR (configurable as
floci.services.ecs.image-pull-behavior, default "default": pull, and fall back
to the cached image when the pull fails). The cached image is whatever the
local tag names at launch rather than a remembered id. Each container reports
the manifest digest it runs as containers[].imageDigest.

* fix(ecs): create task containers from the image id their pull resolved to

An overlapping RunTask could pull the same moved tag between this task's pull
and its container creation, so the container was created from whatever the
shared tag cache named by then while reporting the digest this task pulled.
resolveForLaunch now returns the resolved image id with its digest, and ECS
builds each container from that id, so the image a task runs and the digest it
reports always come from the same pull.

The pull also now uses the reference the container is created from, including
floci.docker.image-registry-base, instead of the unprefixed name.

* fix(ecs): launch image ids without a pull and report the digest the pull resolved

A bare sha256 image id under always, or on the first once launch, went to the
registry as if it were a repository reference and failed the task although the
image was local. resolveForLaunch now runs an image id as it is, like
ensureImageExists.

The reported digest took the first RepoDigests entry for the repository, which
is not necessarily the manifest the tag resolved to when the image holds more
than one (an index and a platform manifest). It now comes from the Digest line
the daemon streams for the pull, kept while the tag still names that image; a
cached image falls back to its repo digest only when there is exactly one.

The shared test config uses prefer-cached so the other ECS Docker suites stop
adding a registry round trip per launch; the image pull integration test pins
default in its own profile. ContainerBuilder imports are back in order.

* fix(ecs): report a pull's digest only for the launch that pulled

The digest a pull reported was kept per reference and reused while the tag
still named the same image id, but on the classic image store an id is the
config digest and several manifests can share it, so an outside pull could move
the tag to another manifest and leave the reused digest stale. Only the launch
that pulled now uses the streamed digest. A cached launch uses the image's
repo digest for the repository when there is one, or the one equal to the id
(the containerd store names an image by its manifest), and otherwise none.

Also sorts the ContainerLifecycleManager imports.

* fix(ecs): pull the image-pull test's busybox and registry from Docker Hub

EcsImagePullDockerIntegrationTest pulled both images through the
public.ecr.aws/docker/library mirror, whose anonymous quota is shared per
runner IP; shard 3 failed on toomanyrequests: Data limit exceeded. Take
them from TestImages like the other Docker-backed tests, pinning the
registry image there, and prefetch both for the shard that runs the class.

* test(ecs): name the registry readiness probe's tolerated exception expected
2026-09-30 22:14:50 -04:00
Hector Ventura 8ff1eae121 ci: run the per-PR hygiene checks in one job and skip drafts without a gate job (#4703)
* ci: run the per-PR hygiene checks in one job

The signed commits, AI attribution, Conventional Commits, em-dash and PR
template checks were five workflows with one job each, so every push to a
pull request started five runners for about ten seconds of work apiece. At
busy times those jobs queued for up to twenty minutes behind the CI shards
and the compatibility suites under the account's concurrent-job limit.

They now run as steps of a single "PR hygiene" job. Each step keeps the old
check's name, script and annotations, and runs under !cancelled() so one
failure does not hide the others. The signature check also runs on
"edited" now: with one job, an edit-triggered run replaces the whole
result, and skipping signatures there would turn an unsigned PR green. A
per-PR concurrency group cancels superseded runs.

The path-filtered checks (docs tables, partition literals, changelog guard)
keep their own workflows.

* ci: skip draft PRs with a job condition instead of a gate job

CI and Compatibility Tests reached the draft rule through a reusable
workflow that started its own job on every run. That job did about three
seconds of work, but every other job in the run needed it, so under the
account's concurrent-job limit its queue wait sat at the head of the
critical path: on recent PR runs a median of about 35 seconds, and nine to
thirteen minutes at the tail, before a shard or native build could even be
queued.

The same condition now sits on the root jobs as a job-level if:, which
GitHub evaluates without a runner. Drafts, closed PRs and edited events
still skip the suites and pushes to main still run; the native suites
follow build-native. CI summary keeps always() so a failed shard still
reaches the partition check and report, and uses the same condition so it
does not run on a draft. pr-draft-gate.yml has no callers left and is
removed.
2026-09-30 09:26:42 -04:00