* feat(stepfunctions): evaluate the execution role on SQS tasks
Under IAM enforcement an SQS task now requires the execution role to exist
and trust Step Functions, assumes the role its Credentials name, and checks
sqs:SendMessage on the queue as the role it ends up with. LambdaTaskAuthorizer
gains a general authorize() that later integrations map onto through
TaskPermissions; it reads any service's resource policy and accepts resource
* and an S3 ARN's empty account. Lambda, API Gateway and nested tasks keep
their own paths and errors.
TaskScheduled and LambdaFunctionScheduled record taskCredentials when a task
declares Credentials. With enforcement off they are read softly, so a RoleArn
that does not resolve is omitted and the task still runs.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(stepfunctions): let a queue's policy decide SQS task and direct calls
SQS had no resource policy provider, so a task's call to a queue in another account could never be granted. Add one reading the queue's Policy attribute, which IAM enforcement and the task authorizer both read, and build a direct request's ARN from the account its QueueUrl names so the right queue's policy is read.
Credentials read only for history now tolerate only a resolution failure, and the Step Functions integration tests share one client.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
With an explicit zero minimum, drain stale REPLICA tasks whose fixed
published ports conflict with a replacement. Wait for background Docker
cleanup to confirm removal before placing the replacement, including
port-owning security-group helpers.
Keep task protection and failed-deployment guards, remove helpers outside
the firewall monitor, and revoke task credentials even when cleanup fails.
Closes#7523
Centralize fixed host-port selection in EcsContainerManager and use it from both container publishers and scheduler conflict detection. Preserve existing bridge, host, and awsvpc publication behavior.
Validation: 179 focused ECS and firewall tests passed.
An address the subnet picks for a NAT gateway takes a lease on the VPC
network, and DeleteNatGateway never gave it back, so once the gateway was
gone automatic allocation skipped that address. Secondary addresses leaked
the same way, on delete and when an update dropped them.
DeleteNatGateway now gives back the lease of every address the gateway
holds. It reads the gateway once, under the allocation lock, and gives
nothing back for a gateway stored as deleted, whose addresses an earlier
delete already gave back. A secondary-address update gives back the lease
of each dropped secondary, except one the same update names again in a new
slot. Every place in Ec2Service that gives leases back now goes through
one releasePrivateIps helper.
In Ec2ServiceTest, a MockedNetworkFixture replaces the setup the
mocked-network tests repeated, and the older tests that built that setup
by hand use it too.
* fix(cloudformation): store stack policies and return them
* test(cloudformation): remove the stack policy test bucket after use
* fix(cloudformation): apply a stack policy with its stack operation
UpdateStack now stores its policy when the update commits, before UPDATE_COMPLETE is published, and CreateStack when execution starts. A policy-only update no longer leaves its change set FAILED. SetStackPolicy checks the stack state again under the stack lock after reading a StackPolicyURL.
* fix(cloudformation): apply a creation policy when the create is claimed
* fix(cloudformation): keep a rejected policy-only update executable
* fix(cloudformation): assign a stack policy when its change set is created
* test(cloudformation): stop the stack policy test's executor
* test(cloudformation): round-trip stack policies through persistent storage
* test(cloudformation): build the stack policy requests on CfnRequests
* test(cloudformation): construct CloudFormationService through one shared fixture
* fix(cloudformation): refuse a missing or malformed StackName in the stack policy actions
SetStackPolicy and GetStackPolicy looked a missing StackName up as the
stack named "null". Both now validate StackName first, as AWS does,
with the checks ContinueUpdateRollback already applies.
Every EMR cluster runs HDFS: its primary node "also runs the HDFS
NameNode service". In the docker runner mode a cluster's HDFS was a
folder of its /mnt volume behind a view of the hdfs scheme, so an
hdfs:// path naming a host was not served, hadoop fs -ls / failed, and
Hive, which looks up the encryption zone of any hdfs:// path, reached it
under viewfs, where a table at an hdfs:// location failed. Each cluster
now runs a NameNode and a DataNode.
- EmrClusterStorage starts them in a container of their own, from the
release's EMR Serverless Hive image, which has HDFS's daemons where
the release's image has only the client. It runs as root only to add
the primary node's name to its hosts file and give its data volume to
the hadoop user, then runs both daemons as that user, with one copy of
each block and permissions off, and makes /tmp and /user/hadoop once
the DataNode has joined. The data is in a volume of its own, so the
first container to mount the cluster's /mnt volume is still a step's,
which fills it with what the bootstrap actions left there. It is on a
Docker network of the cluster's own, which only the cluster's steps
join besides theirs, as its HDFS serves its files to any client that
reaches it, so another cluster's steps, another account's too, do not.
- The AWS runtime for Apache Spark's releases, emr-spark-8.0.0 on,
publish no Hive image, so their clusters run HDFS from emr-7.5.0's.
Hadoop keeps its client-server protocols compatible across a major
version's minor releases, so their newer client reaches its NameNode.
- A step's thread starts it after the cluster's volumes, from the id
its image's pull, when it is missing, resolves, and waits up to two
minutes from then, the
NameNode on its port its own, the DataNode joined and the NameNode out
of safe mode, as the NameNode's JMX says; a step that comes while
it starts waits, and one that finds it running uses it. A failure
fails the step ("The step could not start: ..."), and one whose
container Docker cannot tell the state of leaves it as it is.
- The daemons log their warnings and errors to the container's output.
- When either daemon exits, the container ends and its readiness goes,
so the next step starts it again on the data its volume keeps; one
that finds it about to stop starts it again once.
- Steps reach it by the primary instance's PrivateDnsName, as
ListInstances gives it, on port 8020: their containers resolve that
name to the HDFS container's address, and fs.defaultFS names it, so
hdfs:// paths without a host and paths without a scheme lead there.
ListInstances numbers the MASTER group's instance first, so the name
holds while other groups resize.
In a namespace the steps share, the host's or another container's,
which the HDFS container joins too, they reach it on its loopback, and
its daemons listen there only, so no other interface serves its files,
which any client could change; one cluster's HDFS runs there at a
time, another's refused while it does. One a process with another
docker-network left running, in another namespace than the steps', is
started again in theirs on its data. With none, steps have no network,
so the cluster runs no HDFS.
- Hadoop's local job runner copies a job's -files to
/tmp/hadoop/mapred/staging on the local file system, then looks for
them at that path of the default file system, as JobResourceUploader
drops the folder's scheme. So in the hadoop command's configuration,
which a custom JAR's MapReduce in the driver reads too, the hdfs
scheme is a view of the cluster's HDFS in which that one folder is
the container's own. Spark and Hive keep HDFS's own client, as Hive
casts an hdfs:// file system to it to look up its encryption zone,
so a Spark step writes a Hive table in HDFS too.
- A reset or a shutdown removes the HDFS containers this process
started, found running or kept from an earlier process, after the
drivers that use them are stopped, and a step or a bootstrap handed to
its thread before it, however it then ends, starts no HDFS, driver or
successor after it but is left as one whose driver was stopped, and
none is handed to a thread until the reset is over; a container Docker
refuses to remove stays known for the next; a cluster's next step
starts its HDFS again on the data its volume keeps. The container and
its network go with the cluster's storage, and the startup sweep
removes those of clusters that are gone or have ended.
Every cluster now needs a Hive image, so the documentation of
image-template and hive-image-template says a mirror sets both.
The Docker-gated tests now cover a Hive table at an hdfs:// location, a
bootstrap action's file in /mnt, a structured streaming query keeping
its checkpoints in HDFS, a Spark step writing a Hive table there, hadoop
fs -ls /, and a DataNode that exits, after which the next step reads an
earlier step's file. The CI prefetch queues the Hive image for
EmrDockerRunnerDockerIntegrationTest's shard too.
SqsQueueUrlRouterFilter only matched /{account}/{queue}, so SQS requests posted to the queue path with a trailing slash or to a /queue/{region}/ prefixed path fell through to the S3 object handler and failed with InvalidArgument. Like AWS, route JSON requests on either form, since they name the queue in QueueUrl, and route Query requests only on /{account}/{queue}, with or without a trailing slash. Never reroute S3 object POSTs, which always carry uploads, uploadId, restore or select.
Closes#7521
Match observed HTTP listener DescribeListenerCertificates responses by omitting the absent Certificates list. Preserve configured HTTPS certificates and cover both Java SDK and XML response shape.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
The Query protocol numbers a list's members rather than ordering them, and the constraint walk
reads every index a request names. The handler read a run from 1 that stopped at the first gap, so
the two halves disagreed about what a request carried: a request numbering tags 1 and 3 was held to
both tags and then stored the first alone, and a simulator whose first action is numbered 2 answered
`At least one ActionNames member is required.` for a list that had a member in it.
Every list and map `IamQueryHandler` reads now goes through `AwsQueryLists.members`, the same call
with the same arguments the constraints read them with: tags and tag keys with the count each is
held to, the two generic value readers, which had the same body once both read indices and are one
reader now, the context entries at both of their levels, and the `Properties` map of
`PutAccountProperties`. The last site was the reader a delegation request's policy parameters had to
themselves, which read its indices but only in the generic spelling: those parameters take the bare
form with it, and the handler reads a list in one place rather than three.
A member numbered only under a deeper key carries no value of its own and is no member of a list of
values, and a tag or a property numbered with a value and no key is nothing a map could hold, so
neither is counted nor stored.
The tags a create is authorized with are read the same way. `TagOnCreate` says how each Query
handler numbers a create's tag list, so the policy is checked with the tags the resource will get,
and it had IAM reading `Tags.member` to the first gap, as this handler did. On its own this change
would have left the authorizer reading a different list than the one stored: a tag numbered only at
2 met no policy requiring it, the model saying the handler applies none, and tags split across the
two spellings were a set each, where a deny naming both keys matched neither.
IAM reads there by the rule the handler reads by, rather than by a copy of it: the member comes from
the generated tag-on-create table and the spellings from `AwsQueryLists.memberKeys`, so no spelling
is written twice and a later change to that rule moves both sides at once. The handlers that number
a list their own way keep their own readings, untouched.
Seventeen wire tests over four classes, one for each reader, one for each spelling it missed, and
three holding the authorization. The provider one deletes what it creates: the emulator is shared
between test classes, so the next class to list providers unscoped would read it. Fifteen of them fail against the readings this replaces. The
reading is recorded in `docs/services/iam.md`, in the list section and beside the account properties
map.
storeVersion (the one write path storePackageVersionAsset/copyPackageVersionAsset/
storeRetainedVersionAsset all go through) always sent dist-tags.latest pointed at
whichever version it was writing, so copying or retaining any other version,
even an old one, silently moved what an unpinned npm install resolves to.
Confirmed live against the pinned Verdaccio image that this was never actually
needed: a PUT that omits dist-tags entirely leaves an existing package's own
dist-tags.latest untouched, while a package's genuinely first-ever version still
gets it set by Verdaccio's own default (there is nothing yet to preserve). So
this write simply stops sending the field at all, rather than needing its own
"is this the right version to call latest" decision.
Corrected two test comments that had over-generalized this as "no retention
write can ever suppress it" to the narrower, now-verified truth: only a
package's very first-ever version is forced.
Also confirmed live, specifically because CopyPackageVersions' own overwrite
path deletes a conflicting version before recreating it (clearing dist-tags.latest
if it pointed there): Verdaccio auto-recomputes latest from whatever versions
remain once it's cleared, rather than leaving the package tagless, so this
write's own change plays correctly with that existing delete-time behavior.
Added a live regression test for exactly that interaction (overwriting the
current latest version while a sibling version exists must neither lose latest
nor wrongly hand it back to the version just overwritten).
A member the table locates in a REST request's path or query was laid
over a JSON body alone: a request sending a form skipped the overlay,
so a form's DomainName was read in place of the path's. OpenSearch
answers a form with 415, so no such request reaches its handlers
today, but the next REST namespace the table reads whose handler does
not refuse a form would be checked on the form's name while it acts on
the path's.
RequestResources now lays the located members over a form as it lays
them over a JSON body, for the resources a request names and for those
it creates: each is dropped from the form and read from the path or
the query alone.
RequestResourceMembersTest checks every resource of the table from a
form as from a JSON body, each located member given in the path or the
query and another value in the body and in the form; RequestResourcesTest
sends OpenSearch requests as forms naming another domain than the path
or the query does. iam.md says so.
* fix(memorydb): restore persistent cluster runtimes after restart
Restore account-scoped cluster backends, authentication and stable proxy endpoints from persisted metadata. Retain data storage across restart and preserve retryable ownership on failed provisioning cleanup.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(memorydb): retain default backend and log names
Keep default-account/default-region container and engine-log names stable while retaining scoped runtime and proxy keys. Pass the logical name and stored owner through creation, restoration, deletion and rollback. Use an unambiguous separator for foreign Docker names in the retained hyphen-prefix collision case, without changing foreign log names or persisted volume identities. Preserve restore and cleanup coverage; new naming regressions fail the former manager. Local mocked-Docker and loopback RESP qualification only, no managed AWS or native runtime claim.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(memorydb): share container naming fixtures
Move the two naming cases into MemoryDbContainerManagerTest and reuse its manager setup. Share the four loopback PONG responders through one helper, observing completion and propagating responder failures. Preserve naming, collision, cleanup and lifecycle assertions. No production change.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
The '*' selector was missing from SqsMessageAttributeSelector.includes(),
so ReceiveMessage with MessageAttributeNames: ["*"] returned no
message attributes. AWS treats '*' the same as 'All' and '.*'.
- Add '*' to the includes() check
- Add '*' to the test loop that already covers 'All' and '.*'
Closes#7503
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
A failed stack update left AppSync entities changed or cleared by the update:
the provisioner had no rollbackUpdate, so the stack ended in
UPDATE_ROLLBACK_FAILED with "Rollback is not implemented".
Before an in-place update of a GraphQL API, data source, function, resolver or
API key, the provisioner records the members the update can change or clear.
The service applies an update member by containsKey, so replaying them puts
back both the changed and the cleared values. An update that fails part way
undoes itself through CfnRollback.guarded, and a failed undo keeps the
snapshot for ContinueUpdateRollback.
GraphQLSchema and a replaced AppSync resource are not covered.
tagResource, untagResource and putEnvironmentVariables change the stored API in place while updateGraphqlApi saves a copy, so a copy could overwrite a tag or variable written in between. Every method that writes a store now holds the service monitor, as startSchemaCreation does, and startSchemaCreation checks the API under it too. refreshGraphqlApiUris refreshes the stored API under the monitor instead of putting the instance it read earlier.
Every request and every response wakes a relay thread blocked on a socket
read. On a virtual thread that wakeup goes through the JDK poller and a
carrier handoff, which made the relay itself cost about 0.13 ms per
roundtrip in one Docker network (0.063 ms direct, 0.198 ms through the
proxy). The relay loops of the PostgreSQL, MySQL and opaque TCP bridges now
run on daemon platform threads; the accept loop and the handshake stay
virtual.
The IAM session guard read each backend message's type, length and payload
straight from the socket, plus an available() call per message. Its input
is now buffered, and the flush-on-pause check asks the socket only once the
buffer is drained.
A MySQL or MariaDB client that disconnects without COM_QUIT ended the
client-to-backend relay but left the backend-to-client relay blocked on a
backend that never speaks, and bridge() waited for both before closing
either socket. Close both sockets as soon as either relay ends, as the
PostgreSQL bridge already does, so a dropped client no longer holds a relay
thread and a backend connection open.
Returns a console log carrying the instance's SSH host public keys between the markers cloud-init prints, read from the running instance container, so clients can verify the host before connecting. An instance without a running container has an empty log.
Look the instance up in the request's region, read host keys only from a running container and treat a failed read as an empty log, build the response with XmlBuilder, and cover the SDK reading of the response.
AWS returns DryRunOperation for DryRun=true even for an empty or malformed instance id, so check the dry run first.
The key files are the guest's to write, so capture at most 16 KiB of stdout (and 1 KiB of stderr) through bounded streams, and answer an empty log, with a warning, when the output is larger than host keys can be.
* fix(cognito): offer configured providers in managed login
Preserve native authentication eligibility and request parameters for federated-only and mixed clients.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(cognito): explain unavailable sign-in providers
Show an actionable managed-login error after every provider is removed, without enabling native credentials.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Populate existing instance types with AWS-verified manufacturer values and expose them through DescribeInstanceTypes. Add SDK regression coverage for all 84 catalog entries.
Closesfloci-io/floci#7516
The controller read path parameters from the decoded JAX-RS path and
substituted them into the integration URI, so a path with an encoded space
threw from URI.create and answered 500 without reaching the backend. An
encoded ? or # cut the backend path short, %2F became a separator and %252F
lost a level of encoding.
Read the target URL's path parameters from the raw request path, for REST
HTTP_PROXY, REST HTTP and HTTP API HTTP_PROXY integrations. A value mapped
from elsewhere is percent-encoded. $request.path.X and header mappings keep
the decoded value. An integration URI that cannot be parsed now answers 502.
Routes match on the decoded path, so an encoded slash ahead of a parameter
shifts the segments read off the raw path. /a%2Fb/c/d on /a/b/{proxy+} called
the backend with /backend/d. A raw value that does not decode to the decoded
parameter is now ignored, and the decoded value is encoded instead. Comparing
values rather than literal segments also covers templates with no literals,
such as /{x}/{y}/{z+} and the HTTP API route /{x}/{y+}.
* fix(dynamodb): check the condition members of a PutItem or DeleteItem in order inside the validation envelope
* fix(dynamodb): reuse the expression member helper in the older PutItem and DeleteItem check
The table of request resources read only a request's body or Query
form, so no REST namespace was read: a REST request names its
resources in its path and its query. An OpenSearch Service request
naming its domain, DescribeDomain on
/2021-01-01/opensearch/domain/{DomainName}, was left unchecked by the
routes the previous change reads, as Floci could not check it on the
domain AWS checks it on.
- The generator reads a rest-json request's members in its path and
its query as members, under their botocore names, and records where
each one a resource reads is (`located`): a path label, `{Label}`, or
a query parameter, `?name`. RequestResources lays them over the body,
a label's value from the route the request matched in the vendored
routes (IamActionRegistry.pathLabels, IamRestRoutes now capturing
each label), a query parameter's from the query, so every kind of
resource reads them as it reads the body's. A located member is read
from where it is alone, as its handler reads it: one the body also
gives is dropped.
- A namespace read this way also takes the operations of each botocore
model Floci reads routes for under it (regen_rest_routes.MODELS) that
the reference lists for none of its clients, each the action of its
own name with that action's resource types, when the reference has
that action: the reference lists OpenSearch Service's `es` client
alone, while the `opensearch` client's operations are named after
`es` actions. --verify checks such an operation's action and types
against the reference's Actions, and reports one whose action AWS no
longer has.
- `es` moves from NOT_COVERED to NAMESPACES: 120 operations, both API
versions', 1505 over 34 namespaces. Every domain route Floci serves
reads its domain, from the path, the body or `?arn`, on
`domain/<DomainName>`, the ARN Floci mints. Those whose resource the
table does not find (outbound connections, applications, insights)
are routes Floci does not serve.
- Reading rest-json would also have read the Payment Cryptography data
plane's key from its path; Floci serves only the control plane, so
`payment-cryptography-data` joins CLIENTS_NOT_READ with its reason
and its operations stay as they were. No other entry changes.
With the domain operations in the table, the routes check them by the
resources-read half of the join rule. IamActionRegistryTest checks the
domain routes and the labels a request's path gives;
RequestResourcesTest reads a path label, a query parameter and a body
together; IamRestRouteEnforcementIntegrationTest checks DescribeDomain,
DescribeElasticsearchDomain and ListTags on the domain they name; the
generator tests cover the located members, a member two clients locate
apart, the REST models' operations and a round trip through --check and
--verify. iam.md says so.