mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
537092001226e1cfc8243deac8e1c2daec883bbd
1365
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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> |
||
|
|
043daa5da6 |
feat(ses): validate v2 tracking configuration overrides (#5871)
* feat(ses): validate v2 tracking configuration overrides SendEmail and SendBulkEmail now check ConfigurationOverrides.Tracking's values the way SES v2 does: a value outside ENABLED/DISABLED is a validation error, both values reported together with the click one first, ahead of the tags and the configuration set. The shapes pre-check already refuses a wrong JSON type. Floci has no open or click tracking, so a valid override is accepted and has no effect. * test(ses): check a refused tracking override records no message * refactor(core): share the Smithy validation-error message The "N validation error(s) detected: a; b" message is Smithy's, not SES's, yet SES built it in eight places, plus five helpers that wrote the single-violation form by hand. They now all go through core.common.SmithyValidationErrors, which takes the protocol's error code. No message changes. |
||
|
|
faf344afd1 |
feat(codeartifact): add CopyPackageVersions for the generic format (#5854)
Copies one or more versions of a package between repositories in the same domain, matching AWS's documented all-or-nothing batch semantics: a version missing from the source fails NOT_FOUND, a version already identical at the destination is a silent no-op, a differing one fails ALREADY_EXISTS unless allowOverwrite is set, and any one failure reports every other requested version as SKIPPED rather than performing a partial copy. versionRevisions is checked against the source's actual revision (MISMATCHED_REVISION on a mismatch). Maven, npm, pypi, and nuget are not yet bridged, the same restriction PublishPackageVersion already has for those formats, and are documented as a known limitation. |
||
|
|
b0777a4020 |
fix(iam): check the actions an S3 operation needs besides its own (#5846)
Under IAM enforcement an S3 object operation was checked only as its own action. A PutObject, CopyObject or CreateMultipartUpload that set tags, an ACL, a retention period or a legal hold needed only s3:PutObject, GetObjectAttributes needed only the read, and a retention change or a delete asking to bypass governance retention needed no s3:BypassGovernanceRetention. No Object Lock condition key was offered. Each now also needs the actions the S3 user guide's permissions table and the API references require besides its own. An object creation needs the action of each setting it applies: s3:PutObjectTagging, s3:PutObjectAcl, s3:PutObjectRetention or s3:PutObjectLegalHold. A copy under the default COPY tagging directive keeps a tagged source's tags, so it needs s3:PutObjectTagging too, checked where the source is read against the request's credential, a presigned URL's included, and it offers no request tag keys from the x-amz-tagging header it ignores. GetObjectAttributes needs s3:GetObjectAttributes, or s3:GetObjectVersionAttributes for a version. A PutObjectRetention or DeleteObject that sends x-amz-bypass-governance-retention needs s3:BypassGovernanceRetention; an annotation delete does not, as the user guide says the permission does not apply to annotation operations. s3:PutObject, s3:PutObjectRetention and s3:PutObjectLegalHold are offered the Object Lock keys from the request's headers or body, and an object creation offers its tag and Object Lock keys to each extra action. A denial names the missing permission, and CloudTrail records the operation that was refused, PutObjectRetention and GetObjectAttributes included. Generated presigned URLs refuse all four creation settings, as they refused tags. Refs #5716 |
||
|
|
4f4db89d8f |
fix(apigateway): refuse a long-term access key sent with a session token (#5875)
* fix(apigateway): refuse a long-term access key sent with a session token AWS answers 403 "The security token included in the request is invalid" when a long-term key comes with X-Amz-Security-Token, signed or not. The same message without the period answers a temporary key with a wrong token. The session token check moves to core.common.auth, and Lambda Web IamAuth uses it too. Closes #5858 * fix(apigateway): read the session token where the signature is and refuse an empty one AWS ignores a token in the query of a header-signed request and a token header on a presigned one. It refuses an empty token with any key. |
||
|
|
de4f91f990 |
fix(ses): check v2 contact request bodies against the service model (#5867)
* fix(ses): check v2 contact request bodies against the service model CreateContactList, UpdateContactList, CreateContact, UpdateContact and ListContacts read their members by hand. A Topics or TopicPreferences value that was not an array was a Floci-specific BadRequestException, and a topic or preference member of the wrong JSON type was read as its text, so it reached the enum and name validation instead of failing deserialization as on AWS. These operations now check their body against the SES v2 shapes right after the JSON object check, like the send operations. The first member of the wrong JSON type, in body order, is a SerializationException with AWS's deserializer message, ahead of the name validation, the page size and the contact list lookup. The type checks this makes unreachable are removed, including the hand-built AttributesData messages, which the walk now produces through the shared helper. UnsubscribeAll and UseDefaultIfPreferenceUnavailable keep their boolean coercion, and PageSize its integer check. * docs(ses): note the null contact topic element deviation A null element of Topics or TopicPreferences passes the SES v2 shape check like a null address element, but SES then answers it with a 500 InternalFailure. Floci keeps a 400 BadRequestException naming the element. The request member types section only described the address case, "as on AWS", so it now says that this one deviates. |
||
|
|
9ea977cafa |
fix(cognito): give an email sign-in code eight digits (#5873)
Floci issued six digits for every code. Measured on AWS (eu-west-1, 2026-10-16), through a Custom Email Sender that printed what Cognito handed it: the USER_AUTH EMAIL_OTP sign-in codes were 06988020, 50415180 and 81488702, eight digits, while the sign-up, resent, forgotten-password, UpdateUserAttribute and VerifyUserAttribute codes had six. A client that checks the length, or a test that reads the code from a message, sees the difference. Only the email sign-in code changes. MFA codes (SMS_MFA, EMAIL_MFA) and SMS_OTP keep six digits: they were not measured, and nothing here guesses. The Cognito tests now read codes through one CognitoCodes helper, in place of the six copies of the same extraction they carried. |
||
|
|
e12b878b77 |
fix(cloudformation): resolve Fn::GetStackOutput as CloudFormation does (#5848)
* fix(cloudformation): resolve Fn::GetStackOutput as CloudFormation does Fn::GetStackOutput was not implemented, and an intrinsic the template engine does not know falls through to the node's text, which for an object is "". A weak cross-stack reference, which aws-cdk-lib synthesizes as Fn::GetStackOutput, therefore deployed CREATE_COMPLETE with an empty string wherever the value was used. The engine now resolves it through a StackOutputResolver that CloudFormationService answers as DescribeStacks would in the referenced account and Region, and the YAML parser maps the !GetStackOutput short form. Every rule follows what CloudFormation does, measured in eu-west-1, where that departs from the function's reference page: a missing stack or output fails the resource and the stack rolls back, an output that cannot be read rolls the stack back once the resources exist, an output whose Condition is false is never read, a dynamic reference reaches DescribeStacks unresolved, and the function is refused in Conditions and inside Fn::ImportValue when the operation is requested, AWS::Include fragments included. A RoleArn has to name an existing role: Floci runs no stack operation under an execution role, so, as AssumeRole does with IAM enforcement off, its trust policy is not evaluated. * fix(cloudformation): refuse Fn::GetStackOutput in export names and nested stacks as AWS does Answers the review of #5848, each point measured on CloudFormation in eu-west-1 on 2026-10-17. An output's Export.Name holding Fn::GetStackOutput is refused when the operation is requested, with "Template format error: Output O is malformed. The Name field of Export must not depend on any resources, imported values, or Fn::GetAZs.", so it never reaches execution. A nested stack's template is checked when the child is created: the Child resource fails with the template error and the parent rolls back. A dynamic reference inside an Fn::Sub variable map of the function's arguments is left as written too: CloudFormation hands it to DescribeStacks unresolved, which refuses the name. The engine suspends dynamic references while it resolves the arguments. An output that cannot be read now logs the stack and the output before the rollback, and the placement check skips only a template that does not parse or an AWS::Include that fails, which the operation reports where it processes them. * fix(cloudformation): check a Fn::GetStackOutput role's trust and permissions under IAM enforcement With IAM enforcement on, a RoleArn only had to name an existing role, so a stack could read another account's outputs through any role there, whatever the role trusted. GetStackOutputRoleAuthorizer now decides the role as AssumeRole and AppSyncDataSourceAuthorizer do: its trust policy has to allow a principal in the consuming account, and its policies, through IamPolicyEvaluator, have to allow cloudformation:DescribeStacks on the referenced stack. The refusals carry the messages measured on CloudFormation: STS's AccessDenied, and DescribeStacks' for the GetStackOutput session. With enforcement off nothing changes. Which principal CloudFormation acts as is not known in Floci, which runs stack operations under no execution role and keeps no caller, so a grant to any principal of the consuming account is enough: its root, or any principal of it the policy names, such as the CDK's execution role. That question is AssumeRolePolicyEvaluator.allowsAnyPrincipalOf, built on its own decide(), so the trust policy is parsed and evaluated in one place. Reuse instead of copies: the tests use EnforcementFixtures.auth, a new EnforcementFixtures.createRole overload taking the trust policy, and PartitionCleanup, and the two GetStackOutput tests share their stack and parameter helpers. The placement checks find the function with JsonNode.findValues instead of three hand-written walks, and the resolveOutputValue wrapper of resolve() is gone. |
||
|
|
5fc58a9a9c |
fix(ec2): preserve elastic IP pool and border group (#5821)
* fix(ec2): preserve elastic IP pool and border group * test(ec2): share account-scoped query requests |
||
|
|
5eb4eecf99 |
feat(lambdaweb): enforce IamAuth on Web Function endpoints (#5855)
* fix(lambdaweb): accept role and user ARNs as resource policy principals AWS checks an ARN principal against a pattern that allows a slash, so a role or user ARN passes. Any other AWS principal value is still checked against the pattern without a slash. * feat(lambdaweb): verify SigV4 and InvokeWebFunctionEndpoint on IamAuth endpoints An IamAuth endpoint takes a request signed for the service lambda in the endpoint's region, in the Authorization header or a presigned query. The X-Amz-Content-SHA256 header is required and is the payload hash, as on AWS. A refused request gets the AWS 403 page with no error type. The check runs after the rateLimit 0 page and before the rate limit. Under IAM enforcement the signer also needs lambda:InvokeWebFunctionEndpoint on the endpoint ARN from its identity policy or the function's resource policy, with the auth type and the function tags as condition keys. An Authorization that is an AWS signature is dropped before the app on every endpoint, together with X-Amz-Security-Token. * fix(lambdaweb): give the app the path without dot segments and sign only the normalized path Lambda removes dot segments before the app sees the path, on every endpoint, and keeps repeated slashes and encoded dots. An IamAuth signature counts only over the path as signers normalize it. A signature over the path as sent is refused when the two differ. Floci forwarded the path as sent and took a signature over either form, so a request signed for /a/c could reach the app as /a/./b/../c. * fix(lambdaweb): answer 502 when the caller check fails inside Floci A malformed date or query is still a refused signature. Any other failure, such as in IAM storage, no longer looks like a 403. The endpoint answers it with 502 and no error type, as AWS answers its own failures. * fix(lambdaweb): check a principal against the ARN pattern only under AWS Lambda allows a path only in an ARN under the AWS key. A CanonicalUser or Federated value never matches that pattern. * docs(lambdaweb): MultiRegion SigV4, presigned queries and dot segments on the way to the app * chore(auth): share SigV4 signature parsing and age limits with API Gateway The API Gateway authorizer and Lambda Web IamAuth read a SigV4 signature from the Authorization header or a presigned query, and check its age, in the same way. Both now use one record in core.common.auth. Each still decides which placement wins and where it reads the session token, so neither behaves differently. |
||
|
|
1d5940944e |
docs(redshift-serverless): drop served operations from unknown-operation list (#5862)
Drop snapshot copy configurations, endpoint access, resource policies and custom domain associations from the list of operations that answer UnknownOperationException, as all four are served now. Also drop scheduled actions, tracks, managed workgroups and reservations, which are served in the actions table and do not answer UnknownOperationException. |
||
|
|
20b7a3673e |
fix(dms): accept explicit default subnet group on CreateReplicationInstance (#5820)
* fix(dms): accept explicit default subnet group on CreateReplicationInstance CreateReplicationInstance with ReplicationSubnetGroupIdentifier=default (any case) returned ResourceNotFoundFault because only stored groups were consulted. AWS creates the default group on first use, so naming it explicitly is one way it comes into existence. It is now accepted whenever the region has default subnets, and the instance then makes it listed, keeping the rule that default is listed only once an instance uses it. * fix(dms): resolve the instance subnet group only after create validations CreateReplicationInstance resolved ReplicationSubnetGroupIdentifier=default before the duplicate-identifier, ResourceIdentifier and tag checks. Resolving default reads the region's subnets, which seeds its default VPC, so a request rejected by a later check still left a default VPC and subnets behind. The group is now resolved after every other check has passed, just before the instance is stored; successful requests behave as before. |
||
|
|
0be4581d4e |
fix(ec2): preserve IAM instance profile identity (#5671)
* fix(ec2): preserve IAM instance profile identity Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): probe metadata readiness with IMDSv2 Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(autoscaling): preserve launch profiles and metadata options Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): preserve automatic public addresses across launch paths Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): honor metadata token requirements and profile identity Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): keep synthesized node identity and mock addresses consistent - IMDS iam/info serves the instance profile identity EKS synthesizes for its cluster nodes while IAM holds no such profile. The node carries a stable IAM-shaped profile id, which DescribeInstances now copies too. - Mock instances get their automatic public address however the launch completes, DescribeInstanceStatus included. An associated Elastic IP replaces it, disassociating gives a running instance a new one, and termination leaves none. - CreateFleet forwards the launch template's metadata options and its primary interface AssociatePublicIpAddress. - Launch templates store a profile name and ARN pair as given and the launch from them rejects it, since AWS does not fully validate template parameters at creation. - CloudFormation launch-configuration MetadataOptions resolve Fn::If and AWS::NoValue. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): refuse profile pairs for groups and keep Elastic IPs exclusive - Auto Scaling refuses a group whose launch template, directly or through its mixed instances policy, names both an instance profile name and an ARN, with ValidationError, instead of accepting a group that can never launch. - AssociateAddress disassociates the Elastic IP an instance already has, as AWS documents. In mock mode a terminated instance takes no address, and an unchanged address is not written again. - IMDS iam/info falls back to a cluster node's synthesized identity only while IAM holds no profile at that ARN; a held profile without a role answers 404. - CreateFleet takes the subnet of the device-index-0 interface first, as RunInstances does. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): assert profile ids and launch configuration metadata via the SDK Ec2InstanceProfilePathTest now checks that direct, template, override and fleet launches report IAM's InstanceProfileId, and AutoScalingTest round-trips launch configuration MetadataOptions through the AWS SDK for Java v2, including the absent structure and a rejected hop limit. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): displace an Elastic IP a retained interface carries - AssociateAddress also disassociates an Elastic IP held by the instance's primary interface, which a retained network interface carries from an earlier instance, so one instance never holds two. - Mock stop and terminate change the instance's state and public address under its lock, like the launch and Elastic IP writes. - Docs and comments say where the profile pair fails and when CreateFleet falls back to another interface's subnet. - Tests cover the retained-interface address, the group update path, the full refusal message and the fleet's availability zone, and the SDK launch configuration test cleans up on failure. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): refuse reserved RunInstances tags before resolving the profile Resolving the instance profile called the EC2 service before tag parsing, so a reserved aws: tag was refused only after that lookup. Parse tags first, as the reserved-tag check requires. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(autoscaling): assert the refresh launched the replacement Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(autoscaling): describe what the refresh assertion checks Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): cover invalid launch-configuration metadata options Invalid HttpTokens, invalid HttpEndpoint, hop limits of 0 and 65 and a non-integer hop limit each fail the AWS::AutoScaling::LaunchConfiguration resource with the validation message, roll the stack back and leave no launch configuration behind. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin metadata failure reasons and accepted hop limits Assert the exact resource failure reason, and cover hop limits of 1 and 64, a string hop limit and one from a Number parameter. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(ec2): leave IMDS token enforcement to a separate change HttpTokens=required enforcement, the IMDSv2 readiness probe and the helper shell environment reset move to their own pull request, so this change keeps only the instance profile identity. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(ec2): leave mock public addresses to a separate change Mock public IPv4 assignment, primary-interface public IP and subnet handling and Elastic IP displacement move to their own pull request. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(autoscaling): leave launch metadata options to a separate change Launch-configuration MetadataOptions over Query and CloudFormation, and metadata options forwarded from launch templates and EC2 Fleet, move to their own pull request. Launch-configuration profile resolution stays. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): use the shared metadata and authorization fixtures Ec2MetadataProfileIntegrationTest starts its metadata server and requests tokens through Ec2MetadataTestFixture, and it and Ec2InstanceProfileIdentityIntegrationTest build their Authorization header with EnforcementFixtures.auth. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(ec2): close the Auto Scaling profile paragraph's code fence Removes a stray fence that rendered the launch-configuration profile paragraph as code, and a doubled blank line before the iam/info paragraph. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): find profile identity launches by a run tag Each launch carries a tag unique to the test run, and the tests look their instances up by that tag rather than by client token. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(ec2): leave the client-token filter to a separate change The instance filter is not part of the profile identity, and this copy let a wildcard match instances launched without a token. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
fa2a49e771 |
feat(redshift-serverless): add scheduled action actions (#5852)
Add CreateScheduledAction, GetScheduledAction, ListScheduledActions, UpdateScheduledAction and DeleteScheduledAction. An action is recorded and echoed, never run, and a cron schedule reports no upcoming invocations. It is tied to the namespace by the namespace's generated id, so a namespace recreated under the same name does not inherit it. Required members, name patterns, the snapshot name prefix length and the tag shape come from the AWS model through RedshiftServerlessRequestShapes. Only what the model cannot express stays in the service: the schedule union, the time window, the retention range and the namespaces that must exist. |
||
|
|
a611e9ea6f |
fix(iam): authorize Secrets Manager requests against the secret's ARN (#5781)
* fix(iam): authorize Secrets Manager requests against the secret's ARN IAM enforcement evaluated CreateSecret against secret:* because the builder read only SecretId, and a secret named by its name was evaluated as secret:<name>, without the random suffix every secret ARN carries. A secret:<name>-?????? policy, the pattern AWS documents for granting access to a secret that may not exist yet, matched neither. CreateSecret is now evaluated against secret:<Name>-??????, standing in for the suffix that is assigned at creation, and a name-based SecretId resolves to the stored secret's full ARN in the target account. Closes #5364 * fix(iam): pick the Secrets Manager target by the serving operation CreateSecret now reads only Name and other actions only SecretId, so a field the handler ignores cannot choose the resource. Minted ARNs take the request's partition, and a name lookup also reads a legacy unprefixed secret for the default account. Adds an SDK compatibility test. * fix(iam): resolve a partial-ARN SecretId to the stored secret's ARN A SecretId given as an ARN without the random suffix is now authorized against the stored secret's full ARN, resolved in the caller's account in the order the operations use: an exact ARN first, then the ARN read as a partial one. The enforcement tests share EnforcementFixtures' auth, a new assumeRole helper, and a new createRole helper that removes the role after the test. The Secrets Manager enforcement test also deletes the secrets it creates. |
||
|
|
1cb8b0f747 | feat(redshift-serverless): accept customDomainName in GetCredentials (#5856) | ||
|
|
2a012cf9a4 |
feat(redshift-serverless): add snapshot copy configuration actions (#5798)
* feat(redshift-serverless): add snapshot copy configuration actions Add CreateSnapshotCopyConfiguration, ListSnapshotCopyConfigurations, UpdateSnapshotCopyConfiguration and DeleteSnapshotCopyConfiguration. A configuration is recorded and echoed; Floci copies no snapshot. A namespace has one configuration at a time and the destination Region must differ from its own. The configuration is tied to the namespace by the namespace's generated id, so a namespace recreated under the same name does not inherit it. Required members come from the AWS model through RedshiftServerlessRequestShapes. The destination Region name and the retention range are checked by hand because the model leaves them unconstrained. * fix(redshift-serverless): validate boundary inputs and scope snapshot copy pagination tokens * refactor(redshift-serverless): share maxResults range check and invalidPagination helper |
||
|
|
d4158b954b |
fix(ssm): retain command ownership during background execution (#5841)
* fix(ssm): retain command ownership during background execution * fix(ssm): keep agent fallback messages within their owner * test(ssm): share region-scoped authorization fixtures |
||
|
|
d1509c368f |
fix(s3): default new buckets to BucketOwnerEnforced (#5782)
* fix(s3): default new buckets to bucket owner enforced Initialize ownership controls at bucket creation and opt ACL-focused tests into legacy ownership modes. Repair existing import grouping so repository-wide Checkstyle passes. * fix(s3): honor bucket ownership and ACL headers Preserve explicit CreateBucket ownership and ACL grants, and reject grants incompatible with enforced ownership. Validate multipart grants at initiation and carry accepted grants through completion. Adapt ACL-focused regressions to opt into legacy ownership modes. * fix(s3): respect account public ACL setting at bucket creation * refactor(s3): share create-bucket ownership XML builder |
||
|
|
708dc32fa1 |
feat(ec2): support egress-only internet gateways (#5822)
* feat(ec2): support egress-only internet gateways CreateEgressOnlyInternetGateway fell through to UnsupportedOperation, so aws_egress_only_internet_gateway could not be created, and DescribeEgressOnlyInternetGateways always answered an empty set. Egress-only gateways are now stored (ec2-egress-only-internet-gateways.json, through StorageFactory) and created attached to an existing VPC, with TagSpecification and CreateTags applied. Describe filters by ID, egress-only-internet-gateway-id, attachment.vpc-id, attachment.state and tags; Delete returns returnCode. DeleteVpc reports DependencyViolation while one is attached. The three actions are added to EC2 query routing, which removes DescribeEgressOnlyInternetGateways from the known gaps. * fix(ec2): settle Qodo findings on egress-only internet gateways - CreateEgressOnlyInternetGateway validates TagSpecification tags before it creates anything, so an aws: key no longer leaves an attached gateway behind. Tags are applied with the gateway, under the topology lock. - A ClientToken replay compares the creation tags as well as VpcId: changed tags fail with IdempotentParameterMismatch, and a matching replay returns the gateway unchanged instead of re-tagging it. - DescribeEgressOnlyInternetGateways honours MaxResults (5 to 255 in the EC2 model) and NextToken, ordered by ID, using the service's existing token codec. - DeleteEgressOnlyInternetGateway takes the resource lock createSystemTags takes, and leaves routes that targeted the gateway in place as blackhole, the state AWS documents for a route whose target is gone. * fix(ec2): DeleteEgressOnlyInternetGateway without an id is MissingParameter The EC2 model marks EgressOnlyInternetGatewayId required. A request without it answered InvalidGatewayID.NotFound for 'null'; it now gets the same MissingParameter the other EC2 handlers return. An unknown id still fails with InvalidGatewayID.NotFound. |
||
|
|
197ccb5fb7 |
fix(cloudformation): refuse an update that has nothing to change (#5849)
* fix(cloudformation): refuse an update that has nothing to change UpdateStack ran a full update for a stack resubmitted as it was, ending UPDATE_COMPLETE, and CreateChangeSet created an AVAILABLE change set for it. CloudFormation refuses the update with "No updates are to be performed." and creates the change set FAILED, UNAVAILABLE, with "The submitted information didn't contain changes. Submit different information to create a change set."; the CDK and aws cloudformation deploy read that reason as "no changes". What CloudFormation compares was measured in eu-west-1: each active resource's Type, Properties, Metadata, DeletionPolicy, UpdateReplacePolicy and UpdatePolicy, and each active output's Value, Description and Export, with whatever does not depend on a resource resolved first, and the tags as a set (absent Tags keep the stack's). ComparedTemplate brings a template to that form: a new Description, an unused parameter, a DependsOn or a literal written as Fn::Join is no change, while a used mapping value, a Ref of a resource rewritten as Fn::Sub, or a dynamic reference whose stored value moved is one. Templates are compared as processed, AWS::Include fragments read again and the SAM transform applied with the stack's parameter values, and a stack with a nested stack is always updated. The change set diff uses the same form. The CDK deletes the FAILED change set and deletes it again by name before its next deploy, so DeleteChangeSet now answers success for a change set the stack does not have, as CloudFormation does. A stack set instance whose stack has nothing to change is left as it is. Tests that resubmitted an identical template to exercise an update add an output through CfnUpdates.forceUpdate, which is an update on AWS too. * fix(cloudformation): record dynamic reference values when an operation commits Answers the review of #5849. The value each dynamic reference resolved to is now recorded when the stack's operation commits, from the template the stack then has and keyed as ComparedTemplate hands the references over, instead of while the engine provisioned each resource. Recording and comparison so see the same strings, an Fn::Sub that also reads a resource included; an update that fails and rolls back records nothing and keeps the last deployment's values; a reference the template dropped is dropped; and AWS::RDS::DBInstance's master credentials, which its provisioner resolves itself with ssm-secure, are compared like any other reference. The values are kept as an HMAC-SHA256 under a random key of the stack's own rather than a bare SHA-256. ComparedTemplate keeps an AWS::NoValue inside a function it compares as written, and gives the array form of Fn::Sub the static variable substitution the string form has, its own variables left as written. A stack set instance with nothing to change succeeds whatever status an earlier rolled-back update left its stack in, and the change set that found it so is deleted. DeleteChangeSet by a change set's ARN alone succeeds when the change set is gone, as measured on CloudFormation in eu-west-1 on 2026-10-17. The comparison now catches only what it can meet: a template that does not parse, and the AwsException an AWS::Include, the SAM transform or an SSM parameter raises, which the update itself then reports. |
||
|
|
c8de16ffc7 |
fix(lambdaweb): never run a request twice when the app crashes (#5842)
* fix(lambdaweb): retry a failed request only when Floci saw the exit before sending it A request that found its environment dead was retried when Docker's exit time came before the request start. Docker takes that time from the daemon's clock, which can be seconds behind Floci's. So a request the app had received could run a second time. Docker also reports an exit late under load. Until then the dead environment stayed in the pool, and the next request got a 503 too. Floci now follows each environment with an attach stream. The stream ends when the process exits, and Floci notes the time on its own clock. A failed request waits for that, up to one second. It is retried only if the exit came before it was sent. Otherwise it gets the 503 page after the dead environment has left the pool. * docs(lambdaweb): note the short window after an exit in the 503 row * fix(lambdaweb): clean up an exited environment off the reaper thread Docker can take seconds to report an exit status under load. On the reaper this held up the rearm of dropped exit watches and the idle checks. * test(lambdaweb): wait for Floci to see the exit instead of polling for the container |
||
|
|
7cab804d22 |
feat(redshift-serverless): add custom domain association actions (#5766)
* feat(redshift-serverless): add custom domain association actions Add CreateCustomDomainAssociation, GetCustomDomainAssociation, ListCustomDomainAssociations, UpdateCustomDomainAssociation and DeleteCustomDomainAssociation. An association is recorded and echoed; Floci serves no traffic on the domain and reads no ACM certificate. It is tied to the workgroup by the workgroup's generated id, so a workgroup recreated under the same name does not inherit it. The domain name and certificate ARN patterns, lengths and the required members come from the AWS model through RedshiftServerlessRequestShapes, so the service carries no validation of its own. * fix(redshift-serverless): address review findings for custom domains - Expose custom domain name and certificate ARN in workgroup responses. - Ensure custom domain names are unique across workgroups in a region. - Remove ambiguous Pagination.paginate overload in favor of paginateNamespaced. - Add domain name and certificate ARN validation patterns and length checks. - Enforce validation for required parameters in custom domain operations. * fix(redshift-serverless): enforce single custom domain per workgroup and populate certificate expiry * fix(redshift-serverless): read certificate expiry dynamically and share custom domain serialization |
||
|
|
92be67d2df |
fix(logs): enforce group permissions for lifecycle changes (#5840)
* fix(logs): enforce group permissions for lifecycle changes * fix(logs): accept bare group ARNs in lifecycle policies |
||
|
|
534571b2a3 |
feat(iot): route shadow events through topic rules (#5260)
* feat(iot): route shadow events through topic rules Successful classic and named shadow changes, from the REST API and from MQTT reserved topics, now reach the topic rules engine and MQTT subscribers on the AWS response topics with AWS payload shapes. Shadow documents keep metadata, clientid() reports N/A for messages without an MQTT client, and MQTT rejected responses carry the numeric status code. Closes floci-io/floci#5256 * fix(iot): compute the shadow delta through nested objects GetThingShadow and the update/delta event compared desired and reported only at the top level, so one differing nested field put the whole desired object in the delta. AWS compares nested objects key by key and arrays whole, and the delta event carries the stored desired metadata of exactly the delta values. * fix(iot): give a shadow stored without metadata its leaf metadata A shadow persisted before metadata was kept now reads back with a metadata mirror of its state stamped with its stored timestamp, so GetThingShadow and the update/documents and update/delta events carry metadata for its existing leaves, as AWS does for every state leaf. * fix(iot): reject a shadow name outside the AWS pattern A whitespace-only shadow name no longer addresses the classic shadow, so DELETE ?name=%20 cannot delete it. As on AWS, an empty name is the classic shadow and any name that is not 1 to 64 of [a-zA-Z0-9:_-] fails with InvalidRequestException. * fix(iot): ignore a shadow request on a named topic with an invalid name As on AWS, an MQTT request on $aws/things/<thing>/shadow/name/<name>/<op> whose name is not a valid shadow name, empty included, is not a shadow request: nothing is published and the classic shadow is untouched. Before, an empty name updated the classic shadow and a blank one was rejected on the classic shadow's topic. * docs(iot): note that wildcard rule filters receive shadow events Verified on AWS IoT: rules FROM '#' and '+/things/<thing>/shadow/#' receive the $aws shadow update events. Adds a test locking in the existing matcher behavior. * fix(iot): keep only the most recent recorded publish events The recorder kept every publish, and shadow events now go through it too. Only tests read it, so it now keeps the most recent 1,000 events and drops the oldest. * test(iot): read shadow rule queues without the 5s poll * fix(iot): match AWS shadow names, delta numbers and clientToken echo Accept the reserved $package shadow name and reject any other name containing $ with 'Invalid shadow name : <name>'; a name failing the pattern answers 'Bad Request'. Compare delta numbers as AWS does (equal when both double and long values are, integers beyond long exactly), which also stops a number beyond the double range failing the update, and echo a whitespace clientToken. |
||
|
|
2f56c225dc |
docs(iam): note which resource policies are not evaluated (#4899)
The IAM page says S3 bucket, Lambda function and SNS topic policies take part in request authorization, but not that SQS queue and API Gateway REST API policies are stored without being evaluated. Add that next to the S3, Lambda and SNS bullets. No behaviour changes. |
||
|
|
3db18d58a5 |
feat(codeartifact): add NuGet/BaGetter sidecar for the nuget format (#5790)
Bridges the nuget package format to a real per-repository BaGetter container, the same Manager/Client sidecar shape already established for Maven (Reposilite), npm (Verdaccio), and pypi (pypiserver): a real NuGet V3 push/install round trip through CodeArtifactNuGetController, GetPackageVersionAsset and GetPackageVersionReadme bridged to the live sidecar, and DeletePackage wired through the same CONTAINER_BACKED_FORMATS dispatch the other three formats use. GetPackageVersionReadme is answered live against BaGetter (its own readme-file and nuspec-description endpoints) rather than captured at publish time, since unlike Verdaccio and pypiserver, BaGetter can answer for a specific historical version after the fact. Pins bagetter/bagetter, the actively maintained fork of the original, long-stale loic-sharma/BaGet (no commits since mid-2024, every one of its own releases tagged -preview/-prerelease), confirmed directly against a live container for push/download/readme/delete semantics before relying on them. |
||
|
|
050f93e600 |
feat(core): make the init hook directory configurable (#5801)
* feat(core): make the init hook directory configurable
Hook directories were fixed at /etc/floci/init/{boot,start,ready,stop,
shutdown}.d, which only the image can provide. floci.init-hooks.dir
(FLOCI_INIT_HOOKS_DIR) now sets that root, defaulting to /etc/floci/init so
the image is unchanged; the LocalStack-compat tree is still read as well.
Hooks also run on Windows, where there is no /bin/sh: .ps1 with
PowerShell, .cmd and .bat with cmd, and .py with python. A .sh hook there
is skipped with a warning unless another shell is configured; on Linux and
macOS the Windows script types are ignored.
Refs #5767
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(core): match Windows hook extensions in any case and warn about a skip once
Review follow-ups for the configurable hook directory:
- Windows file names are case-insensitive, so SETUP.BAT and Init.PS1 are
now hooks there; elsewhere the extension must stay lower case, as before.
- The warning for a hook Windows cannot run is logged once per file
instead of on every directory listing, and Windows script types are
ignored silently on Linux and macOS.
- The environment variable reference and application.yml list shutdown.d
with the other hook directories.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(core): always resolve hook directories from the configured root
findMergedScripts called getPrimaryPaths() for the default root and
getPrimaryPaths(hooksRoot) otherwise, though both return the same
directories; the no-argument form only survived because five tests stub
it on a mocked hook. The runner now always passes its root, the overload
is gone, and those tests stub getPrimaryPaths(anyString()).
The runner tests this branch added drop @DisplayName, per AGENTS.md.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
|
||
|
|
43ad214896 |
fix(ses): check v2 configuration set request bodies against the service model (#5836)
* fix(ses): check v2 configuration set request bodies against the service model
CreateConfigurationSet, UpdateConfigurationSet,
PutConfigurationSetSuppressionOptions, PutConfigurationSetVdmOptions and
Create/UpdateConfigurationSetEventDestination now check their body against
the vendored SES v2 shapes before any other validation, as the send
operations do. A member of the wrong JSON type, nested ones included, is a
SerializationException with the deserializer's message, ahead of the name
validation and the configuration set lookup.
The type checks the walk makes unreachable are removed from the option
parsers and parseSuppressedReasons. requireOptionObject and coerceBoolean
build their messages through the SesV2Json helpers. A non-object event
destination is now a SerializationException instead of "EventDestination is
required.", and these operations answer a non-object body with "Request
body must be a JSON object." while a blank body still reads as {}.
* fix(ses): read the suppression-options body like the other checked operations
PutConfigurationSetSuppressionOptions inlined the blank-body, parse and
requireJsonObject steps that readOptionBody already performs, which made
its order look different from the other checked operations. It now calls
readOptionBody, so all six read the body the same way before the shape
check. Behaviour is unchanged.
* test(ses): share the SES v2 member-type test helpers
The configuration set member-type test copied the send test's request
assertion and deserializer message constants. Both now use
SesV2SerializationErrors, which takes the HTTP method, so the Contact and
metrics/import/export PRs can reuse it.
|
||
|
|
f1e00eff5c |
fix(docker): preserve explicitly configured DNS resolvers (#5727)
* fix(docker): preserve explicitly configured DNS resolvers Honor explicit --dns entries before injecting the embedded resolver and public fallbacks. Keep automatic DNS for containers without configured resolvers, and verify the shared builder and Lambda launcher preserve the requested list. Signed-off-by: Andre Kurait <akurait@amazon.com> * fix(lambda): keep AWS endpoints reachable with explicit DNS Signed-off-by: Andre Kurait <akurait@amazon.com> --------- Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
1d1479f9fb | fix(core): keep JSON requests in their selected region (#5697) | ||
|
|
792260ed49 |
fix(s3): apply and check the Object Lock headers of every object creation (#5828)
CopyObject ignored its Object Lock headers, and CreateMultipartUpload ignored those and its grant headers, so the copy or the completed upload came out without the lock or the grants the request asked for. PutObject read the lock headers without checking them: a malformed retain-until date was a 500, and a mode without a date, a date without a mode or an unknown mode was accepted. PutObject, CopyObject and CreateMultipartUpload now read the lock headers through one check that refuses them as S3 does, with InvalidArgument naming the header: a mode and a date come together, checked first, and the mode is GOVERNANCE or COMPLIANCE. A date that is not an ISO 8601 timestamp is refused the same way. CopyObject applies the settings to the copy. CreateMultipartUpload keeps them and its grants, and applies them when the upload completes. Its grants are checked when the upload is created, under the bucket-owner-enforced rule PutObject uses, so a grant S3 refuses fails the creation rather than the completion. Refs #5716 |
||
|
|
caa606ba7d |
fix(iot): resolve connect policy variables through the IAM resolver (#5827)
IoT carried its own policy-variable pass. Before handing the attached documents
to the evaluator, IotService walked each statement's parsed tree, replaced the
connection's ${iot:...} values in every string it found, and dropped any
statement that still held a ${...}. That was IoT's copy of the mechanism the
evaluator gained for every other policy Floci reads, so the documents now go in
as written and PolicyVariableResolver does the substituting, from the same
condition context the connection already supplies.
The developer guide gives IoT no policy language of its own to justify a second
reader: AWS IoT Core policies "are JSON documents. They follow the same
conventions as IAM policies", they "follow the same policy evaluation logic as
IAM policies", and a policy variable is one "that can be used in AWS IoT Core
policies in the Resource or Condition block". The predefined ${*}, ${?} and
${$} are documented by pointing at IAM's own variables page.
Five corners move, each of them onto what those pages say:
- A ${...} outside Resource and Condition is text. The text pass substituted
into every string of the statement, Action and Sid included, where the guide
gives a variable meaning in those two elements only.
- ${*}, ${?} and ${$} resolve to the characters they stand for. Any statement
holding one used to be dropped, the unresolved-variable scan being a plain
\$\{[^}]*\} that matched them too.
- A variable resolves whatever case its key is written in, the variables page
being explicit that "Key names are case-insensitive. For example,
aws:CurrentTime is equivalent to AWS:currenttime". A thing attribute spelled
two ways in one registry now collides on that reading, which is the price of
the IAM rule and not a surprise unique to IoT.
- An unresolvable variable in a Condition value leaves the value null rather
than taking the whole statement away, so a positive operator does not match
and a negated one does. A Resource pattern holding one still matches no
resource, which is what dropping the statement amounted to.
- Variables need the version that introduced them. A document that does not
declare "Version": "2012-10-17" keeps ${iot:ClientId} as literal text, the
guide's answer being that "if you don't set the Version to 2012-10-17 or
later, variables like ${aws:username} are treated as literal strings in the
policy". Every policy example in the IoT guide declares it.
A connection no longer rewrites the document it evaluates, which the evaluator's
parse cache notices: it is keyed by document text, so it held one entry per
client id where it now holds one per policy.
Five tests in IotServiceDeviceAuthTest cover the five corners, and the
unresolved-variable, JSON-syntax and thing-attribute tests already there cover
what has to stay put. docs/services/iot.md says what resolves where.
|
||
|
|
49a3ff9a10 |
fix(logs): bind ARN tag operations to their owning group (#5810)
* fix(logs): bind ARN tag operations to their owning group * fix(logs): preserve literal names in tag requests * test(logs): share authorization fixtures |
||
|
|
e245dbbdd5 |
fix(swf): wait for new events after empty decisions (#5746)
* fix(swf): wait for new events after empty decisions Signed-off-by: Andre Kurait <akurait@amazon.com> * fix(swf): wake senders after successful external outcomes Signed-off-by: Andre Kurait <akurait@amazon.com> --------- Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
c67a5afbc3 |
feat(redshift-serverless): add endpoint access actions (#5742)
* feat(redshift-serverless): add endpoint access actions Add CreateEndpointAccess, GetEndpointAccess, ListEndpointAccess, UpdateEndpointAccess and DeleteEndpointAccess. Floci creates no VPC endpoint, so an endpoint is recorded and echoed with the workgroup's own address and port. It is tied to the workgroup by the workgroup's generated id, so a workgroup recreated under the same name does not inherit its predecessor's endpoints. Required members and the ownerAccount pattern come from the AWS model through RedshiftServerlessRequestShapes. The endpoint name rule is checked by hand because the model documents it but does not encode it. * fix(redshift-serverless): validate boundary inputs and scope endpoint pagination tokens Validate policy is not null or blank in requireJsonObject before Jackson parsing to avoid unchecked IllegalArgumentException. Validate required endpointName, workgroupName, and subnetIds at create boundary. Validate non-null vpcSecurityGroupIds on endpoint updates. Add namespaced paginate overload with limit validation, scope ListEndpointAccess tokens to endpoint-access, and report pagination errors as ValidationException. * fix(redshift-serverless): allow optional vpcSecurityGroupIds on update and reuse existing pagination overload Allow omitting or passing null vpcSecurityGroupIds in UpdateEndpointAccess to leave existing security groups unchanged. Validate maxResults in the service and call the existing namespaced Pagination.paginate overload instead of adding core overloads. Omit the snapshot policy null check which belongs to #5730. |
||
|
|
772ec8d0c9 |
feat(rds): add the snapshot export task API (#5787)
* feat(rds): add StartExportTask, DescribeExportTasks and CancelExportTask with the export task lifecycle * docs(rds): document the snapshot export task API * fix(rds): route the export task actions to RDS when a request has no signing scope * fix(rds): refuse an export to a bucket outside the snapshot's region * fix(rds): answer export task calls with a copy of the task taken under the lock * fix(rds): refuse an unknown DescribeExportTasks filter name before matching any task * fix(rds): fail an export to a bucket in another region as a task, as RDS does, rather than refuse it * docs(rds): say that a bucket in another region fails an export in mock mode too |
||
|
|
068635b4a6 |
fix(sqs): compare CreateQueue attributes against effective values (#5780)
* fix(sqs): compare CreateQueue attributes against effective values CreateQueue on an existing name compared requested attributes against the raw stored map. SqsManagedSseEnabled is derived on read and never stored, so re-creating a default queue with SqsManagedSseEnabled=false returned the existing queue instead of QueueAlreadyExists. Extract the read-time derivation from GetQueueAttributes into one helper and use it for both the read path and the conflict check. * fix(sqs): treat a padded MaximumMessageSize as equal to its canonical form on re-create * fix(sqs): treat an empty MaximumMessageSize as its default on re-create CreateQueue accepts an empty MaximumMessageSize and the effective value it reports is the configured default, but the conflict check skipped canonicalising empty requests, so an identical retry raised QueueAlreadyExists instead of returning the existing queue. |
||
|
|
7e98592761 |
fix(s3): act on the object version a tagging request names (#5775)
PutObjectTagging and DeleteObjectTagging ignored versionId and changed the current version. GetObjectTagging dropped it in the controller, so it read the current version too, and the service took versionId=null as the current version even on a key that has no null version. All three now act on the version named. "null" names only the null version, the object stored without a version id; on a key that has none the request answers NoSuchVersion. Each returns the version it acted on in x-amz-version-id. A request on a delete marker, named or current, answers 405 MethodNotAllowed with Method and ResourceType, and with x-amz-delete-marker: true, as S3 does. A put or delete runs under the bucket monitor that writes, deletes and the lifecycle sweep hold, so a version deleted between the lookup and the write is not written back. Since they act on the version named, a request naming one is now checked as s3:GetObjectVersionTagging, s3:PutObjectVersionTagging or s3:DeleteObjectVersionTagging, carrying s3:versionid, in place of the base tagging action. Part 1 kept these requests on the base actions because the operations changed the current version. The s3:ExistingObjectTag lookup already read the version named, so the tags a condition sees are now those of the version the request changes. The IAM condition context still reads s3:ExistingObjectTag for versionId=null from the current version, which GetObject still serves for it, so a deny on those tags keeps applying. Refs #5716 |
||
|
|
608a38bff3 |
fix(iam): read a role trust policy with the caller's principal keys (#5770)
A role's trust policy was the one context a request is evaluated against that did not say who was calling. AssumeRolePolicyEvaluator assembled its own map and put aws:PrincipalArn into it alone, so a trust policy keyed on aws:userid, aws:PrincipalType or aws:username could not match, where every other context a request is evaluated against carries all four through CallerArns.putPrincipalKeys. The user guide puts aws:PrincipalType and aws:userid in "the request context for all requests, including anonymous requests" and aws:username in it for every IAM user, and an sts:AssumeRole request is no exception: the guide's own example of a resource-based policy tells principals apart in a Condition on aws:userid. Raised by hectorvent on the review of #5568 and left to its own PR. The evaluator now takes the caller's CallerArns in place of its two ARN strings and writes the keys through that single writer, so no second context has to be kept in step. STS passes the caller it already resolves, and a credential that resolves to no identity is the account root stand-in it already names in its denial, now with the account's own keys: the guide gives the root user the account id as its aws:userid, the type Account and no aws:username, which is what S3 and the enforcement filter already build for it. That construction had three copies and is now one factory on the record. Step Functions passes the execution role as the session it is, carrying AssumedRole as its aws:PrincipalType: it assumes that role on the state machine's behalf, so a target role's trust policy may condition on the type. It mints no session name there, and a session's aws:userid is role-id:session-name, so that key and aws:username stay absent. AssumeRolePolicyEvaluatorTest builds its callers through the record, with three cases on the keys: a condition on aws:username matching the caller and not matching the same caller carrying no keys, aws:PrincipalType and aws:userid telling a user apart from a role session, and a value the caller carries winning over the request's own copy. AssumeRoleTrustConditionsIntegrationTest signs four more AssumeRole calls end to end, over a condition on the calling user's name, on the principal type, on the root stand-in's account id, and on a session's role-id:session-name. Reverting the evaluator to aws:PrincipalArn alone fails all seven; writing the keys with putIfAbsent instead fails the precedence case alone. LambdaTaskAuthorizerTest covers the Step Functions caller from both sides, a trust condition on the principal type matching it and one on the session's own id not matching. |
||
|
|
23e1b3a97c |
fix(dms): list the default replication subnet group (#5771)
* fix(dms): list the default replication subnet group DescribeReplicationSubnetGroups read stored groups only, so filtering on "default" faulted with ResourceNotFoundFault and the unfiltered list omitted the group that replication instances created without one report. Resolve both paths through findReplicationSubnetGroup, which synthesises "default" from the region's default-VPC subnets. * fix(dms): list the default subnet group only once an instance uses it AWS creates the default replication subnet group the first time an instance needs it, so a region with default subnets but no such instance has no default group. DescribeReplicationSubnetGroups now lists and resolves default only while a replication instance in the region was created without a subnet group, and checks that before calling EC2, so an unused default never seeds the region's default VPC. |
||
|
|
e3442de5bd |
fix(rds): serve a CA-signed proxy TLS leaf certificate (#5700)
* fix(rds): serve a CA-signed proxy TLS leaf certificate * fix(rds): renew proxy TLS leaves before expiry * fix(rds): sign proxy leaves with the shared Floci CA Reuse the canonical CA and preserve legacy SAN metadata without loading or modifying the old RDS-only certificate and key. Keep leaf renewal and expiry rejection unchanged. * fix(rds): preserve legacy CA certificate paths Refresh rds-ca.crt from the shared Floci root and remove the unused RDS-only key. Replace the certificate path atomically so legacy links cannot overwrite shared key material, and leave failed initialization retryable. |
||
|
|
4353e4232b |
feat(rds): DescribeDBLogFiles and DownloadDBLogFilePortion (#5741)
* feat(rds): DescribeDBLogFiles and DownloadDBLogFilePortion Both answered UnsupportedOperation, so an instance's log could only be read with docker logs, outside the AWS API. An instance's log is now read from its database container and cut into files the way RDS names them: hourly error/postgresql.log.* files for PostgreSQL, error/mysql-error.log for MySQL and MariaDB, and log/ERROR for SQL Server. DescribeDBLogFiles filters and pages them, and DownloadDBLogFilePortion follows the API reference's marker rules with a 1 MB block cap. Control characters XML cannot carry come back as U+FFFD. In mock RDS mode an instance has no log files. Closes #5733 * fix(rds): bound and validate log file reads A log read now takes the most recent 100,000 lines instead of the whole history, fails when Docker does not finish in time instead of returning part of the log, and, when Docker no longer knows the container, finds or starts the backend once before answering DBInstanceNotReady rather than an empty log. A single line over 1 MB is cut at 1 MB like the rest of the block. Negative FileSize, FileLastWritten and Marker values are InvalidParameterValue; the shared offset paging refuses a negative marker instead of starting over. * fix(rds): close the Docker log stream when a log read times out A timed-out read now closes its callback before failing, so the stream stops and nothing writes into the buffer after the read gives up; the buffer is also written and read under one lock. * refactor(rds): keep portion's Javadoc on portion truncateUtf8 had landed between portion's comment and portion itself. It now follows portion. * test(rds): read log files on the first call, and import class names CreateDBInstance returns once the database accepts connections, so the startup log is already in the container's output. The Docker and SDK log tests now assert on the first DescribeDBLogFiles and DownloadDBLogFilePortion call instead of polling. The timeout test and RdsLogFilesTest import the classes they had written out in full. |
||
|
|
832f1008bb |
feat(lambdaweb): scale environments per endpoint and apply maxEnvironments and rateLimit (#5785)
* feat(lambdaweb): scale environments per endpoint and apply maxEnvironments and rateLimit Each endpoint keeps its own pool of environments, as on AWS. An environment takes up to the revision's maxConcurrencyPerEnvironment requests at once, the least busy one first so requests rotate, and a request that finds every environment full starts another or waits for one that is starting. At maxEnvironments the request gets the 429 page with Platform.EndpointMaxEnvThrottle. A rateLimit admits a burst of up to rateLimit requests refilled at rateLimit per second and refuses the rest with Platform.EndpointRequestThrottle. Both pages were recorded against AWS. Part of #5699 * fix(lambdaweb): key environment pools by endpoint creation and let a new revision take an idle slot A recreated endpoint gets a new domain, so it no longer reuses the environments of the deleted one. At maxEnvironments an idle environment of another revision is stopped to make room. Empty pools are dropped. The burst in the Docker test now arrives at once, so a slow runner still goes past the rate. * fix(lambdaweb): keep the rate limiter clock monotonic and drop refilled buckets A bucket untouched for a second is full, so it is dropped. A clock read that lands behind the bucket no longer takes tokens back. |
||
|
|
3cb1643d30 |
fix(cloudformation): publish content-hashed versions for SAM AutoPublishAlias (#5744)
* fix(cloudformation): publish content-hashed versions for SAM AutoPublishAlias
Point the alias AutoPublishAlias generates at the Version attribute of
the generated AWS::Lambda::Version, as SAM does, instead of $LATEST,
and name that version as SAM names it: <Function>Version plus the
first ten hex digits of the SHA-1 of the function's code, with
template parameters resolved as a Ref or as ${Name} in an Fn::Sub,
merged with its Environment and MemorySize, as sorted compact JSON
escaped the way Python's json.dumps escapes it. Under
AutoPublishAliasAllProperties the hash covers every property floci
gives the function. A string AutoPublishCodeSha256 takes the hash's
place with its first ten characters. As in SAM, the version is
retained (DeletionPolicy: Retain) unless the function says otherwise,
and version properties of the wrong type are refused.
With the alias on the published version, a template change to the
code names a new version resource, which publishes, and the alias
moves to it, while changes made to $LATEST outside the stack no longer
reach the alias. The $LATEST pin worked around #1987 and #1988: a cold
invoke of a published version timed out, and a warm $LATEST container
served version-qualified invokes. Both are fixed on main.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): hash an applied SnapStart into the SAM version id
SAM adds a function's SnapStart to the hash behind the AutoPublishAlias
version's logical id when its ApplyOn is anything but None, so turning
SnapStart on names a new version, which publishes and gets its
snapshot. Without it a SnapStart function got a different id than SAM
gives it, and changing SnapStart published nothing. Under
AutoPublishAliasAllProperties SnapStart is hashed like the other
properties.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(cloudformation): resolve SAM destination types with parameterValue
destinationType repeated the parameter lookup parameterValue already
does for the version hash: the stack's value, else the Default. Use the
one helper. A non-string Default still names no destination type.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* docs(cloudformation): describe the SAM version hash in SAM terms
Reword the comments and test names around the AutoPublishAlias version
id to state what SAM and CloudFormation do, rather than how another
project or language implements it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): hash a null SnapStart ApplyOn and state what it changes
SAM leaves SnapStart out of the version hash only when ApplyOn is
missing or "None"; a null ApplyOn is hashed. The check read a null as
"None".
floci does not pass SnapStart to the function, so turning it on
changes the version's logical id but publishes no new version, and
no snapshot is taken.
|
||
|
|
a2d02ef967 |
feat(core): relay container callbacks to a loopback Floci on a Linux host (#5774)
* feat(core): relay container callbacks to a loopback Floci on a Linux host Containers Floci starts call back through host.docker.internal, which native Linux Docker maps to the bridge gateway (host-gateway, normally 172.17.0.1). Docker Desktop forwards that address to the host's loopback, but Linux does not, so a Floci binary run on a Linux host and bound to 127.0.0.1 (the default) refused every SDK call from a Lambda function, ECS task or CodeBuild build. The documented workaround was to listen on 0.0.0.0 with the exposure consent. BridgeGatewayRelay now listens on the default bridge's gateway address, which belongs to the host but is not routed from the LAN, and pipes each connection to Floci's port on loopback. It runs only on a Linux host outside a container, only while the public listener is on loopback, and only when Docker answers. The quick start says so. Refs #5767 Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(core): relay every port containers call and close cleanly on shutdown Review follow-ups for the bridge gateway relay: - It relays the ports ContainerReachableEndpoint advertises: without TLS the HTTP server's port, which can differ from floci.port; with TLS the proxy's public port plus its AWS-HTTPS port (a failed bind on that privileged port is logged at debug, as the proxy's own is warned once). - It forwards to the loopback address Floci listens on (::1, localhost, 127.0.0.2, ...) instead of always 127.0.0.1. - A shutdown racing the network lookup or a bind closes whatever the startup opens afterwards. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(core): relay only connections that come from a Docker network Linux accepts packets for any of its own addresses on any interface, so a LAN neighbour that routes the bridge gateway address through this host could reach the relay and, through it, a Floci bound to loopback. The relay now reads every Docker network's subnets and relays a connection only when its source lies in one of them; anything else is closed. A source outside the known subnets refreshes the list once, at most every five seconds, so a network created after startup is picked up. Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
167336fc73 |
fix(servicequotas): report the standard EC2 quota default (#5778)
* fix(servicequotas): report the standard EC2 quota default * test(servicequotas): cover paged quotas and account isolation |
||
|
|
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. |
||
|
|
6e01216f88 |
feat(lambdaweb): serve endpoint domains from a Node.js environment per revision (#5760)
* feat(lambdaweb): serve endpoint domains from a Node.js environment per revision A request whose Host is an endpoint's domainName goes over HTTP/1.1 to a container that Floci starts from the revision's S3 code on the first request: public.ecr.aws/lambda/nodejs:24 with the code in /var/task, index.js or AWS_LAMBDA_NODEJS_ENTRYPOINT as the entry file, the node flags and the environment variables AWS sets, ten seconds to listen, SIGTERM and one second when idle, and a fresh environment after the process exits between requests. The forwarded request carries the headers AWS adds and loses the ones AWS drops. The response carries lambda-web-request-id and lambda-web-logstream and streams as the app writes it. Two revisions in revisionWeights split the traffic by weight. The platform pages for an unsupported method, an unknown domain, HTTP/1.0, a server that does not listen, a timeout, a crash and a disabled endpoint are the AWS pages. Part of #5699 * fix(lambdaweb): index endpoint domains and claim only the minted host shapes A request looked its domain up by scanning every stored function across accounts and iterating live endpoint maps outside the function lock. The service now keeps a domain index, filled from storage at start and kept by the create and delete paths, and copies the function under its lock. The data plane claims only hosts shaped like the domains Floci mints, in any case and with any port, so a dotted S3 bucket with a lambda-web label still reaches S3. * fix(lambdaweb): reserve environments against the idle reaper and track exits acquire now reserves the environment under the same lock the idle reaper takes, so a request cannot start on a container the reaper is about to stop. Docker faults in the reaper and in discard are contained so one error does not end the periodic run or skip the removal. The exit watcher records the exit time and arms itself again when its stream drops, and a request that found a dead process is replayed only when that recorded exit came first, never because the container is gone. The unpacked code directory is removed on every path. The container gets the execution role's session credentials when the role exists, and the function account's credentials otherwise, as the Lambda launcher does. * fix(lambdaweb): bound the whole exchange by timeoutSeconds and forward chunked bodies timeoutSeconds is a deadline on the whole request, as recorded against AWS: a response that has not started by then is the 504 page, one that is still streaming is cut, and a slow upload gets its 504 once the body is in, since the edge takes the body before it answers. A body without a Content-Length is sent chunked instead of carrying the client's Transfer-Encoding header. A failure of the upload stream ends the exchange and releases the environment once. * test(compat): probe the unknown Lambda Web domain in the shape Floci mints The data plane claims only hosts shaped like the domains it mints, so the unknown-domain check needs a 16 character id to reach it. |
||
|
|
ae3ff3405a | fix(core): reject colons in region names (#5705) |