mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* fix(core): stop unknown-service REST requests falling through to S3 REST requests whose SigV4 credential scope names a service Floci does not implement matched no JAX-RS resource and fell through to S3's path-style wildcard routes, surfacing as misleading NoSuchBucket XML and triggering SDK retry storms. Reject them with UnknownOperationException instead. The guard fires only on positive identification: a parseable SigV4 scope naming a service absent from the catalog. Unsigned, presigned, Bearer/Basic and SigV4a requests are untouched. Also declares the EKS read-only sub-resource lists the emulator does not model (ListAccessEntries, ListAddons, ListIdentityProviderConfigs, ListPodIdentityAssociations) as explicit routes, so they outrank the S3 catch-all and answer with each operation's model-exact empty result key, or ResourceNotFoundException for a missing cluster. Closes #1754 * fix(iam): normalise signing-scope aliases before IAM enforcement S3 accepts requests signed under the s3express scope, but IAM action rules, resource ARNs and condition keys are all keyed by the canonical signing name. An alias therefore resolved to no action, which IamEnforcementFilter treats as ALLOW, so policy-protected S3 operations were reachable without a policy check. Resolve the scope through the catalog before enforcement runs. Only aliases are rewritten: a service whose external key is not itself one of its credential scopes (CloudWatch Logs signs as logs) is left unchanged, as is any scope the catalog does not know. Also documents why SigV4a stays outside the unknown-service guard — its credential omits the region segment, so SigV4CredentialScope does not match it — and pins that with a test, since widening the pattern would silently start rejecting SigV4a traffic. Refs #1754 * fix(iot): declare the iot-jobs-data signing scope so its routes stay reachable The IoT Jobs Data Plane (GetPendingJobExecutions, DescribeJobExecution, StartNextPendingJobExecution, UpdateJobExecution) signs under iot-jobs-data while IotController serves its /things/{thing}/jobs routes. The scope was not in the catalog, so the unknown-service guard rejected requests to routes Floci does implement. The Go, Java and Python SDK compat suites all caught it on GetPendingJobExecutions. Audited the other sibling signing names for the same failure mode: ssmmessages, eks-auth, ecr-public, cognito-identity and aoss have no Floci routes, so rejecting those stays correct. Refs #1754 * fix(iam): scope alias normalisation to an explicit table Deriving the canonical scope from the descriptor's external key was wrong: the external key is a routing key, not an IAM namespace. SES routes under email and Bedrock Runtime under bedrock-runtime while their IAM namespaces are ses: and bedrock:, so ses, sesv2 and bedrock were rewritten onto prefixes AWS never issues. Every action would then resolve to null and enforcement would be skipped for those services — the same bypass the s3express fix closed. Replace the derivation with an explicit alias table holding the one case that genuinely shares a namespace, s3express -> s3, and sweep every scope the catalog declares in the test so any future rewrite has to be deliberate. Refs #1754 * fix(core): make the unknown-service guard configurable and verify scope coverage The guard is only as good as the catalog's scope list, and the iot-jobs-data miss showed the list can be wrong. Two changes so that is recoverable and detectable rather than a hard 404 nobody can work around. Gate the rejection behind floci.protocols.reject-unknown-service-scope, matching the other two abort paths in AwsProtocolClaimFilter, which are both already gated. It defaults to true so #1754 stays fixed out of the box; turning it off restores the previous fall-through for anyone blocked by a scope Floci has not enumerated yet. Add CredentialScopeCoverageTest, which walks botocore's models and fails when Floci routes most of a service's operations without declaring the name that service signs with. Removing iot-jobs-data from the catalog makes it fail with 'iot-jobs-data=2/3 routes served'. Thresholds are conservative because small services share generic templates, so it is a tripwire rather than a proof, and it skips where the gitignored botocore checkout is absent (CI runners). Refs #1754 * fix(iam): resolve the iot-jobs-data signing scope to the iot namespace Admitting iot-jobs-data to the catalog let the IoT Jobs Data Plane reach its routes, but IAM enforcement still saw the raw scope. Its policy actions live under iot: (iot:DescribeJobExecution and peers in the Service Authorization Reference), so the scope belongs in the alias table next to s3express. No behaviour change today: IamActionRegistry carries no iot rules at all, so every IoT request resolves to no action and is allowed through regardless. This makes the mapping correct ahead of those rules existing, rather than leaving a scope that would silently escape them. Refs #1754