Commit Graph
180 Commits
Author SHA1 Message Date
Andre Kurait a5b3fab110 fix(ci): derive Neptune prefetch images from configuration (#7834)
* fix(ci): derive Neptune prefetch images from configuration

Read the Neptune pin for Java compatibility and shared shard prefetch from application.yml. Preserve best-effort pulls, shard selection and Node retry behavior.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ci): share configured Neptune image lookup

Reuse one keyed lookup for Node, Java and shard prefetch. Read the Neo4j pin from configuration and correct the pre-pull overlap comment.

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

* fix(ci): share service image read and prefetch

Use one service/key config reader across Neptune and CodeArtifact. Share configured-image pull/skip logic, preserve Node/Java failure policies and remove the unused test file.

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

* chore(ci): remove superseded Neptune image reader

Remove the old helper left by the preceding rename publication. All consumers use the qualified shared service/key reader.

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

---------

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-09 21:49:27 -04:00
Andre Kurait 99be149382 chore: add regression coverage for CI sharding (#7245)
Cover the two balancing rules with deterministic partition CLI regressions.

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-09 21:40:22 -04:00
outofplace a65def00a4 feat(helm): add a Helm chart for running Floci in Kubernetes (#7749) 2026-11-09 09:06:23 -04:00
Andre Kurait a9c606df1d ci: prepare Neptune image before Node compatibility tests (#7629)
Prepare the configured Gremlin image before the timed Node SDK suite on cold native runners. Preserve test assertions and deadlines.

Read the effective Neptune image pin after sparse checkout and retry registry pulls up to three times before Node compatibility execution. Preserve the existing test deadline and report exhausted pulls explicitly.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-09 02:28:39 -04:00
luiseterc c3058a8de4 fix(iam): generate resource and request tag condition context (#7589) 2026-11-06 09:02:14 -04:00
Aymen JAMAAOUI 5bcb83b932 fix(iam): check Redshift requests on the resources they name (#7287)
Under IAM enforcement, Redshift requests were checked on `*`, so a
grant scoped to a cluster, a snapshot or a database user was refused,
and a deny scoped to one never applied.

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

Refs #5907

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

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

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

Refs #5907

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

chore(redshift): read a restore's snapshot ARN once
2026-11-05 11:57:59 -04:00
Jimmy Liu Jia cbb2db82d1 ci: allow slow test shards more time to finish (#7601)
* ci: allow slow test shards more time to finish

* ci: clarify shard and fork timeout boundaries

* ci: align shard fork and job timeouts
2026-11-05 08:13:20 -06:00
syedali032-creator 68271ef6b8 fix(stepfunctions): return the HTTP task result on the native image (#7543) 2026-11-04 17:17:54 -04:00
Hector Ventura 01f64e8a5c fix(docker): let the compat image reach the Docker socket on native Linux (#7378)
USER 1001 made the image start unprivileged, so the entrypoint skipped the branch that adds the socket's group and honours FLOCI_RUN_AS_ROOT. With a socket owned by a non-root group and mode 660, Docker-backed services could not launch containers, and FLOCI_RUN_AS_ROOT=true had no effect.

The image now starts as root like the standard one, and the entrypoint drops to uid 1001. HOME is set to /app because that drop keeps the environment: hooks would otherwise run with HOME=/root, which uid 1001 cannot write to, and pip install would fail.

docker exec now defaults to root on this image, as it does on the standard one.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-03 21:23:35 -04:00
Priamo Germosen b63e4a5bb9 test(emr): run steps and job runs through the Docker runner (#7349)
No EMR test ran a step or a job run through Floci's Docker runner: the
runner's wrappers and settings were unit tested and run by hand in the
images. EmrDockerRunnerDockerIntegrationTest, a Docker-gated
@QuarkusTest on ContainerDataPlaneProfile (which now sets both runner
modes to docker), runs them for real in the emr-7.5.0 image, reaching
Floci's S3 from the container:

- a hadoop-streaming word count step, its mapper and reducer from S3,
  writing its counts to S3;
- the same word count as a custom JAR at EMR's streaming jar path;
- s3-dist-cp from S3 into the cluster's HDFS and back;
- a cluster's spark-env export, read by a Spark step's driver;
- an EMR Serverless run on the user guide's virtual environment recipe,
  spark.archives with #environment and the driver's and executors'
  Python in it, from an archive that needs no package index.

EmrRequests.awaitStep and EmrServerlessRequests' createSparkApplication,
startJobRun and awaitJobRun are shared helpers, each wait checking that
its call answered 200 before reading the state, and
RetryingTarCopier.putEntry, pulled out of singleFileTar, writes the
archive's entries. The CI prefetch queues the 3.5 GB image for the
shard that runs the class, last, behind the Lambda runtimes, and the
prefetch results step no longer warns about an EMR Serverless image on
ECR Public, the only place AWS publishes them.
2026-11-02 17:31:59 -06:00
Matheus André 33052fa101 ci: run required checks on merge queue entries (#7064)
Add a merge_group trigger to ci, checkstyle, docs-actions and
partition-literals so a merge queue can gate main on them.

Refs #5085
2026-11-02 10:27:34 -04:00
Priamo Germosen 2d17978bf7 ci: run the test suite in five shards (#7303)
One shard was cut by the 25-minute job limit twice on 2026-11-02, at 25m15s
and 25m26s, and no test had failed in it either time: the reports it uploaded
before the cut carried 13459 tests with no failures and no errors. The suite
has grown into the budget rather than anything having broken, and a fifth
shard is what gives it room.

The partitioner needs no change. It takes the shard total as an argument and
balances by class count with each @TestProfile group kept whole, and the
completeness gate checks the shards it is handed against the commit's own
class list rather than a count. So this is the matrix, the total beside it,
and the comments that named four.

Measured over the 3223 test classes on main today, with each class's time
taken from the surefire reports of one four-shard run:

  four shards   13.8  13.3  17.1  13.8        minutes of tests
  five shards   12.6  12.1  12.4  10.7  10.2

The slowest shard loses 27 percent of its test time, 17.1 minutes down to
12.6, and the spread across shards narrows from 3.8 to 2.4. A shard pays
about 2m15s before its first test, 1m52s of that the compile, so the fifth
job costs that much runner time while the critical path drops by about four
and a half minutes.

What this does not do is balance by duration. The partitioner weighs classes
and profile groups rather than seconds, which is how one shard of four came
to carry 17.1 minutes against another's 13.3. Five shards leave more headroom
over that imbalance; they do not remove it.
2026-11-02 07:53:47 -06:00
Oleksandr Nikolaichuk 42bc856258 test(cloudformation): run the schema coverage ratchet in CI (#7282) 2026-11-02 07:37:06 -04:00
Hector Ventura 488a3197f1 chore(compat): close the SES races and report pre-pull and class timings (#7221)
Review of #7212 left three gaps in the parallel sdk-test-java setup.

The classes that create SES contact lists share a one-list-per-account limit
and three of them delete every list, and SesAccountAttributesTest turns
account sending off while other classes send. All of them now hold
ses-account, which costs about 8 s of serial time.

The pre-pull step discarded its output, so a failed pull only showed as a
slower run. Each pull now records its result and duration, and a step puts
them in the job summary with a warning when one failed.

Under JUnit parallel execution Surefire writes some test cases into another
class's XML file, so the timing report credited them to the wrong class. It
now sums per test case classname, which also splits sdk-test-python's single
"pytest" row into its classes.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-01 12:20:58 -04:00
Hector Ventura a93a07475e chore(compat): run sdk-test-java classes in parallel and pre-pull service images (#7212)
* chore(compat): run sdk-test-java classes in parallel and pre-pull service images

The sdk-test-java leg has grown to ~18 min because the suite runs strictly
serially and most of its time is spent waiting on containers Floci starts
and on minute-aligned metric ticks. Run test classes three at a time (the
methods of a class stay on one thread, in order), with @ResourceLock on the
classes that change Organizations or SES account-level state and @Isolated
on the ones that change wider shared state.

Also pull the heavy service images in the background before the tests
start, so they no longer serialize inside the test window, and drop the
stale "~10 min" note from the timing-report comment.

On the homelab runner (x86, 6 vCPU, JVM Floci with CI's flags) the suite
went from 21.5 to 10.7 min with the same 2933 tests and no new failures.

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

* chore(compat): lock the classes that share port 5432 and floci-duck

The first CI run in parallel failed three tests. RdsControlPlaneTest's DB
proxy could not bind port 5432 while DsqlCompatTest's endpoint held it, so
the two now share a lock. DataLakeTest's Athena query failed in floci-duck
while RedshiftRelationalSpectrumTest was using it; the classes that drive
floci-duck now share a lock too.

EcrTest deleted its last repository and the next CreateRepository stalled
for 30 s, past the SDK's timeout, while Floci kept calling the removed
registry's cached address. The retry then got RepositoryAlreadyExists. The
class now keeps one repository for its whole run, so the registry stays up.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-01 11:39:43 -04:00
dependabot[bot] e90f2590b5 chore(deps): bump the actions-minor-patch group across 1 directory with 3 updates (#7171)
Bumps the actions-minor-patch group with 3 updates in the / directory: [docker/login-action](https://github.com/docker/login-action), [actions/setup-python](https://github.com/actions/setup-python) and [actions/setup-java](https://github.com/actions/setup-java).


Updates `docker/login-action` from 4.6.0 to 4.7.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/dbcb813823bdd20940b903addbd779551569679f...81c6f93d4bc991e510b342a00b419b3bb4efc5c6)

Updates `actions/setup-python` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/5fda3b95a4ea91299a34e894583c3862153e4b97...6d4fd22b20465ccc0f7354476588e8df7c9ca0e0)

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

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: actions/setup-python
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: actions/setup-java
  dependency-version: 6.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-31 22:11:42 -05:00
Priamo Germosen e77823feed ci: push the published images with zstd -19 layers (#7159)
BuildKit compresses zstd at about level 11 at most, so the release and
nightly images now go through a composite action: the image is built
into an OCI layout, every layer is recompressed with the zstd CLI at
level 19, and a second build that only names the layout pushes it.
BuildKit keeps the recompressed layers and still attaches provenance
and the SBOM to the pushed digests.

On 2.4.0 this takes the native image from 94.6 to 70.1 MB on amd64 and
from 92.6 to 67.1 MB on arm64, and compat amd64 from 223.2 to 167.7 MB.
Pulling zstd layers needs Docker Engine 23.0 or later, so the
installation requirements move up from 20.10.

A new workflow tests the action on the pull requests that change it:
recompress.py against fixture layouts, then the whole action pushing a
two-platform image to a registry on the runner.
2026-10-31 21:38:13 -05:00
Robin Baeckman 07f2d62c17 feat(eks): vendor AWS's add-on version catalog for every supported Kubernetes version (#6735) 2026-10-30 07:21:01 -04:00
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
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
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
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 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
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
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