Commit Graph
5165 Commits
Author SHA1 Message Date
Priamo Germosen 39fbc98efe feat(eks): give the cluster node instance its primary network interface (#9273)
An EKS node's primary network interface carries the cluster security
group, and the AWS Load Balancer Controller reads both from the node's
instance: it finds the interface behind a pod address there and opens
the target's ports on that group. Floci's node instance had neither.

A node holding an address in its subnet now has a primary interface
there, at that address, holding the cluster security group, and the
instance holds the group too. A node without one, whose address is then
its container's on another network, has no interface. DescribeInstances
reports them, and DescribeNetworkInterfaces lists the interface as it
lists an instance's launch-created one, with the same filters. Its ids
derive from the cluster, so they survive a restart.
ModifyNetworkInterfaceAttribute and the IPv6 address calls on it are
refused with OperationNotPermitted, as the node's lifecycle actions are,
and the cluster security group cannot be deleted while the node holds
it.

EC2 keeps a copy of the node once an action such as
ModifyInstanceAttribute is stored. The copy now keeps only what such
actions change: its interfaces are its own, so a change no longer
reaches the record the cluster serves, and the node's address, subnet
and interfaces follow the cluster, which may replace the node. The copy
is stored only while the cluster serves the node. Deleting the cluster
ends the node in EC2 as terminating it would: the copy is dropped, and
volumes attached to the node are detached, or deleted when their
DeleteOnTermination is set. Otherwise the copy would stay a running
instance holding the cluster security group, and the volumes in use.

Part of #5929
2026-11-23 11:04:27 -04:00
Priamo Germosen 4897db0bad refactor(iam): drop the empty HAND_BUILT list and the reader's hand-built check (#9272)
With IAM read from the generated tables, no namespace is built by hand and
HAND_BUILT is empty. Remove it from the request-resources generator (the
tuple, the file's handBuilt key, and the clauses reading a hand-built
namespace's operations only where MEASURED gives them) and from the reader
(RequestResources.builtByHand, the parsed table's handBuilt set, and the
clauses of readsNamespace and IamActionRegistry.checkedAsAws that asked it).

Every operation's resources are unchanged: the generator's offline check
regenerates the same file, without the empty key.
2026-11-23 11:03:51 -04:00
Priamo Germosen 86ef90b99c feat(emr-containers): cull a managed endpoint's idle kernels by its jeg-config (#9275)
An endpoint's configurationOverrides take "the additional
classification jeg-config", whose allow-listed settings are
RemoteMappingKernelManager.cull_idle_timeout and
RemoteMappingKernelManager.cull_interval (EMR on EKS Development
Guide, "Jupyter Enterprise Gateway (JEG) configuration options"). A
Floci endpoint's gateway read neither.

- The gateway job passes those two properties of the endpoint's
  jeg-config classification to the program as its arguments
  (--RemoteMappingKernelManager.cull_idle_timeout=<value>), a later
  classification's winning; other jeg-config properties go nowhere.
- The program's kernel manager is now named RemoteMappingKernelManager,
  as Jupyter Enterprise Gateway's is, so the settings reach it under the
  names the guide gives them, and jupyter_server's culler shuts down a
  kernel idle that long, checking every interval.
- EmrContainersSparkJobs.properties reads any classification of a
  configurationOverrides, sparkDefaults now through it.
- The nightly check gains a method: an endpoint whose jeg-config sets a
  10-second idle timeout culls a python3 kernel left idle within a
  minute. The docker-runner group's budget grows by its seven minutes.
2026-11-23 10:47:51 -04:00
Kenshin Okinaka 7b2e60cfe0 fix(ses): check the template name of a send as SES does (#9271) 2026-11-23 10:36:52 -04:00
Priamo GermosenandJeremy Chapeau 64f74c6bc4 feat(iam): record IAM API calls in CloudTrail (#9263)
CloudTrail logs every authenticated IAM API request, but Floci recorded
none, so a trail showed no user, key or policy change. Each IAM call now
reaches the logging trails that select it as a management event: the
calls IAM runs, the ones it answers with an error, and the ones IAM
enforcement refuses. requestParameters carries the request's members as
the IAM model types them, responseElements the result of a call that is
not read-only, without sensitive members, and the record carries the
caller's address, read through RequestSourceAddress, and user agent. An
error IAM models is recorded under its error shape's name
(NoSuchEntityException). A refusal, on IAM's policies or because a
GetSessionToken session without MFA cannot make the call, is recorded
as AccessDenied with "requestParameters": null and the message and
request ID of the response the caller receives. The caller is read
before the call runs, so a key that deletes itself is recorded as its
user's, and every call reaches the account's event history whether or
not a trail records it. Basic selectors' ReadWriteType now matches a
management event's readOnly.

IAM is a global service, so only a trail with IncludeGlobalServiceEvents
records its calls, as botocore's CloudTrail model says of the setting.

Which calls are read-only is generated from the Service Reference into
iam-action-resources.json (readOnlyActions). How members are named,
typed and redacted, and each error's shape name, are generated from
botocore's IAM model into iam-cloudtrail-shapes.json through
request_shapes, the walk every vendored shape file shares, which now
keeps an operation's result and its wrapper, the sensitive flag and the
modeled errors when a generator asks for them. Both files are checked
by make aws-data-check.

The integration test reads the trail's log files through
CloudTrailLogFiles, calls CloudTrail through CloudTrailRequests, both
now in io.floci.aws.testing with an Authorization a test under IAM
enforcement signs with, and calls IAM through QueryRequests.

Closes #9013

Co-authored-by: Jeremy Chapeau <jeremy.chapeau@gmail.com>
2026-11-23 10:35:36 -04:00
TATSUNO “Taz” Yasuhiro 946d1392a5 feat(dynamodb): accept range, IN, OR and NOT in SearchVectors conditions (#9257)
SearchVectors now accepts ranges, <>, IN, attribute_exists, attribute_not_exists, OR and NOT on INLINE_FILTER attributes, with ranges and BETWEEN on Number attributes only. The HASH attribute still takes one = condition reached through AND only. Each refusal names the broken rule with DynamoDB's message, in DynamoDB's order.

FilterExpression and ConditionExpression now refuse an attribute_exists or attribute_not_exists with more than one operand or without a document path.

The attribute type lookup moves to TableDefinition.attributeType, replacing the copies in DynamoDbService and DynamoDbAccessPathValidator.
2026-11-23 10:19:49 -04:00
Priamo Germosen b57b55025a feat(emr-containers): run %%configure on a managed endpoint's PySpark kernel (#9262)
EMR Studio's "Modifying PySpark session parameters" has a PySpark
kernel's %%configure "adjust the Spark configuration associated with a
PySpark session"; the endpoint's operations count it as ConfigureKernel
("Monitoring interactive endpoints"). A Floci endpoint's PySpark kernel
had no such magic.

- The PySpark kernel loads the image's own magic, configure_magic.py,
  beside Jupyter Enterprise Gateway's kernel launchers. It turns its
  cell's settings into KERNEL_EXTRA_SPARK_OPTS, refusing reserved ones,
  and posts them with the replies that end the cell to
  localhost:18888/api/kernels/configure/<kernel id>, signed with the
  AES key in its ADDITIONAL_INFO.
- The gateway program's kernel manager gives each kernel its KERNEL_ID
  and an AES key of its own, as the image's launcher does, keeps its
  launch environment, and drops an ENDPOINT_IP the endpoint's Spark
  defaults would pass on, which would send the magic elsewhere.
- The program serves port 18888 on the container's loopback alone: for
  a post signed with the kernel's key, it restarts the kernel, keeping
  its id, with the new KERNEL_EXTRA_SPARK_OPTS in place of the old, and
  once the restarted kernel answers, sends the prepared replies to the
  clients connected to it, as the restart takes the kernel down before
  it can. A kernel that dies first, or does not answer in
  jupyter_server's restart time, ends the cell with an error instead.
  A kernel's posts take their turn.
- The nightly check runs a %%configure cell, then reads the restarted
  kernel's Spark settings. Its timeout and the docker-runner group's
  budget grow by its four minutes.
2026-11-23 10:19:11 -04:00
galsuchetzky-act 319d96db30 refactor(firehose): remove unused constraint formatter (#9266)
S3DestinationValidator.constraintSet(String) lost its last caller when the mapping checks moved to SmithyValidationErrors.constraintSet in #9256.

Closes #9265
2026-11-23 10:08:11 -04:00
mrfelek 16c2505a25 feat(eks): turn EKS Auto Mode on and off with UpdateClusterConfig (#9264)
UpdateClusterConfig accepts computeConfig, storageConfig and kubernetesNetworkConfig.elasticLoadBalancing together as one AutoModeUpdate family. The cluster stores the result for DescribeCluster, and the update is recorded for DescribeUpdate and clientRequestToken replay.

A member the request omits keeps its stored value, and the request is checked against the configuration it leaves: the three capabilities on or off together, node pools named with a node role, the node role unchanged while compute stays on, and a request that changes nothing refused with "No changes needed for EKS Auto Mode configuration provided". An omitted node role keeps the stored one, so {"enabled": true, "nodePools": []} turns off the built-in node pools as in the AWS user guide.

Other kubernetesNetworkConfig and elasticLoadBalancing members, gatewayApi among them, are refused as unsupported. A null node pool is refused on CreateCluster and UpdateClusterConfig instead of failing with a server error.

Part of #8914.
2026-11-23 10:06:24 -04:00
glorfindel33 44988ca51b refactor(s3): keep the KMS key-id rule in one place (#9261) 2026-11-23 09:54:52 -04:00
Priamo Germosen 3f2cd7198e feat(emr-containers): list only the kernels a managed endpoint's session token started (#9251)
A managed endpoint's gateway listed every kernel it ran to any session
token, where ListKernels is "Request that the interactive endpoint list
the kernels that have been previously started using the same session
token" (EMR on EKS Development Guide, "Monitoring interactive
endpoints").

- The proxy passes the gateway the SHA-256 of the token a request
  carries, in a header of Floci's own, in place of the token, and drops
  one the client sent.
- The gateway program's kernel manager records the digest a kernel was
  started with, whether the kernels API or the sessions API started it,
  and drops the record when the kernel goes, whether a request, the
  culler or the kernel's death removes it.
- GET /api/kernels answers with the kernels started with the request's
  digest alone, and GET /api/sessions with the sessions holding them.
  Any of the endpoint's tokens still reaches a kernel or a session by
  its id, as the guide scopes only the listing.
- The nightly check starts a session beside its PySpark kernel, lists
  both kernels and the session with the token that started them, and
  nothing with another token of the endpoint.
2026-11-23 08:42:02 -04:00
galsuchetzky-act 711d9ea887 refactor(common): share remaining map key messages (#9256)
Builds the remaining hand-written map key constraint messages with
Violations.mapKeys: Firehose mappings, SES v2 filters, both Lambda Web
key checks, Lambda tags and IoT authorizer token signing keys. The
messages are unchanged.

Closes #9255
2026-11-23 08:28:48 -04:00
Priamo Germosen a4b2f01713 feat(iam): read IAM from the generated tables, its paths, signing user and renames from the user guide and API reference (#9252)
IAM is read from iam-request-resources.json now, and ResourceArnBuilder's
IAM branch, the last hand-built namespace, is gone: HAND_BUILT is empty.

What botocore and the Service Reference do not say comes from the IAM
User Guide's identifiers and the IAM API reference, vendored by
fetch_iam_identifiers.py into tools/aws/sources/iam-identifiers.json and
read under PERMISSION_SOURCES.

- A user, group, role, instance profile or server certificate a request
  names by its name is checked on the ARN IAM stores it under, path
  included (IamStoredResourceArns.find), and one IAM does not hold on its
  name under the root path.
- A create is checked on the name its request gives after the Path it
  gives (path), as the identifiers say the API's creates take one.
- UpdateUser, UpdateGroup and UpdateServerCertificate are also checked
  on the resource under its new name and path (renames), as their API
  reference says the caller needs permission on both.
- The twenty operations whose API reference says they act on the user
  signing the request when it leaves out UserName, and ChangePassword,
  are checked on that user (signer), which the new
  StoredResourceArns.signedBy hook gives for the signing key.
- A virtual MFA device is named by its SerialNumber, which the API
  reference gives as its ARN; the access key, SSH public key and
  service-specific credential operations name the user owning what they
  name, and GetServiceLinkedRoleDeletionStatus the role its task
  deleted (IamStoredResourceArns.through).
- MEASURED gives UpdateDelegationRequest, which the Service Reference
  does not list, the request its DelegationRequestId names, citing its
  API reference ("that owner gets a default permission to update the
  delegation request") and the user guide's temporary delegation page.
- CreateServiceLinkedRole is checked on role/*, CreateDelegationRequest
  on delegation-request/* and CreateOpenIDConnectProvider on *, as the
  table gives them. CreateOpenIDConnectProvider refuses an
  IdentityCenterInstanceArn that is not the ARN of an IAM Identity
  Center instance, with InvalidInput.
- Bedrock's ListTrustedAccessPrograms is checked as
  bedrock:CallWithBearerToken, as the Service Reference now authorizes it.
2026-11-23 08:23:04 -04:00
Vũ Thế Huy dee5f3c59b fix(redshift): resolve unqualified external functions through the session search_path (#9196) 2026-11-23 08:22:53 -04:00
Priamo GermosenandJeremy Chapeau f093a0bc6e fix(cloudtrail): take sourceIPAddress from the connection (#9254)
CloudTrail's sourceIPAddress is the address a request was made from.
Floci took it from the first X-Forwarded-For entry whenever a request
carried one, so any client could choose the address its S3 calls, and
the S3 calls IAM refused, were recorded from. It now comes from the
connection, read in one place, RequestSourceAddress, which the S3
controller and the IAM enforcement filter both call. Behind a reverse
proxy, Quarkus's proxy settings (proxy-address-forwarding,
allow-x-forwarded, trusted-proxies) make the address a trusted proxy
forwards the source address, and only that proxy's. Quarkus takes the
first address in X-Forwarded-For, so the CloudTrail page says the proxy
must replace a client-sent header rather than append to it.

The integration test reads the trail's log files through
CloudTrailLogFiles, which follows the listing across pages, and calls
CloudTrail through CloudTrailRequests, which the CloudTrail tests that
kept their own copy of that call now use too.

Closes #9116

Co-authored-by: Jeremy Chapeau <jeremy.chapeau@gmail.com>
2026-11-23 08:10:52 -04:00
Priamo Germosen b521ee513c feat(eks): store the cluster upgrade policy and update it through UpdateClusterConfig (#9253)
CreateCluster dropped upgradePolicy, DescribeCluster never returned
one, and UpdateClusterConfig refused the member, so Terraform's
aws_eks_cluster with upgrade_policy showed a diff on every plan that
no apply could fix.

CreateCluster now stores upgradePolicy.supportType, EXTENDED when the
request names none, as EKS gives new clusters extended support, and
DescribeCluster returns it. A cluster stored before reports EXTENDED
as well. UpdateClusterConfig takes upgradePolicy as an update type of
its own and answers with a Successful UpgradePolicyUpdate whose
UpgradePolicy parameter holds the policy as JSON, as AWS records it.
A repeated clientRequestToken is matched against it like the other
families, and an unknown support type is refused with
InvalidParameterException.

STANDARD is refused, in AWS's words, for a version past its end of
standard support: on CreateCluster, and on UpdateClusterConfig, which
turns extended support on at any time but off only in standard
support. The end of standard support of each version Floci serves
comes from the Amazon EKS Kubernetes release calendar. A cluster that
named no version counts as in standard support, as the version AWS
gives it is.

AWS::EKS::Cluster creates the cluster with its UpgradePolicy and
updates it in place. A dropped UpgradePolicy returns the cluster to
EXTENDED, a stack rollback restores the policy, and a cluster a stack
created before this gets the policy its template declares on the
stack's next update.

Closes #5640
2026-11-23 08:07:04 -04:00
Matheus Oliveira 8a9fa27575 feat(route53resolver): list resolver DNSSEC configs (#9040)
ListResolverDnssecConfigs answered UnknownOperationException, which broke
the Terraform DNSSEC resource right after UpdateResolverDnssecConfig
succeeded: the provider waits for the resource by listing the
configurations. The service now returns the region's DNSSEC configs under
the documented ResolverDnssecConfigs member, leaving out disabled ones as
the model says.

The list matches its Filters the way ListResolverRules does and pages by
MaxResults (1 to 100, defaulting to 100) and NextToken, refusing an
invalid token with the modeled InvalidNextTokenException. The filter and
paging checks are one helper each, shared with ListResolverRules and
ListTagsForResource.

Closes #9012

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-11-23 07:37:50 -04:00
glorfindel33 c15e1e26ce fix(s3): take the bucket's default encryption when a multipart upload is created (#9212) 2026-11-23 07:17:02 -04:00
galsuchetzky-act bf68a01fc2 refactor(common): share map value constraint messages (#9242)
Adds Violations.mapValues beside mapKeys and builds the map value
constraint messages of AgentCore, SES v2, Firehose and Lambda with it.
The Bedrock tag rules drop the unreachable null branch, and AgentCore
keeps its null-key error at its own boundary. The messages are unchanged.

Closes #9241
2026-11-23 07:03:04 -04:00
mrfelek bc3a7aaaaf fix(cloudformation): tag Redshift clusters and parameter groups by ARN, and keep a subnet group's Tags (#9240) 2026-11-23 06:44:45 -04:00
TATSUNO “Taz” Yasuhiro 3c4efe43bf fix(dynamodb): measure UpdateExpression size by target names and values (#9237)
DynamoDB no longer charges a fixed cost per UpdateExpression clause.
UpdateItem caps the finished item at exactly 409,600 bytes, key
included. It also refuses a statement whose SET and ADD actions add up
to more than 409,600 bytes. Each action counts the names in its target
path and every value its operand uses, once per use. REMOVE, DELETE,
operand paths, functions and operators count nothing.

TransactWriteItems applies the same statement check to an Update and
answers a top-level ValidationException, as it does for an oversized
Put. Every member's table is looked up first. Then the members are
checked in order. A Put checks its item size, then its key. Other
members check their key, then an Update checks its statement size. All
of this comes before the duplicate item check and before any condition.
2026-11-23 06:44:21 -04:00
mrfelek 272f3f8435 fix(redshift): refuse deleting the default parameter group, and a parameter or subnet group a cluster uses (#9233) 2026-11-23 06:40:42 -04:00
Priamo Germosen 29e262e783 feat(emr-containers): run a managed endpoint's Jupyter Enterprise Gateway (#9232)
An EMR on EKS managed endpoint ran nothing: it was ACTIVE at once with no
serverUrl, so no Jupyter client could start a kernel on it, and its
session tokens opened nothing.

- With runner-mode docker, an endpoint runs a Jupyter Enterprise Gateway,
  which "provides the remote kernel lifecycle management capability that
  interactive clients need", in a container of its release's
  notebook-spark image on Amazon ECR Public, the base image of
  interactive endpoints. That image holds jupyter_server and ipykernel but
  no Enterprise Gateway, so a program of Floci's own serves the gateway's
  kernels API on jupyter_server, passing a kernel the KERNEL_ variables
  of its start request's env, as Jupyter Enterprise Gateway does.
- Its kernels are the image's python3, and spark-python-kubernetes, whose
  spark and sc are a Spark session in Spark's local mode on Floci's S3,
  with the endpoint's execution role, KERNEL_EXTRA_SPARK_OPTS going to
  its spark-submit.
- The endpoint is CREATING until the gateway answers, then ACTIVE with
  its serverUrl and the guide's "Endpoint created successfully. It took
  m Minutes s Seconds". DeleteManagedEndpoint makes it TERMINATING until
  the gateway has stopped. A gateway that fails, and one a restart left,
  end it TERMINATED_WITH_ERRORS with INTERNAL_ERROR.
- serverUrl is a path of the endpoint's own on Floci's port. A request
  there goes on to the gateway, its kernels' WebSocket tunnelled, when it
  carries a live token GetManagedEndpointSessionCredentials gave for that
  endpoint, as a token parameter or an Authorization: token header, as
  Jupyter Enterprise Gateway 2.6.0 takes one; any other gets that
  gateway's 401 {"reason": "Unauthorized", "message": ""}.
- SessionServers, which runs EMR Serverless's and EMR's Spark Connect
  servers and keeps their tokens, runs the gateways too, a token given
  for one endpoint reaching no other. CloudFront's WebSocket splice moves
  to WebSocketUpgrades, which the gateway's tunnel shares.
- gateway-image-template replaces the notebook image's registry.
2026-11-23 06:39:56 -04:00
Kenshin Okinaka 2f652f3f87 refactor(ses): move the raw message parsing into the mime package (#9239)
SesRawMessage now owns decoding a RawMessage.Data blob, the single
parse the send path shares, and the headers read off it. SmtpRelay
keeps only the relay itself and calls the shared helpers.
2026-11-23 06:39:26 -04:00
Priamo Germosen 3a1ea212f0 feat(iam): read DynamoDB from the generated tables, its statement and item permissions from the developer guide (#9235)
DynamoDB is read from iam-request-resources.json now, and
ResourceArnBuilder's DynamoDB branch, the registry's PartiQL action,
the condition resolver's mapping of transaction items and statements to
actions and Step Functions' copy of all three are gone, leaving iam in
HAND_BUILT.

Which action each transaction item and each PartiQL statement is
checked as comes from the developer guide, vendored by
fetch_dynamodb_permissions.py into
tools/aws/sources/dynamodb-permissions.json and read under
PERMISSION_SOURCES: the PartiQL IAM page's required permissions and the
transactions page's paragraph on each kind of item.

- Each transaction item is checked as the action of its kind on the
  table its TableName names (TransactItems[].Put.TableName as
  dynamodb:PutItem), each PartiQL statement as the action of its verb on
  the table or index it names, an EXISTS statement as the SELECT it
  evaluates, which DynamoDB's own parser reads through the new
  StoredResourceArns.statement hook before it binds the request's
  parameters. A request naming nothing is checked as its own action on
  *; a state machine's task naming nothing is left to DynamoDB, as
  before.
- RequestResources.targets replaces checkedAs: each element of a list is
  read apart and returned with its check, so the condition resolver
  still gives each item or statement its own keys and
  dynamodb:EnclosingOperation.
- BatchGetItem and BatchWriteItem name their tables by the keys of
  RequestItems, which the generator reads from botocore (RequestItems{}).
- RequestResourceMembers reads Name{}, Name[].Item.Field and statement
  rows (statement, verb, names).
2026-11-22 22:04:18 -04:00
TATSUNO “Taz” Yasuhiro 4d481ebccb fix(dynamodb): store map keys in code point order on plain API writes (#9227)
AWS sorts the keys of every map in a PutItem, BatchWriteItem or TransactWriteItems item and in update values. PartiQL literals keep their written order. An update sorts each map on its document path again.

Step Functions dynamodb:putItem and dynamodb:updateItem tasks and IoT dynamoDBv2 rule actions are plain PutItem and UpdateItem calls on AWS, so their maps are stored in code point order too.
2026-11-22 20:56:04 -04:00
Priamo GermosenandAndre Kurait 77c11493e7 fix(eks): trust Floci's served certificate in the pod identity webhook (#9231)
The Pod Identity webhook manifest carried only Floci's local CA, so with
floci.tls.cert-path set the API server refused Floci's certificate, and
failurePolicy Ignore admitted every pod unchanged. Its URL named the
Docker host: with Floci in a container that is Floci's container IP,
which Floci's own certificate does not name. An adopted cluster also
kept the manifest written when its container was created.

The caBundle is now the bundle /_floci/ca.pem serves, which moves into
ContainerCaBundle so both read it from one place. The URL uses a host
the served certificate names, through the check custom resource response
URLs already make in ContainerReachableEndpoint: Floci's hostname when
the node resolves through Floci's embedded DNS, otherwise the Docker
host. When the certificate does not name that host, the webhook is
skipped with a warning, as it is with TLS off. Adopting a surviving
cluster writes the manifest again, and names Floci's hostname only when
the surviving node was created with Floci's DNS server as its resolver.

The manifest and the webhook k3s registered from it live on the
cluster's data volume, so a skipped webhook now replaces the manifest
with one holding no objects, and k3s deletes the webhook an earlier
start registered.

The manager's constructors that left collaborators out existed only for
tests; they move to a test-side factory, so the endpoint the webhook
needs is never null in production code.

Closes #5563

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-22 20:29:39 -04:00
mrfelek 6aff785875 fix(kms): honour DryRun on the grant and cryptographic calls (#9226) 2026-11-22 20:28:46 -04:00
mrfelek cd85191a24 fix(aps): give resource-tag conditions the tags of the workspace or rule groups namespace a request names (#9230)
* refactor(test): share the signed user of an account of the test's own
* fix(aps): give resource-tag conditions the tags of the workspace or rule groups namespace a request names
2026-11-22 20:28:32 -04:00
Priamo Germosen 739a22ab32 feat(iam): read KMS from the generated tables, its permissions from the developer guide (#9221)
KMS is read from iam-request-resources.json now, and ResourceArnBuilder's
KMS branch and the enforcement filter's call around the table are gone,
leaving dynamodb and iam in HAND_BUILT.

What botocore and the Service Reference do not say comes from the KMS
documentation, vendored by fetch_kms_api_permissions.py into
tools/aws/sources/kms-api-permissions.json and read under
PERMISSION_SOURCES: the developer guide's permissions table, the API
reference's sentence that Decrypt and ReEncrypt read their key from the
ciphertext's metadata, and the guide's key identifier formats.

- ReEncrypt is checked as kms:ReEncryptFrom on its source key, or the
  ciphertext's key without one, and kms:ReEncryptTo on its destination
  key, ReplicateKey as kms:ReplicateKey and kms:CreateKey. An operation
  checked as several actions records them (actions, action), which
  RequestResources.checkedAs reads and the filter checks.
- CreateAlias, UpdateAlias and DeleteAlias are checked on the alias and
  the keys the table names, the alias's current key through the alias.
- Decrypt with no KeyId is checked on the ciphertext's key.
- KmsStoredResourceArns finds a key in any state, uses only an enabled
  one for a forwarded request, reaches the key of an alias, a grant or
  a ciphertext, and gives a key's tags.
2026-11-22 20:28:28 -04:00
Priamo Germosen 81b25c66bc refactor(emr-serverless): name SparkConnectServers' servers by their kind (#9222)
SparkConnectServers runs a session's server through the shared Spark
runner, probes it until it answers, keeps the tokens given for it and
routes a call by its token. Nothing in that is Spark Connect's but its
probe and the words of its refusals and its log, which name the Spark
Connect server and GetSessionEndpoint. EMR on EKS's managed endpoints
need the same for the Jupyter Enterprise Gateway they run (REAL-30).

- The class is SessionServers, and takes a Kind: what its servers are
  called, what each serves, and the operation that gives their tokens.
  Kind.SPARK_CONNECT gives EMR Serverless's and EMR's sessions the same
  answers and log as before.
- The texts a session fails with when its Spark Connect server exits,
  cannot start, never answers or ends, and the failure() that picks
  one, move to SparkConnectSessionOwner, the one class that uses them.
- probe(SparkConnectProxy) is sparkConnectProbe.

No behavior changes.
2026-11-22 18:49:11 -04:00
Priamo Germosen e394329a8b chore(deps): bump botocore to 1.44.9 (#9223)
Moves the pin from 1.43.118 to 1.44.9 and regenerates the data derived
from it.

1.44.9 adds the me-west-1 and sa-west-1 regions, whose optIn and
s3WebsiteDashForm flags come from aws-cdk's aws-entities.ts rather than
botocore, so partitions.json is generated with that file; no existing
region's flags change. AwsPartitionsTest, AwsRegionsTest and
Ec2DescribeRegionsIntegrationTest count 36 commercial regions, 19 of
them opt-in.

The IAM tables aws-data-check-botocore checks are regenerated with it.
The passed-role and tag-on-create tables no longer park any operation
as missing from the pinned botocore, and the passed-role generator's
four MEMBER_NOT_IN_BOTOCORE entries come out, as the reason asks, now
that EventBridge's event sources and WAF v2's web ACLs have the member
naming their role. The DynamoDB and IAM condition key tables are
regenerated too. test_regen_iam_tag_on_create pinned
network-firewall:CreateFirewallPolicyV2 as an operation botocore lacks;
it now checks the tags its request names.

with_parent_ids reads a made resource's parent id from "the one
top-level ARN member named after that type", but request_members keys
a member inside a structure or a list by its whole path, so the
path == member test also took RAM's new
permissionTemplateParameters[].permissionArn and filled the resource
share CreateResourceShare makes with a permission ARN. It now takes a
top-level member alone, which changes that one operation and no other.

Four request members 1.44.9 models were accepted and dropped, as they
were before it, when Floci read them as unknown:

- ECR keeps each replication rule's deleteReplication and returns it
  from PutReplicationConfiguration and DescribeRegistry.
- Lambda MicroVMs keep the kmsKeyIdentifier an image's create or update
  names on each version it builds, and the one RunMicrovm names on the
  MicroVM, and return them where the model has the member.
- STS's GetWebIdentityToken refuses Scope unless SubjectMode is
  OriginIdentity with exactly one audience, and refuses OriginIdentity,
  which reads the calling session's trusted identity propagation
  context, as AWS does a session without one: no Floci session carries
  one. Both answer ValidationError with the reference's own sentence.

LambdaMicrovmImageModeledConstraintsIntegrationTest's invalid cases
follow the model: X86_64 is an architecture now, and an image takes up
to 100 environment variables.
2026-11-22 18:46:45 -04:00
Priamo Germosen 942cace935 fix(iam): refuse a managed policy delete that leaves versions behind (#9224)
DeletePolicy read the attachment count alone, so a policy carrying a version
beside its default was deleted along with its history and answered nothing.
AWS refuses that delete with DeleteConflict 409 and three sentences of
wholly fixed text, "This policy has more than one version. Before you delete a
policy, you must delete the policy's versions. The default version is deleted
with the policy.", recorded against a real account on 2026-10-29, and the
operation's published description asks a caller for the same two steps:
detach the policy from every user, group and role, then delete all of the
policy's versions.

The refusal reports an attachment first and the versions second, the order
those steps are written in. Which of the two AWS names for a policy carrying
both is not recorded, so the page marks that order as this package's reading
rather than a recording, as it already does for attached ahead of inline.

Nothing clears those versions on the caller's behalf, on AWS or here, so
whoever wants the policy gone deletes them first. The CloudFormation
provisioner for AWS::IAM::ManagedPolicy owns the policies its stacks create
and publishes the new document as a new default version on every update, which
leaves the version before it stored: the delete that brings such a stack down
clears the other versions ahead of the policy, in the order the published
steps give, so a stack cannot end up able to create and update a policy it can
never take down again. The clearing asks the attachment question before a
single version goes and answers it with the sentence the delete would, so a
policy a principal the stack never recorded still holds keeps its history
instead of spending it on a delete that was going to be refused anyway.

The reads a delete decides on and the delete itself are under the lock every
other IAM write takes, which the writes to a policy's versions now take as
well, so a version published between the count and the delete is no longer
deleted along with the policy it was added to, and the write back that ends a
clearing cannot restore a policy another caller deleted in between. Inside it
the version map keeps its own monitor, and SetDefaultPolicyVersion moves the
default version id under that monitor beside the flags it already set there:
between those two writes a clearing would have read the id this call had just
replaced and dropped the version it had just made default.

Covered over the API by the refusal, its precedence over the attachment and
the control that deletes the other version and then the policy; at the service
level by the clearing that keeps the default with its document, the attachment
that refuses it with every version intact, and the version a SetDefault just
chose being the one kept; by a trial loop over a delete racing a version
publish; on the provisioner by the order its delete asks for; and end to end by
a stack that is created, updated and then deleted, with the policy gone after
it. One test fixture published a second version and tore the policy down with
one call, which the refusal now blocks, so it deletes that version first.
2026-11-22 17:20:50 -04:00
mrfelek d4af2a836e fix(ec2): honour DryRun on the security group rule calls (#9225)
AuthorizeSecurityGroupIngress and Egress, RevokeSecurityGroupIngress and
Egress and ModifySecurityGroupRules ignored DryRun=true and made the
change: a dry-run AuthorizeSecurityGroupIngress added the rule. Each now
answers DryRunOperation once the request has passed the checks the real
call makes, and changes nothing. UpdateSecurityGroupRuleDescriptionsIngress
and Egress change nothing in Floci and refuse nothing, so they answer it
through the handler's checkDryRun.

Part of #8220
2026-11-22 16:56:22 -04:00
Aditya 749daf638f fix(cloudformation): apply ImageScanningConfiguration on AWS::ECR::Repository (#9215)
Read ImageScanningConfiguration.ScanOnPush in EcrCfnProvisioner and pass it to createRepository, and call putImageScanningConfiguration on an in-place update when the template declares it. An update that drops the property leaves the stored setting in place, as the ECR resource handler does. AWS::ECR::Repository ImageScanningConfiguration leaves the writable-property gap list.

Closes #9198
2026-11-22 16:29:10 -04:00
Angel Abad ce02956615 fix(rds): store and describe DB cluster monitoring and Insights settings (#9095)
CreateDBCluster and ModifyDBCluster dropped MonitoringInterval,
MonitoringRoleArn, EnablePerformanceInsights,
PerformanceInsightsRetentionPeriod and DatabaseInsightsMode, and
DescribeDBClusters left them out, so the Terraform AWS provider planned
the same change on every run for a cluster that sets them. DbCluster now
keeps them, with the checks a DB instance gets plus advanced Database
Insights needing Performance Insights with at least 465 days of retention.

CreateDBCluster and ModifyDBCluster also check VpcSecurityGroupIds
against EC2 as CreateDBInstance does. A modify runs these checks before
any of its changes is stored, and a refused create leaves no cluster.

An Aurora member reports its cluster's groups, and a cluster automated
backup reports its cluster's backup window.
2026-11-22 16:27:47 -04:00
Priamo Germosen 39b601514a feat(emr-containers): retry a job run's failed driver under its retry policy (#9218)
A docker job run with a retryPolicyConfiguration failed at its driver's
first error, and every run showed its policy, even one that disables
retries.

- With a maxAttempts above 1, a driver that exits with an error is
  started again, "restarted automatically if it fails", until the run
  has made maxAttempts attempts, after "an exponential retry interval of
  (10 seconds, 20 seconds, 40 seconds ...) which is capped at 6 minutes"
  (EMR on EKS Development Guide, "Using job retry policies").
- Between its attempts the run is SUBMITTED and keeps its running slot,
  each new attempt raises its retryPolicyExecution's currentAttemptCount,
  and CancelJobRun cancels it at once. One Floci stopped in between waits
  out the rest of its backoff once it is read again. A driver that cannot
  start, or that Floci stopped, is not retried.
- With retries enabled, its driver pod's name has a suffix of each
  attempt's own, spark-<job id>-driver-<random-suffix>, so each attempt's
  logs go to a folder and streams of their own, under the run's one Spark
  application id.
- A maxAttempts outside 1 to 2,147,483,647 is refused with "Retry policy
  configuration's parameter value of maxAttempts is invalid", and one of
  1 shows neither the policy nor its execution: "These fields will not
  be visible when retry policy is disabled in the job".
- Floci sends no EMR on EKS events, so the docs note that there is no
  "EMR Job Run New Driver Attempt" event.
2026-11-22 15:44:21 -04:00
Priamo Germosen 82fdb36228 fix(iam): answer a blocked delete with the sentence for the dependency that blocks it (#9220)
IAM names exactly one blocking dependent and words each class with its own
wholly fixed sentence, no entity name and no count, because a cleanup loop
reads the sentence to choose its next step. Four of those recordings bear on
this package and three of them diverged.

- DeleteRole read a role's attached and inline policies together and answered
  the detach sentence for both, so an inline policy was told to detach
  something. The two are reported apart now: "Cannot delete entity, must
  detach all policies first." for a managed attachment and "Cannot delete
  entity, must delete policies first." for an embedded policy, which is the
  remedy that clears what is there. DeleteGroup conflated them the same way
  and selects the same two sentences now; DeleteUser already did and is the
  model both follow.
- DeleteRole never looked at instance profiles, so a role a profile held was
  deleted and left the profile naming nothing. A role an instance profile
  holds is "Cannot delete entity, must remove roles from instance profile
  first." and the profile has to let go of it first, as on AWS. The profile
  is reported ahead of an attached policy, which is recorded for a role that
  is both held and carrying attachments, and is what a cleanup loop needs,
  since detaching changes nothing while the pairing is there.
- DeleteInstanceProfile wording its own refusal now carries that same
  sentence, which is AWS's for both ends of the pairing.

The new membership check and the emptiness check it joins are both
check-then-act, so AddRoleToInstanceProfile takes the lock the deletes decide
under, outside the profile's own monitor as every path here already does: one
order throughout, and no pairing can land between a delete's read and what it
does with it.

Nothing takes a role out of a profile on the caller's behalf, on AWS or here.
The CloudFormation role provisioner keeps clearing the policies its stack owns
and lets the conflict reach the stack, with a provisioner case for it; a stack
owning both resources deletes the profile first, since dependents go before
what they depend on. The test fixture that tears a role down removes it from
any profile first, ahead of its policies, so teardown asks for the remedies in
the order the refusals name. The tolerance behind RemoveRoleFromInstanceProfile
stays for state reached another way, and the test that reached it by deleting
the role first now asserts the refusal and clears the pairing before the role.

Which profiles hold a role is kept as an index beside the profiles themselves,
written in the same two places a pairing is and read only under that lock, so
the check costs a lookup rather than a read of every profile in the account
while the lock is held. A scope is filled from storage the first time it is
asked about, so a pairing a restart inherited is in it before the first answer.

The two callers that delete a role of their own clear its policies first, so
each asks about the profile before it clears anything: otherwise a role that
turns out not to be deletable would be left in place with its permissions
stripped by a delete that could not finish.
2026-11-22 15:14:52 -04:00
Hector Ventura 9af8ca07a9 feat(docker): see Lambda container exits through one Docker events subscription, behind a flag (#9175)
Every running Lambda container held a /wait stream, a streaming connection and a thread, only to notice its runtime exiting. With floci.docker.events-exit-detection on (off by default), DockerExitEvents watches them all through one events subscription filtered to container die events, as the AWS ECS agent does. Because events are edge-triggered, a container is registered before it starts and the first subscription is confirmed before the registration returns; after the stream drops, it subscribes again and inspects every watched container, reporting the ones that exited or died in the gap and never one still being created. The exit code comes from an inspect, with the event's exitCode attribute as the fallback, and each exit is reported once, on a virtual thread. With the flag off, LambdaExitWatcher runs as before.

A dropped or unconfirmed stream marks a sweep that the next subscription to start runs, whoever opened it. An inspect in the sweep that fails with anything but NotFound is tried again on a doubling delay, and only a subscription Docker confirms resets the reconnect backoff.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-22 14:59:18 -04:00
Matheus Oliveira 05e54bee29 fix(ec2): report and honor subnet private DNS name options on launch (#9100) 2026-11-22 14:58:20 -04:00
Alexy Grabov 624f1304d2 fix(ec2): preserve established host connections on ingress revoke (#9186)
With security-group enforcement on, revoking the last world-open ingress rule closes the relay's host listener at once and keeps the connections it already accepted, as AWS keeps tracked connections. When the instance's egress allows TCP to every address and port in the family the relay uses to reach the guest, AWS does not track those flows, so the revoke removes the relay and closes them immediately. A listener that cannot be closed falls back to removing the relay, one instance's failure no longer skips the group's other instances, and stop or terminate removes any draining relay. Ec2PublishedConnectionNightlyIntegrationTest covers both cases.
2026-11-22 14:53:21 -04:00
Koushik Dutta 188371eabc fix(cloudformation): return ValidationError when JSON parse error has no location (#9213) 2026-11-22 14:48:41 -04:00
glorfindel33 78ea3c90d9 fix(s3): apply the destination bucket's default encryption to CopyObject (#9211)
A CopyObject whose request names no encryption now takes the destination bucket's default
encryption, as the CopyObject reference says, not the source object's encryption. An explicit
encryption header on the copy request and an SSE-C destination key keep their precedence, and an
explicit aws:kms:dsse copy keeps its key id. S3IntegrationTest.copyObjectPreservesServerSideEncryption
is renamed and changed to match.
2026-11-22 14:46:04 -04:00
galsuchetzky-act ee722e8da3 fix(bedrock-agentcore): use modeled tag constraint errors (#9193) 2026-11-22 14:44:51 -04:00
glorfindel33 dda3b96dee fix(s3): read the default encryption only from ApplyServerSideEncryptionByDefault (#9210) 2026-11-22 14:42:03 -04:00
Hector Ventura 8183404fbd feat(docker): per-service container budgets that answer with each service's capacity error (#9176) 2026-11-22 14:26:03 -04:00
Priamo Germosen 5c62948838 feat(emr-containers): send a job run's driver logs to its S3 and CloudWatch destinations (#9208)
A docker job run's driver output went to Floci's log only, whatever its
monitoringConfiguration asked for.

- With an s3MonitoringConfiguration, the driver's stdout.gz and
  stderr.gz go to "/logUri/virtual-cluster-id/jobs/job-id/containers/
  spark-application-id/spark-job-id-driver/" once the run ends, as the
  development guide's "Configure a job run to use Amazon S3 logs" lays
  out a driver's logs.
- With a cloudWatchMonitoringConfiguration, its standard output and
  standard error go, as it writes them, to the streams
  "logStreamPrefix/virtual-cluster-id/jobs/job-id/containers/
  spark-application-id/spark-job-id-driver/(stderr/stdout)" in its
  logGroupName, the group and streams created if they do not exist.
- The spark-application-id has the form a Spark application on
  Kubernetes gets, spark- and 32 hexadecimal digits, and is Floci's own.
- A job template's configurationOverrides, whose parametric model need
  not name a destination's log group or log URI, are held to
  StartJobRun's ConfigurationOverrides, as a request's own are.
- The runner gzips a driver's output into temporary files rather than
  memory, and the per-stream CloudWatch forwarding EMR Serverless shares
  sends each line as written, but for an empty one, which CloudWatch
  Logs refuses, and each stream's lines of one emission in one call.
2026-11-22 14:08:25 -04:00
Priamo Germosen 0638a7f1d1 feat(iam): read API Gateway from the generated tables, its paths from the developer guide (#9207)
API Gateway leaves ResourceArnBuilder's own branch, and the enforcement filter's call that went around the
table for it: its requests are matched on their botocore routes and checked on the resources the
request-resources table reads. API Gateway authorizes a management call as the HTTP method of the request, on
the resource its path names, which its developer guide says and neither botocore nor the Service Reference
does. fetch_apigateway_arn_formats.py copies the guide's IAM page (the action and resource format sentences)
and its ARN reference tables unchanged into tools/aws/sources/apigateway-arn-formats.json, which
regen_iam_request_resources.py reads: a route authorized as its method is checked on the resource whose
published format is its own path, a Service Reference type before the guide's REST row, the /v2 of HTTP and
WebSocket API paths left out, and a path neither gives a row on the guide's ARN format with that path as its
resource path. The formats the reference does not give are recorded under pathFormats.

RequestResourceMembers reads pathFormats beside arnFormats and takes a hyphen in a path label;
RequestResources URL-encodes a value filling a UrlEncoded variable, so a tagging route acts on
/tags/<URL-encoded ARN> however it sends the ARN, and escapes % and / in a value filling a path-shaped format,
so one label cannot pass for several segments.
2026-11-22 10:09:43 -04:00
Vũ Thế Huy fe95e22866 fix(glue): report ErrorMessage on workflow graph Crawl entries (#9204)
Carry FinishedCrawl.errorMessage through WorkflowCrawl and include ErrorMessage on CrawlerDetails.Crawls entries in the workflow run graph when present.

Follow-up to #9195.
2026-11-22 09:38:01 -04:00
Priamo Germosen 84cbee7d6f feat(emr-containers): run a job run's Spark job in a container (#9203)
An EMR on EKS job run ran nothing: it was COMPLETED at once, or RUNNING
on a timer and then COMPLETED, whatever its Spark job would have done.

- With floci.services.emrcontainers.runner-mode set to docker, a run
  runs its Spark job in a container of its release's EMR on EKS base
  image on Amazon ECR Public, or of its custom image: a
  sparkSubmitJobDriver's spark-submit, or a sparkSqlJobDriver's
  spark-sql with its entry point as the file it runs, with the
  spark-defaults of its configurationOverrides and its execution role's
  credentials, on Floci's S3.
- The release label names the image's repository and tag, as the
  development guide's release notes give each release's "Container
  image tag": emr-7.2.0-20240610 runs emr-7.2.0:20240610. The base
  image's spark-defaults.conf runs a driver in Kubernetes' cluster
  mode, so the driver runs in client mode, its executors with it.
- A run is SUBMITTED while its container starts, RUNNING once its
  driver runs, and COMPLETED or FAILED as the driver exits, a failed
  driver with AWS's USER_ERROR and "Jobrun failed. Main Spark container
  terminated with errors. ...". A container that cannot start, a job
  driver without an entry point, and a run a restart left running fail
  with the development guide's INTERNAL_ERROR and VALIDATION_ERROR
  answers.
- CancelJobRun makes a running run CANCEL_PENDING until its driver is
  stopped, then CANCELLED.
- A run holds its virtual cluster's running slot from its submission
  until its driver ends, counting as concurrent, not queued, and the
  slot then goes to the queue. A run that cannot be handed to a thread
  fails and frees its slot, and a leftover driver of a run found failed
  is removed.
- The immediate runner mode, the default, is unchanged.
2026-11-22 09:33:41 -04:00