mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
7dc514b52f2c96bdd1ea32ae64a02703f85be2aa
20
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
30d8d3ff5c |
fix(core): route a Query action by its service's botocore model (#5879)
A Query request without a usable credential scope is routed by its Action and Version, and IAM enforcement authorizes it under the service that routing picks. The names each service routed were kept by hand in AwsQueryController and had drifted from what the services serve: 170 names Floci dispatches, across eight services, reached no service and fell through to SQS. They answered UnsupportedOperation in SQS's namespace and were authorized as SQS actions. Each Query service's API versions and operations now come from its botocore models: tools/aws/regen_query_services.py writes them, from the pinned botocore, to aws/query-services.json, and make aws-data-check fails when the file is stale. Every name a service defines reaches it, implemented here or not. Floci keeps the list of services and their order, Cognito's names, which no Query model holds, and ElastiCache's ValidateIamAuthToken, which no model defines. A name several services define goes to the first of them when the request names no Version. Ten such names get a pinned owner instead, the service that serves them here, where the order would pick an earlier one that does not. The routing parity test checks every dispatched action with and without a Version and no longer needs its list of known gaps. |
||
|
|
6aac097c82 |
chore(tools): generate the request shapes from one shared script (#5816)
regen_dynamodb_shapes.py and regen_sesv2_shapes.py carried the same build() and main(); the SES v2 one only added the filter that drops members bound to the URI, query string or headers, which leaves DynamoDB's model unchanged since it has none. request_shapes.py now holds load_model(), a build() that takes the generator's name, render() and main(), and each script names its model and output. Both vendored files regenerate unchanged. |
||
|
|
e24a2882bc |
fix(ses): check v2 send request bodies against the service model (#5765)
* fix(ses): check v2 send request bodies against the service model SendEmail, SendBulkEmail and SendCustomVerificationEmail read their members by hand, so a member of the wrong JSON type was coerced, read as empty, or rejected with a Floci-specific BadRequestException, depending on which member it was. AWS deserializes the whole body against the model first and answers the first member of the wrong type, in body order, with a SerializationException and its deserializer message. tools/aws/regen_sesv2_shapes.py vendors the body shapes of botocore's SES v2 model into src/main/resources/aws/sesv2-request-shapes.json, kept in sync by make aws-data-check like the DynamoDB shapes. SesV2RequestShapes checks a body against them, and the three send endpoints call it before reading any member. The type checks it makes redundant are removed from the send helpers. A null address list element still passes and fails as "Invalid email address null.", as on AWS. Only the string, blob, list, structure and map messages have been probed, so number, boolean and timestamp members are left to their controllers. * fix(ses): report a null v2 send address where SES does A null element of a v2 send address list was rejected for the whole request while the body was read. SES lets it through deserialization and reports it later: SendEmail answers "Invalid email address null." after its content and sender checks and before the tenant lookup, and SendBulkEmail reports it as the INVALID_PARAMETER status of the entry it belongs to, of every entry for a null Reply-To, or as "Destination cannot be empty" when no entry of the request has a non-null recipient. The address lists now keep the null, SendEmail checks for it ahead of the tenant gate, and the bulk entry check reports it per entry. Two ordered integration tests that shared an @Order value get their own. * chore(core): share the vendored request-shape model DynamoDbRequestShapes and SesV2RequestShapes each carried the same Shape and Model records and the same parse() and load(), and load() repeated VendoredResources.read. RequestShapeModel in core.common now holds that half and both checks use it; each keeps its own walk and its protocol's messages. |
||
|
|
77384dc3de |
feat(redshift-serverless): validate requests against the AWS model constraints (#5641)
* feat(redshift-serverless): validate requests against the AWS model constraints Generate the input constraints (required members, length, pattern, enum, number range, list size) from botocore's Redshift Serverless model with tools/aws/regen_redshift_serverless_shapes.py and vendor them under src/main/resources/aws, like the DynamoDB request shapes. A new RedshiftServerlessRequestShapes check runs before dispatch and answers a ValidationException. Pagination members are left to the services, which keep reporting InvalidPaginationException. Move the request parsing and error helpers that the JSON handler, the usage limit service and the service each carried a copy of into ServerlessSupport, so the resource families that follow share one implementation. * fix(redshift-serverless): address review findings on request validation - Match a model pattern against the whole value, so an unanchored pattern such as the account id no longer accepts a value that merely contains a match. - Count string lengths in Unicode code points, so a tag of 200 supplementary characters is not rejected for exceeding 256 UTF-16 units. - Validate only the actions the handler implements, so a modeled but unsupported action keeps answering UnknownOperationException. - Read every string member through ServerlessSupport.text and reject a tag key or value that is not a string, so a numeric nextToken or tag member is a ValidationException instead of being treated as absent or coerced. - Regenerate the vendored shapes from botocore 1.43.113, the version tools/aws/requirements.txt pins. - Cover the rejected-request case with a state check, and add the pattern, code point, page token and tag regressions. * refactor(redshift-serverless): use VendoredResources, ServerlessSupport.notFound and update docs |
||
|
|
3afb5b430e |
fix(partitions): source the China CloudFront suffix and GovCloud API Gateway zones (#5618)
* fix(partitions): source the China CloudFront suffix and GovCloud API Gateway zones Two values listed as open questions have a published source in the China and GovCloud user guides, so they become vendored facts in aws/region-facts.json instead of a commercial constant. A generated CloudFront distribution domain name ended in cloudfront.net in every partition. The China guide's CloudFront page names the default domain there as *.cloudfront.cn (https://docs.amazonaws.cn/en_us/aws/latest/userguide/cloudfront.html), and the commercial suffix is the one in the example name of the botocore CloudFront model (Distribution$DomainName, DistributionSummary$DomainName). floci.services.cloudfront.domain-suffix loses its cloudfront.net default and becomes optional: unset, the suffix follows the request's partition, with the commercial one where a partition has no CloudFront; set, it applies in every partition as before. CloudFront distributions and streaming distributions, Cognito and AppSync custom domains and edge-optimized API Gateway domains all resolve it through CloudFrontEdgeDomain.domainSuffix. A regional API Gateway custom domain reported one placeholder hosted zone id in every region. The GovCloud guide's API Gateway page states the regional endpoint zone for us-gov-west-1 (Z1K6XKP9SAGWDV) and us-gov-east-1 (Z3SE9ATJYCRCZJ) (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-abp.html); those two regions now report it, and the generator resolves each region through its description in partitions.json. No source gives the zone for any other region, which keeps the placeholder and stays an open question. The generator reads both sentences from either rendering of a guide page: the page text, or the Markdown AWS serves at the same URL with .md, which escapes the asterisk in the CloudFront sentence. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(partitions): require each sourced fact and resolve edge domains in the request's partition The GovCloud API Gateway page parser accepted a page stating only one region's regional hosted zone, so an edited guide would have dropped the other zone from region-facts.json without failing. It now requires a zone for every aws-us-gov region. The region-facts self check validated cloudfrontDomainSuffix only when it was present. It now requires the suffix for aws and aws-cn, and the regional hosted zone for both GovCloud regions, as it already requires consoleHost; a missing commercial suffix would otherwise have reached the orElseThrow in CloudFrontEdgeDomain.domainSuffix at runtime. CloudFrontEdgeDomain.create resolved its partition from the region alone, falling back to the commercial one, so an AppSync or API Gateway custom domain in a region no partition publishes (allowed under allow-unknown-regions) took the commercial suffix and hosted zone in a China deployment. It now takes the partition the caller's RegionResolver resolves, which falls back to the deployment's partition, as the CloudFront and Cognito paths already do. Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
d84a764cf9 |
fix(deps): bump botocore to 1.43.113 and regenerate the vendored AWS data (#5613)
Regenerate partitions.json and dynamodb-request-shapes.json from botocore 1.43.113. The partition data gains the training-session-runtime.sagemaker endpoint prefix under the sagemaker signing name and lists kafkaconnect in aws-eusc. Neither changes a service Floci serves: the new SageMaker prefix is not published in any partition yet and api.sagemaker already is in all of them, and kafkaconnect is not implemented. The DynamoDB request shapes are unchanged apart from the provenance line. Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
63e0302c12 |
fix(apigateway): validate and normalize imported integration types (#5543)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
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. |
||
|
|
8bd88bfb40 |
fix(codepipeline): link approval notifications to the partition's console host (#5595)
* fix(codepipeline): link approval notifications to the partition's console host The approval-needed notification built consoleLink and approvalReviewLink on the commercial console host for every pipeline, so a pipeline in China or GovCloud sent its approver to a console where the pipeline does not exist. The console host becomes a vendored per-partition fact, consoleHost in aws/region-facts.json, read by the generator from the user-guide snapshots under local/aws/aws-docs/partition-guides: cn/console.md for aws-cn (console.amazonaws.cn), gov/configure-account.md for aws-us-gov (console.amazonaws-us-gov.com) and gov/govcloud-organizations.md for the commercial host. The China guide also spells the host console.www.amazonaws.cn once, in cn/managing-aws.md; the console page's own statement is the one used. A guide page that lost its sentence, or states two hosts with it, fails the generation instead of leaving a stale value. CodePipelineEventPublisher resolves the host from the execution's region, since it runs on a worker thread without a request context. No source states a console host for the ISO or EUSC partitions, which keep the commercial one and are listed as an open question. The path after the host stays the commercial console's: no source gives the per-service path per partition. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(codepipeline): parse the China console host from the Markdown guide page, require sourced hosts AWS serves each user-guide page as Markdown at the same URL with .md in place of .html, and that rendering writes the China console host as a link, "[https://console.amazonaws.cn](https://console.amazonaws.cn).". The aws-cn pattern only took the page-text form, so a snapshot saved from the Markdown page failed the generator, and with it the rest of "make aws-data-sync". The pattern now takes both forms. The docstring names the three guide page URLs and the path each is saved under. self_check now requires consoleHost for the three partitions that have a source (aws, aws-cn, aws-us-gov). The shape-only check used when the sources are not checked out accepted a file without them, which would link approval notifications to the commercial console. Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
94a801e05f |
fix(deps): bump botocore to 1.43.111 and regenerate the vendored AWS data (#5498)
Regenerate partitions.json and dynamodb-request-shapes.json from the installed botocore 1.43.111 package. DynamoDB's request type check now covers ExportTableToPointInTime FilterSpecification. The partition data also lists eventsv2 (aws), runtime.sagemaker (aws-iso-e), dax (aws-us-gov) and the cloudwatch-omni / eventsv2 signing-name mappings. None of these change a service Floci serves: dax and eventsv2 are not implemented, and the sagemaker, events and cloudwatch signing names resolve as before. local/aws was not checked out, so the provenance label names the installed package and regionFlags are carried over from the previous file; the data is otherwise identical to a local/aws generation. |
||
|
|
1b7c79fd9e |
fix(signin): accept the cross-device redirect on each partition's sign-in host (#5557)
The cross-device redirect_uri was matched against the commercial <region>.signin.aws.amazon.com only, so a login that resolved another partition's Sign-In host was refused with invalid_request. regen_partitions.py now reads botocore's signin endpoint ruleset and vendors one signinHost per partition into aws/partitions.json. The redirect is accepted on the Sign-In host of a region in the deployment's partition, and another partition's host is refused. The device authorization client ids keep their literals: the Sign-In model spells them the same way in every partition. Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
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.
|
||
|
|
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. |
||
|
|
8a1d1ddcd3 |
fix(partition): read strict-mode service availability from endpoint rulesets too (#5231)
* fix(partition): read strict-mode service availability from endpoint rulesets too Strict partition mode refused services AWS serves. The per-partition service list came from botocore's endpoints.json alone, which leaves out IAM, Route 53, Budgets and Cost Explorer in aws-eusc and IAM and Cost Explorer in aws-iso-e, although each service's endpoint ruleset has an explicit branch for the partition (iam.eusc-de-east-1.amazonaws.eu). The generator now adds those partitions, for services endpoints.json lists somewhere, and records them under servicesFromRulesets. The execute-api signing name was mapped to Connect Participant only, so IAM-authorized API Gateway invokes were refused in China, EUSC and the ISO partitions. A signing name is now left out of the alias map when a service whose own endpoint prefix is that name is listed nowhere, so strict mode no longer judges execute-api. The docs and config comments no longer say IAM is absent from aws-eusc. * test(partition): assert API Gateway answers the strict-mode execute-api probe The execute-api strict-mode test accepted any response but a 200 that lacked the strict-mode error, so a 500 or an unrelated rejection would also pass. It now requires API Gateway's own answer for a missing API: a 404 NotFoundException with "Invalid API id specified". |
||
|
|
0bc85f3ef8 |
fix(sts): mint global STS and IAM ARNs per partition and add a strict partition mode (#4743)
* fix(sts): mint global STS and IAM ARNs per partition and add a strict partition mode GetCallerIdentity's root fallback, the AssumeRole family's session ARNs, the OIDC provider ARN and GetFederationToken built their ARNs with an empty region, which falls back to the commercial partition, so they carried arn:aws: whatever partition the request signed. They now go through RegionResolver.buildGlobalArn. GetAccountSummary reports GlobalEndpointTokenVersion only where the partition publishes a global STS host, which is aws alone. floci.partitions.strict (FLOCI_PARTITIONS_STRICT, default false) refuses a request signed for a service AWS publishes in another partition but not in the request's one (CloudFront in GovCloud, IAM in aws-eusc) with the unknown-service guard's 404, mirroring the host that never resolves on AWS. endpoints.json omits the services that ship only an endpoint ruleset, so a service the data lists nowhere is served everywhere. Credential scopes carry signing names, and 46 of them differ from the endpoints.json keys they cover (73 keys, such as ecr for api.ecr); regen_partitions.py vendors that map as signingNames and AwsPartition.offersSigningName joins it. Part of #4272 * fix(core): read the gzipped botocore models the pip package ships when collecting signing names The botocore wheel ships each service model as service-2.json.gz, while the checkout under local/aws/botocore ships it plain. collect_signing_names looked only for the plain file, so in CI, which resolves botocore to the installed package, it found no models, generated an empty signingNames and failed aws-data-check against the committed map. It now reads either form, as regen_dynamodb_shapes.py already does. * fix(sts): keep an assumed-role session in its role's partition, and answer strict-mode Query requests in XML GetCallerIdentity rebuilt an assumed-role session's ARN with an empty region, which falls back to the commercial partition, so a session AssumeRole issued as arn:aws-cn:sts:: came back as arn:aws:sts::, and a chained AssumeRole was then refused by a China trust policy as a caller from another partition. The session ARN now takes the partition its role ARN names. Strict partition mode refused a form-encoded Query request (IAM in aws-eusc) with a JSON body; it now returns the Query XML error the unknown-region guard beside it already returns for such requests. * fix(iam): mint IAM resource ARNs in the request's partition and keep them there CreateUser, CreateGroup, CreateRole, CreatePolicy, CreateInstanceProfile and CreateOpenIDConnectProvider minted arn:aws: whatever partition the request signed, while STS now followed the request. Under China that denied AssumeRoleWithWebIdentity (the trust policy names the arn:aws: provider ARN CreateOpenIDConnectProvider returned, matched against arn:aws-cn:), and AssumeRole reported the request's partition while GetCallerIdentity reported the role's. An IAM resource is now created in the request's partition and keeps it: UpdateUser and UpdateGroup re-mint in the stored ARN's partition. Anything derived from a stored role follows the role: all three AssumeRole handlers, resolveCallerArn and the web identity OIDC provider ARN take the role ARN's partition through AwsArnUtils.partitionOrDefault. The credential report's root row takes the request's partition. * fix(sts): mint a session from the stored role, and keep one credential report per partition AssumeRole, AssumeRoleWithWebIdentity and AssumeRoleWithSAML find the role by account and name, but minted the session ARN from the RoleArn the request named. A China role assumed with an arn:aws: RoleArn therefore came back as an arn:aws:sts:: session, while AssumeRole registered the session under the stored role's ARN, so GetCallerIdentity reported aws-cn. All three handlers now mint the session from the stored role's ARN when the role exists and register it under the same ARN. The credential report was cached once per account, so a report generated for one partition was handed to a caller in another for four hours, with the wrong partition's root row. It is now kept per partition. |
||
|
|
1465251e0c |
fix(dynamodb): reject a request member of the wrong JSON type (#4636)
* chore(dynamodb): vendor the input shapes of botocore's DynamoDB model tools/aws/regen_dynamodb_shapes.py keeps each operation's input shape and the type of every shape it reaches, from the pinned botocore release. make aws-data-sync regenerates it and make aws-data-check keeps it in sync. * fix(dynamodb): reject a request member of the wrong JSON type DynamoDB answers a member of the wrong JSON type with a SerializationException before it runs the operation, such as "NUMBER_VALUE cannot be converted to String" for a number BillingMode or IndexName. The message names the JSON token and the Java type, or says "Unexpected field type", "Unexpected value type in payload", "Start of structure or map found where not expected" or "UnknownError" by where the value sits. The first bad member in body order is reported. A JSON null counts as absent and an unknown member is ignored. Floci now checks every DynamoDB JSON request against the vendored input shapes. A number in an ExclusiveStartKey S value is one of these errors on AWS, so that test now expects the SerializationException. * fix(dynamodb): keep provenance out of the shapes freshness check The shapes file now carries its provenance in a _source block, like the other vendored AWS data, and --check compares it without that block. A run against --botocore-data or a local checkout no longer reports the file as stale when only the botocore label differs. |
||
|
|
833a43bfa7 |
feat(core): vendor the per-region hosted zones, SAML URLs and VPC endpoint prefixes (#4545)
* feat(core): vendor the per-region hosted zones, SAML URLs and VPC endpoint prefixes tools/aws/regen_region_facts.py transcribes the per-region and per-partition constants AWS publishes only as prose tables into src/main/resources/aws/region-facts.json: the Terraform provider's load balancer and S3 website hosted-zone maps, the CloudFront hosted zone per partition (cross-checked against the CDK), and the CDK's SAML sign-on URLs and VPC endpoint service-name exceptions. AwsRegionFacts serves them, as Optionals where a partition publishes nothing (the ISO and EUSC partitions have no hosted zones). make aws-data-check regenerates and compares where the local reference checkouts exist, and verifies the file's shape where they do not. Behaviour this changes: network load balancers report their own hosted zone per region instead of the Application one, Classic and Application load balancers report their region's zone, API Gateway EDGE domains carry the CloudFront zone of their partition, SAML assertions are checked against the sign-on URL of the provider's partition, and the AWS-managed S3 and DynamoDB prefix lists carry the partition's service-name prefix. Also carries the follow-ups from the #4494 review: bucketRegionForCreate cites the S3 model for the us-east-1 rules, docs/services/s3.md gains a Bucket Regions section, and the Marketplace files are gated per line with stated reasons instead of being allowlisted by path, so a new region literal there is caught. Part of #4272 * fix(core): harden the region facts against restarts, partitions without CloudFront, and CI without sources The source-free data check rejected real twelve-character hosted zone ids such as ap-southeast-1's NLB zone ZKVM4W9LS7TM, which failed the vendored-data job. It now accepts Route 53's id length range and checks substance: every partition has an entry whose VPC endpoint prefix is its reversed DNS suffix, every region is published in partitions.json, SAML URLs are https sign-on URLs, and unknown fields are refused. Load balancers restored from storage take the hosted zone of their region and type again, so balancers stored before the per-region lookup stop reporting the old fixed zone. An EDGE API Gateway custom domain is refused where the partition has no CloudFront, since it would have no distribution zone to alias to. A customer prefix list may not take the prefix of the AWS-managed lists its region carries, cn.com.amazonaws. in China. The partitions doc now says which ISO hosted zones exist. * fix(core): hold only a changed endpoint type to the partition, and name malformed region facts UpdateDomainName checked the partition for EDGE on every patch, so an EDGE custom domain stored in GovCloud before the rule could no longer take a certificate or security-policy update; only a patch that changes the endpoint type is held to the partition now. The source-free region-facts check reports a partition or region entry that is not an object by name instead of failing with a traceback, and its test asserts on computed results rather than on calls that write the fixture. * fix(core): keep gateway endpoint names on com.amazonaws, allow EDGE only in the commercial partition, and keep SAML working where no sign-on URL is published The AWS-managed prefix lists belong to the S3 and DynamoDB gateway endpoints, which the CDK names com.amazonaws.<region>.<service> in every partition (GatewayVpcEndpointAwsService); the reversed-suffix table applies to interface endpoints only. The managed lists are back to that name and the cn.com.amazonaws. reservation is gone; DescribeVpcEndpointServices now names the interface services through the table instead, keeping the S3 gateway entry on com.amazonaws. Edge-optimized API Gateway exists only in the commercial partition: China has CloudFront but no edge-optimized APIs or domains (its API Gateway documentation says so), so EDGE custom domains are refused everywhere else. Where the CDK publishes no SAML sign-on URL (aws-iso-e, aws-iso-f, aws-eusc) assertions keep being checked against the commercial URL, as every partition was before, instead of all being refused. applyEndpointType has its javadoc back. |
||
|
|
26146a3f94 |
feat(iam): expand wildcard service grants against a vendored namespace catalog (#4544)
GetServiceLastAccessedDetails reports the services an entity can reach, but a grant that names no namespace could not be expanded: "Action": "*", a globbed prefix such as s3*, and any NotAction all denote a set no policy document spells out. A user holding only AdministratorAccess came back with an empty report. Closes #4487. The list of namespaces is vendored in aws/iam-service-namespaces.json and generated by tools/aws/regen_service_namespaces.py from AWS's Service Reference Information index, whose per-service "service" field is the IAM namespace itself. botocore is deliberately not the source, even though every other vendored file here comes from it: a namespace is not any botocore field, since CloudWatch's endpointPrefix is monitoring and its serviceId is CloudWatch against an IAM namespace of cloudwatch. A rule over botocore metadata is wrong for some service, and a wrong namespace is worse than a missing one because it names something IAM does not have. That index is a live endpoint rather than a pinned dependency, so unlike regen_partitions.py a fresh generation is not byte-identical and byte equality is the wrong gate. What must be guaranteed is that nothing in the file is invented, which is checked directly: make iam-namespaces-check validates the file's shape offline, and make iam-namespaces-verify checks online that every namespace in it still exists upstream, failing on one that does not. Services AWS has added since the last sync are reported without failing, since the file being behind makes the report incomplete rather than wrong. A namespace a policy names outright is kept whether or not the catalog knows it, so a catalog trailing an AWS launch still reports an explicitly named service; only wildcard expansion depends on it being current. A globbed prefix now expands to the namespaces it matches rather than being treated as every service and then dropped. |
||
|
|
2cccc73499 |
fix(core): build and recognise AWS hostnames in every partition (#4451)
* fix(core): build and recognise AWS hostnames in every partition AwsEndpoints builds the AWS-shaped hosts Floci returns from the region's partition DNS suffix: execute-api, the S3 bucket, regional, dual-stack and website hosts, Cognito and EKS OIDC issuers, APS, Bedrock AgentCore, AppSync and EC2 public DNS names. partitions.json records the regions whose S3 endpoint publishes a dual-stack variant, so DualStackDomainName is only returned there. The S3 virtual-host fallback, the execute-api host filter, the ECR image URI and the CloudFront S3-origin parsers recognise every published suffix, longest first. The CloudFront domain suffix Cognito and API Gateway mint comes from floci.services.cloudfront.domain-suffix. Two commercial bugs go with it: WebsiteURL uses the dash form (s3-website-<region>) in the nine regions that keep it and ends with a slash, and EMR's public DNS name is compute-1 only in us-east-1. Also carries the follow-ups from the #4444 review: accessDeniedResponse gets its Javadoc back in IamEnforcementFilter, IamAuthValidator's imports are in order, and the IAM test helper's pair loop cannot read past the array. Part of #4272 * fix(core): keep CloudTrail S3 hosts and CFN dual-stack attributes consistent with their region CloudTrail built an S3 data event's Host, TLS host header and resource ARNs from the request scope, but the log writer emits its own deliveries from the flush thread, where the request region falls back to the deployment default: a cn-north-1 trail's self-delivery record said awsRegion cn-north-1 with a .amazonaws.com host and an arn:aws: ARN. buildS3Record now takes the event region emitS3DataEvent already resolves and derives all of them from it. AWS::S3::Bucket drops a prior DualStackDomainName when an update lands in a region without an S3 dual-stack endpoint, since provision receives the previous attributes on update. * test(resourceexplorer2): check a regionless ARN's partition against the resource's region The cn-north-1 CloudTrail self-delivery test left its bucket behind in the shared emulator, and ResourceExplorer2's partition assertion then failed on arn:aws-cn:s3:::loop-logs-..., a correct ARN: S3 ARNs carry no region, so the expected partition fell back to aws. The assertion now takes a regionless ARN's partition from the Region the listing reports, and skips it when that is not a published region (global resources). The CloudTrail test deletes its trail, objects and bucket after each case through PartitionCleanup. |
||
|
|
0dd080a46f |
feat(core): partition foundation from botocore's published partition data (#4317)
P1 of the multi-partition initiative (#4272). tools/aws/regen_partitions.py vendors botocore's partitions.json and endpoints.json (8 partitions, 46 regions, the partition-wide endpoints with their signing regions) plus the CDK's opt-in and S3 website rules into src/main/resources/aws/partitions.json, checked by make aws-data-check. AwsPartition and AwsPartitions replace the hand-typed rules behind AwsRegions; RequestContext carries the request's partition from its SigV4 signing region; RegionResolver mints global ARNs in that partition and buildArn routes a blank region there; floci.partitions.id pins the deployment's partition behind a startup validator that refuses a contradiction with the default region. Behaviour a reviewer will see, all AWS-faithful: DescribeRegions follows the request's partition and the opt-in model (17 commercial regions by default, all 34 with AllRegions=true, RegionName.N filters, endpoints on the partition's DNS suffix); TLS SANs cover every published region; the EKS registry mirrors follow the deployment partition's regions. The partition-literal baseline drops by two. Part of #4272 |