Commit Graph
293 Commits
Author SHA1 Message Date
Priamo Germosen 5ed7187e28 fix(iam): read a federated assume's tags in its trust policy, and sts:TagSession from the generated tables (#9721)
Under enforcement a role whose trust policy conditions AssumeRoleWithSAML or AssumeRoleWithWebIdentity on aws:RequestTag/<key> or aws:TagKeys refused every tagged assume: neither trust policy saw the tags the assertion or the token passes, which the Service Reference gives both actions and the IAM user guide's SAML ABAC tutorial's trust policy reads. And all three assumes named sts:TagSession by hand, through AssumeRolePolicyEvaluator.TAG_SESSION_ACTION, with the assertion's PrincipalTag attributes and the token's tags claim named by hand too.

The IAM user guide's page on session tags says where an identity provider passes the tags, "include the Attribute element with the Name attribute set to https://aws.amazon.com/SAML/Attributes/PrincipalTag:{TagKey}" and "the nested claim format uses a structure within the https://aws.amazon.com/tags namespace in the JWT", and what passing them needs, "trust policies for all roles connected to the identity provider (IdP) passing tags must have the sts:TagSession permission". tools/aws/fetch_sts_session_tags.py vendors it into tools/aws/sources/sts-session-tags.json, and regen_iam_authorized_actions.py gives both operations a companion naming the attribute or the claim, sts:TagSession, and the reference's aws:RequestTag/${TagKey}, where the reference's action of the operation's name takes that key.

The SAML and web identity trust policies now read the tags as aws:RequestTag/<key> and aws:TagKeys, written as an AssumeRole's are, and check the companion's action for them; the assertion and token verifiers read the companion's attribute and claim. AssumeRole's trust check takes the tagging action the tag-on-create table gives it. TAG_SESSION_ACTION and the allowsTagging methods are gone.

Closes #6640.
2026-11-29 00:16:10 -04:00
Hector Ventura 82c82ec553 fix(release): attach missing standalone binaries to an existing release (#9696)
2.4.0 and 2.5.0 shipped no standalone binaries, and nothing could add
them afterwards: re-running a release uses the tag's own workflow and
pushes the images again. Run by hand from main with a tag, release.yml
now builds the binaries that release lacks, or the ones named, from the
tag's source, and attaches them signed and attested as a tag run does.
It first verifies the release's sha256sums.txt against its cosign
bundle and the attached binaries against that file, then rewrites it to
cover every binary. A backfill never pushes or signs images and never
creates a release; tag runs build and publish as before.

Refs #8715
2026-11-28 22:25:00 -04:00
Priamo Germosen cc74f1c3a2 fix(iam): read an AssumeRole's source identity as the IAM user guide gives it (#9697)
Under enforcement an AssumeRole passing a SourceIdentity was neither held to sts:SetSourceIdentity nor read as sts:SourceIdentity, so a trust policy requiring a source identity refused every assume and one granting the permission was never consulted. The session kept no source identity either: the response returned none, its requests carried no aws:SourceIdentity, and a session assumed from it could set another. botocore gives the member and the Service Reference the key and the action, listing sts:SetSourceIdentity among the actions AssumeRole is authorized by, without saying when it is needed or which member carries the key.

The IAM user guide's page on source identity says both: "to pass source identity while assuming a role, use the -–source-identity AWS CLI option or the SourceIdentity AWS API parameter", "to specify a source identity, principals (IAM users and roles) must have permissions to sts:SetSourceIdentity", and when chaining it is "required in both the permissions policy of the principal who is assuming the role and in the role trust policy of the target role". tools/aws/fetch_sts_source_identity.py vendors it into tools/aws/sources/sts-source-identity.json. regen_request_condition_keys.py reads it for sts (CONDITION_SOURCES), so sts:SourceIdentity is read from AssumeRole's SourceIdentity, and regen_iam_authorized_actions.py crosses it with the reference's AuthorizedActions and botocore's request members into a new companions section of iam-authorized-actions.json: AssumeRole needs sts:SetSourceIdentity when it names SourceIdentity or its caller carries aws:SourceIdentity.

Enforcement checks the companion action on the role with the request's keys, and for a caller that is itself a role session checks it of the caller's own permissions alone too, since a trust policy naming the caller's role would otherwise stand in for them in the same account (the table's callerPolicyWhenChained, from the page's sentence on role chaining). STS checks it in the trust policy before the assume, as AWS names it where a statement granting both is conditioned on another sts:SourceIdentity. The session records the value under the key the table gives, aws:SourceIdentity, which its requests carry and a session assumed from it carries on, read there as sts:SourceIdentity too, and the response returns it. A chained request naming another value is refused with ValidationError, "The source identity is already set for this assume role session", and an AssumeRole naming a session tag key twice with InvalidParameterValue, "Duplicate tag keys found. Please note that Tag keys are case insensitive.", both as AWS's evaluation suite records them.

Part of #6640.
2026-11-28 21:09:11 -04:00
Priamo Germosen ee3970d6c9 fix(iam): read route53:VPCs from the vendored Route 53 developer guide (#9687)
Under enforcement a VPC association call scoped by route53:VPCs was refused for every VPC, as #8367 reports: the request condition key table never filled the key, so a condition on it never saw a value. Neither botocore nor the Service Reference says where a request carries the key or in what form.

Route 53's developer guide says both, in its table of condition keys: route53:VPCs "Represents a list of VPCs in the request of AssociateVPCWithHostedZone, DisassociateVPCFromHostedZone, ListHostedZonesByVPC, CreateHostedZone, CreateVPCAssociationAuthorization, and DeleteVPCAssociationAuthorization, in the format of "VPCId=<vpc-id>,VPCRegion=<region>". A vendored source, tools/aws/sources/route53-condition-keys.json, written by tools/aws/fetch_route53_conditions.py from that page, gives each key the table gives in a format of request members, with its operations and members, and the generator reads it for route53 (CONDITION_SOURCES) beside the record keys it already reads.

The table writes a key a format composes as that format with each member's place holding where the request carries it (VPCId={VPC.VPCId},VPCRegion={VPC.VPCRegion}), and a member of the query string as ? and its name (ListHostedZonesByVPC's ?vpcid and ?vpcregion), and the request condition reader fills the format from them, read from an XML body or the query string, when each member holds one value. A request naming no VPC, as a public CreateHostedZone does, carries none.

Route 53 reads the VPC only where its schema puts it, the VPC below the request's root, where IAM reads it, and refuses a second VPC, a second VPCId or VPCRegion, or a repeated vpcid or vpcregion query parameter with InvalidInput, as it already refuses a change batch naming an element twice. It used to take the first VPC anywhere in the body, so a request naming a denied VPC beside another carried no value for the Deny to match and still acted on the denied one.

Closes #8367.
2026-11-28 18:39:20 -04:00
Priamo Germosen 1b7ddb1101 fix(iam): read EKS access entry condition keys from the vendored Service Authorization Reference (#9682)
Under enforcement a CreateAccessEntry scoped by eks:principalArn or eks:accessEntryType was refused for every entry, and an AssociateAccessPolicy scoped by eks:policyArn or eks:namespaces for every association, as #8311 reports: the request condition key table read none of these keys, so a condition on them never saw a value. Neither botocore nor the Service Reference says which request member carries them.

The Service Authorization Reference's table of the keys EKS defines says it: eks:principalArn, eks:kubernetesGroups, eks:policyArn and eks:namespaces filter on "the <member> present in the access entry requests" or in "the associate / disassociate access policy requests", and eks:accessEntryType and eks:username on "the access entry type" and "the Kubernetes username" present in them, the access entry requests' type and username. A vendored source, tools/aws/sources/eks-condition-keys.json, written by tools/aws/fetch_eks_conditions.py from that page, gives each key its member, and the generator reads it for eks (CONDITION_SOURCES) beside the cluster keys it already reads.

The page gives what a request carries, so a vendored key is read from an action's request only where the reference lists it on the action itself; one the reference gives a resource type alone is the stored resource's value. A list's values are each read (kubernetesGroups, accessScope.namespaces). A vendored member the request carries outside its body, as DisassociateAccessPolicy carries policyArn in its path, or as a structure, as accessScope is, the page not saying which of its values the key holds, is not read.

The keys the reference gives the access entry itself, its stored principal, type, groups and username on the operations acting on one, are not read yet: those requests are checked on an access entry ARN whose identity and id are left open, which names no one entry to read them from.

Closes #8311.
2026-11-28 17:12:28 -04:00
Priamo Germosen b4cc436ad0 fix(iam): read EventBridge's rule and target condition keys from the vendored user guide (#9673)
Under enforcement a PutRule scoped by events:source was refused for every event pattern, and a PutTargets scoped by events:TargetArn for every target, as #8320 reports: the request condition key table never filled either key, so a Null or ForAllValues condition on them never saw a value. The table's reader is generic, but which member carries a key comes from SERVICES in regen_request_condition_keys.py, and EventBridge was not there. Neither botocore nor the Service Reference says where a request carries these keys: botocore models EventPattern as a string ("The event pattern").

EventBridge's user guide says it, in its table of condition keys: events:source is "the literal string for the source field of the event", with events:detail-type, events:detail.service, events:detail.eventTypeCode and events:detail.userIdentity.principalId the same for their fields, which a rule's event pattern gives ("EventPattern is a mandatory argument to PutRule"), and events:TargetArn is "the ARN of the target for the rule". A vendored source, tools/aws/sources/eventbridge-condition-keys.json, written by tools/aws/fetch_eventbridge_conditions.py from that page, gives each key its member, and the generator reads it for events (CONDITION_SOURCES), each key in the one operation the page names: PutEvents, CreateEventSource and UpdateEventSource take events:source too, which the page does not describe, so they are not read there. --verify checks the file against the page.

The table writes a field of a JSON document a string member holds after #: EventPattern#source.* is each literal string of the pattern's source, read by one generic step of the JSON reader. A pattern leaving a field out names nothing, so ForAllValues allows it and a Null check refuses it, as the page's examples show. The fields are read at the pattern's top level, where every example on the page gives them, so a $or branch's names nothing, and a matcher such as {"prefix": "aws."} is no literal string and names nothing. events:TargetArn reads each target's own Arn, not its dead-letter queue's.

Closes #8320.
2026-11-28 15:50:13 -04:00
Priamo Germosen c0c60ea886 fix(iam): check AWS Backup by its generated routes, resources and passed roles (#9669)
Under enforcement a REST route no vendored model names runs unchecked, and AWS Backup was among them: a caller could start a backup job or assign resources to a backup plan with any role and no iam:PassRole, and a grant scoped to one backup vault or plan covered every one, as #6255 reports. Backup's model routes are vendored, so each request is checked as its operation's action, and Backup joins the tables of request resources, passed roles and tags on create.

The Service Reference passes most of Backup's roles to one service, which the passed-roles generator reads alone: IamRoleArn to backup.amazonaws.com, a backup plan's scan settings' ScannerRoleArn to malware-protection.guardduty.amazonaws.com, and a restore testing selection's to restore-testing.backup.amazonaws.com. It passes StartScanJob's IamRoleArn and ScannerRoleArn to both of the first two without saying which goes where, so a vendored source, tools/aws/sources/backup-roles.json, written by tools/aws/fetch_backup_roles.py from the developer guide's malware protection page, gives each: the scanner role "trusts malware-protection.guardduty.amazonaws.com", and the backup role is "the same role found in ... the BackupSelection API", linking CreateBackupSelection, whose role the Service Reference passes to backup alone. The generator reads such a role as going where the reference passes that operation's roles, when that is one service.

A backup vault is checked by its name and a backup plan by its id; BackupStoredResourceArns answers the tags Backup holds on either, which an aws:ResourceTag condition reads. A recovery point's format the Service Reference gives with a literal * account, which the reader matches as written, so a request naming a recovery point by its ARN is checked on *, as one naming a DMS endpoint is.

A namespace the table reads is served on the shared tag routes only with a method its model gives on the path, as it already was only on the paths its model gives: Backup removes tags with POST /untag/{resourceArn}, so a DELETE on its /tags/{resourceArn}, which no Backup operation is and no action checks, was let through and removed tags an aws:ResourceTag deny relies on. It is now refused with MethodNotAllowedException (405), as a tag call sent with the other verb is.

Closes #6255.
2026-11-28 14:26:04 -04:00
Priamo Germosen 739e1274bc fix(iam): check AWS Batch by its generated routes, resources and passed roles (#9660)
Under enforcement a REST route no vendored model names runs unchecked, and AWS Batch was among them: a caller could create a compute environment with any service, instance or Spot Fleet role and register a job definition with any job or execution role, as #6255 reports. Batch's model routes are vendored, so each request is checked as its operation's action, and Batch joins the table of request resources and the passed-roles table.

The passed-roles generator reads RegisterJobDefinition's roles, each passed to ecs-tasks.amazonaws.com, alone. The Service Reference passes CreateComputeEnvironment's and UpdateComputeEnvironment's roles to batch, ec2, ecs and spotfleet without saying which member's goes where, so a vendored source, tools/aws/sources/batch-roles.json, written by tools/aws/fetch_batch_roles.py from the Batch API reference and user guide, gives each: serviceRole is trusted by batch.amazonaws.com, a compute resource's instanceRole is an instance profile whose role is trusted by ec2.amazonaws.com, spotIamFleetRole by spotfleet.amazonaws.com, and a managed instances provider's infrastructureRoleArn needs "iam:PassedToService: ecs.amazonaws.com", the update's naming the same role in the same words. SubmitServiceJob, which Floci does not serve, names its role inside the SageMaker request it queues, a string the table does not read.

The request-resources generator reads a type of two variables from a member whose documentation spells it, as it does ECS's "(family:revision)", now also where a variable shares only some of its words with the type's name, so DeregisterJobDefinition's "(name:revision)" names a job definition revision whole, not only its name, and where a member lists the form among those it takes, as SubmitJob's "definition-name, definition-name:revision, or the ARN" does, naming the revision rather than the job definition its name alone fills: "the request ARN includes the revision". BatchStoredResourceArns resolves it as Batch does, a name alone being the latest active revision a job runs, and answers the tags of what Batch stores. A member of a structure documented as "The Amazon Resource Name (ARN) of the" resource is read as one, so a job queue's computeEnvironmentOrder[].computeEnvironment is checked. No other namespace's reading changes.

A role name a path prefixes, which Batch documents ("if a role with the name bar has a path of /foo/, specify /foo/bar as the role name"), is checked on the role IAM holds under that name and path.

Batch's tag routes are served, as every namespace's the table reads, on the route its model gives, /v1/tags/{resourceArn} with the ARN encoded as an SDK sends it. Its tag-on-create reading waits: CreateComputeEnvironment is checked as batch:TagResource or batch:SetCapacityTags, and nothing says which of its tag members each is for.

Part of #6255.
2026-11-28 11:14:42 -04:00
Priamo Germosen a5afece703 fix(iam): check iam:PassRole on the roles an API Gateway request names (#9597)
AWS's Service Reference lists iam:PassRole for twelve API Gateway
operations, each passing its roles to apigateway.amazonaws.com. Floci
checked none: API Gateway is authorized by HTTP method, the passed-roles
table left the namespace out, and no member naming a role has a name the
table's rule knows (credentials, authorizerCredentials, credentialsArn,
authorizerCredentialsArn). An update names its role as a patch
operation's value, and an import inside its OpenAPI definition.

The roles are now checked for the operation the request's route resolves
to, which the table is keyed by, from three readings. A new vendored
source, tools/aws/sources/apigateway-roles.json, written by its own
script from the API references and developer guide, gives what they
read:

- The members that take a role, by the resource type each describes:
  "To specify an IAM role for API Gateway to assume, use the role's
  Amazon Resource Name (ARN)". PutIntegration, CreateIntegration,
  CreateAuthorizer, CreateApi and UpdateApi read them, REST APIs' and
  HTTP APIs' alike.
- A REST API update's patch operation, which names the property it
  changes by its path ("the path for this property is /name"): the
  value of the one whose path names a role member of the resource the
  update returns, so UpdateIntegration reads
  patchOperations[path=/credentials].value, UpdateAuthorizer
  /authorizerCredentials and UpdateAccount /cloudwatchRoleArn. The
  table gains a list step selecting the elements whose field holds a
  value.
- An import's OpenAPI definition, JSON or YAML: the
  x-amazon-apigateway-integration credentials of each Operation object,
  the ANY method's included, and the x-amazon-apigateway-authorizer
  authorizerCredentials of each security scheme, OpenAPI 2's and 3's,
  where the guide says each extension sits. ImportRestApi and PutRestApi
  take the whole body as the definition, ImportApi and ReimportApi a
  body member. The definition is read as its service takes
  and reads it, through a new PassedRoleLookup hook given the whole body:
  API Gateway resolves a REST API definition's ${AWS::Region},
  ${AWS::AccountId} and ${AWS::Partition} before importing it, so a role
  written with them is checked too, and takes an HTTP API's from its
  body's body (the REST route's envelope) or Body (the JSON 1.1
  handler's), or else the whole body, which the REST route also takes.

A REST JSON model's member is also read by its botocore name where its
wire name differs: Floci serves HTTP APIs over JSON 1.1 too
(AmazonApiGatewayV2.*), whose bodies name members as botocore does
(CredentialsArn, Body), and its handler takes either spelling as the
same member.

apigateway joins the passed-roles namespaces with all twelve operations
read and nothing added to the hand lists.
2026-11-27 14:21:56 -04:00
Andre Kurait cf481d3d02 test(neptune): allow cold graph startup in CLI fixtures (#9591) 2026-11-27 13:09:54 -04:00
Vũ Thế Huy 9fe75bf985 fix(rds): check caller database permissions before retrying failed zero-ETL load (#9518)
Retrying a failed zero-ETL destination reloaded it through the admin connection without checking the caller, so a role that could not create the database still got it back. The retry now checks the caller's own privileges first: it goes ahead only for a superuser, or a role with CREATEDB that is a member of the database's owner, and otherwise refuses with PostgreSQL's own "permission denied to create database". The database name is quoted with PostgresWire.quoteLiteral. A nightly Docker check runs each condition against a real PostgreSQL 16, and both test classes share one fixture.
2026-11-27 11:55:27 -04:00
Priamo Germosen 1a91dbda76 fix(iam): check iam:PassRole on the roles an EMR RunJobFlow request names (#9587)
AWS's Service Reference lists iam:PassRole for RunJobFlow, passing its
roles to application-autoscaling.amazonaws.com, ec2.amazonaws.com and
elasticmapreduce.amazonaws.com without saying which member's role goes
where, and JobFlowRole names an instance profile rather than a role.
The passed-roles table left the operation unread, so a caller allowed
elasticmapreduce:RunJobFlow could launch a cluster with any service role
and any instance profile.

A new vendored source, tools/aws/sources/emr-roles.json, written by its
own script from the EMR API reference, management guide and AWS CLI
reference, gives each member's role. The guide's page of each role names
its default role ("The default role name is EMR_EC2_DefaultRole"), and
the full access policy it gives users passes each default role to one
service ("iam:PassedToService": "ec2.amazonaws.com*"). The API reference
calls JobFlowRole an instance profile ("Also called instance profile and
Amazon EC2 role"), and the CLI reference's create-cluster examples give
the roles by name (--service-role EMR_DefaultRole). The steps' runtime
role, StepExecutionRoleArn, is not passed: "You can control access to
the runtime role with the condition key elasticmapreduce:ExecutionRoleArn."

The generator reads the source through ROLE_SOURCES, as it reads EKS's,
now taking a documented iam:PassedToService over a trust policy, a member
by name or as an instance profile where the source says so, and leaving
out a member whose role a condition key controls. RunJobFlow moves out of
notRead: ServiceRole to elasticmapreduce.amazonaws.com and AutoScalingRole
to application-autoscaling.amazonaws.com, each by name or ARN, and the
roles of the instance profile JobFlowRole names, by name or ARN, to
ec2.amazonaws.com, found with the instance-profile lookup RunInstances
already uses. A profile IAM does not hold passes no role, as Floci's EMR
already reads JobFlowRole. An instance-profile member is not read for a
call with no request of its own, which has no such lookup.

The instance profile is now found one way everywhere it is used
(IamService.instanceProfileNamed): by its name, or by its own ARN, path
and account included. IAM's passed-role check, EMR's step role and an
EC2 instance's credentials each read it their own way, and EMR kept only
the name after an ARN's last slash. A JobFlowRole ARN of another account
or path then found no role to check but ran the steps as the local
profile's role.

A member's JSON value is now read as the text a handler reads it as, a
number or a Boolean included, as the request resources and condition
keys already read a body's values. The passed-roles reader took strings
alone, while EMR takes "JobFlowRole":123456 as the profile 123456, so a
role named by a number went unchecked.
2026-11-27 08:11:04 -04:00
Priamo Germosen b8dcbeceb6 feat(rds): serve a DB instance at its own address in its VPC, on its Port (#9561)
With the new opt-in floci.services.rds.endpoints-in-vpc, a standalone DB
instance gets its own address in the subnet of its Availability Zone, as on
RDS, and serves the Port it was created with, or its engine's default, under
the name RDS gives it: <instance>.<identifier>.<region>.rds.<dnsSuffix>, with
one identifier per account and Region. Floci's DNS server answers the name
with the address, so two instances can both serve 5432.

A relay container at the address forwards each connection to the instance's
auth proxy, so IAM authentication, TLS and the master login are unchanged;
IAM tokens bind to the name and port the proxy binding publishes. The
address follows the instance through create, stop and start, a backend
started on retry, a move to another DB subnet group, a blue/green
switchover, delete, a failed create and a restart, and keeps its subnet and
VPC in use for DeleteSubnet and DeleteVpc.

VpcAddressRelays serves any endpoint this way next to VpcContainerLeases,
which now takes back a preferred address; RdsDnsRecordSource answers the
names, and AwsEndpoints builds them. Clusters and DB proxies keep the proxy
endpoint for now.

Refs #6273
2026-11-27 06:48:51 -04:00
Priamo Germosen fb0e72c96a fix(iam): check iam:PassRole on an EKS Auto Mode cluster's node role (#9576)
CreateCluster and UpdateClusterConfig take EKS Auto Mode's node role in
computeConfig.nodeRoleArn. AWS's Service Reference lists iam:PassRole
for both operations, with iam:PassedToService ec2.amazonaws.com and
eks.amazonaws.com, but not which member's role goes to which service.
Floci never checked the node role: CreateCluster read only its cluster
role, by hand, and UpdateClusterConfig was left out of the table.

A new vendored source, tools/aws/sources/eks-roles.json, written by its
own script from the EKS API reference and user guide, gives each member's
role and the service its trust policy is for. CreateCluster's roleArn is
the cluster IAM role ("provides permissions for the Kubernetes control
plane"), whose page links from the member and whose trust policy names
eks.amazonaws.com. nodeRoleArn is "the IAM Role EKS will assign to EC2
Managed Instances", whose description names the EKS Auto Mode IAM
reference, whose node IAM role section links the guide's page of that
role, whose trust policy names ec2.amazonaws.com. The generator reads
the source (ROLE_SOURCES) to choose, among the services the Service
Reference names for an operation, the one each member's role is for. It
fails on a vendored role for a service the reference does not name, and
on one no operation reads. --verify checks the source against the live
pages.

So CreateCluster now needs iam:PassRole on roleArn for eks.amazonaws.com
and on computeConfig.nodeRoleArn for ec2.amazonaws.com, and
UpdateClusterConfig on its node role for ec2.amazonaws.com. Both move
into the generated table. So do CreateNodegroup, CreateFargateProfile,
CreateAddon and UpdateAddon, whose roles PassedRoles read by hand, the
same members to eks.amazonaws.com the generator gives from botocore and
the Service Reference. Their hand readers are gone, and Step Functions'
EKS tasks now check them as a direct request does.
2026-11-27 01:00:33 -04:00
Andre Kurait 09db5e5979 fix(route53): scope private DNS answers to the querying VPC (#9508)
For an identified workload, Route 53 and Cloud Map private DNS answers come only from zones associated with the querying VPC, account and Region; visibility is decided before the most specific zone is chosen, authoritative negative answers are kept, and conflicting runtime identities are refused. A caller with no known VPC keeps its private answers. EC2 and ECS register their guests' VPCs for the lifetime of the workload, revoking them on confirmed stop, and a terminating instance's IAM sessions and metadata tokens are revoked independently of Docker removal. The guest DNS checks run as nightly Docker checks.
2026-11-26 16:27:39 -04:00
Priamo Germosen ad51bc5ecc feat(emr): start a cluster's Trino with it and reach it from outside Docker (#9534)
A cluster with Floci's Trino now starts its primary node, and Trino on it,
in the background as it becomes ready, steps or none, the way an
application UI link already does; the cluster goes WAITING as before.

Clients outside the cluster reach Trino through Floci on a host of the
cluster's own, <cluster-id>.emr-trino.<Floci's host>, through the app UI
proxy: Trino's port is published on the primary node's loopback like the
node's web interfaces, the request keeps its Host, which Trino names its
next pages by, and goes on with X-Forwarded-Proto, which Trino honours
with http-server.process-forwarded. Until Trino answers the host gives a
503, which Trino's clients retry, and starts the node where it is not
running; an ending or ended cluster gives a 404. Floci's TLS certificate
names the new host label.
2026-11-26 12:49:29 -04:00
Priamo Germosen f2125d8908 fix(neptune): start clusters' containers again when Floci restarts (#9522)
Floci's shutdown stopped every Neptune cluster's proxy and graph
database container and nothing started them again, so after a restart
with persistent storage a cluster reported available with nothing
behind its port.

At startup each cluster now reports maintenance, and its instances
starting, with its proxy port held for it at once, so a cluster created
meanwhile is never handed it. Its container comes back in the
background on the volume its graph is kept in, in the engine the graph
was kept in, which the cluster's record now names, and its proxy
listens on its port again; the cluster and its instances then report
available. With no Docker daemon reachable they come back available
with no container, as a cluster created then does. A cluster whose
container or proxy does not start is left with none and its instances
failed, and is tried again at the next start. The restore runs in each
cluster's own account and Region, and marking the clusters calls no
Docker.

Floci now records which cluster holds each proxy port, so a cluster
whose stored port another cluster holds moves to a free one, its
instances with it, and one restored in the same process keeps its own. One recorded before its engine was kept is
taken to be in the configured one, and one recorded before its graph
was kept in a volume gets a volume, both kept before any Docker call.

A DeleteDBCluster while the restore is starting the cluster's container
leaves it deleting until the container has started, a second one too,
and the restore removes it then. A delete defers only while a restore
owns the cluster, which it does only once its marking is done, so one a
failed write left deleting is retried at once; one still deleting at the next start is removed in the
background. The delete, the restore and CreateDBInstance decide under a
per-cluster lock, and instance creation, deletion and the restore's
status writes under a per-instance one, taken first, so the restore
never puts back an instance deleted meanwhile. CreateDBInstance is
refused with InvalidDBClusterStateFault for a cluster that is not
available.
Shutdown now marks the container manager first, after which no
container starts. A container left under a cluster's name, by a Floci
that exited without stopping it, is now stopped with the same 30
seconds as at shutdown before its replacement starts, rather than
removed outright, so Gremlin Server saves its graph to the volume
first. The message refusing to delete a cluster with instances uses a
colon in place of its dash.

Closes #5664.
2026-11-26 10:08:52 -04:00
Priamo Germosen 63df4c12ee feat(emr): give a cluster's Trino its trino-connector catalogs and trino-config (#9523)
Each trino-connector-<catalog> classification now adds that catalog to the
cluster's Trino, of the connector of its name (delta_lake for delta,
raptor_legacy for raptor) unless it names its own. delta, hudi and iceberg
sit on the cluster's Hive metastore, or on Floci's Glue when the
classification says glue, and on Floci's S3, as hive already does; Delta
writes to S3 are on, as the Release Guide's Delta tutorial inserts into a
table there. trino-config goes into config.properties after Floci's, and
its http-server.http.port moves the coordinator, its readiness query and
the address the steps' trino-cli reaches.
2026-11-26 09:47:50 -04:00
Priamo Germosen 6a3874a3e2 fix(neptune): keep each cluster's graph in a Docker volume of its own (#9505)
A Neptune cluster's graph lived only in its container: Gremlin Server's
TinkerGraph kept it in memory, and Neo4j in the unnamed volume its image
declares for /data. Removing the container, as Floci's shutdown does,
lost it, so a cluster could never be started again with its graph.

When Neptune's records are kept (its own storage mode, or the global
one, is persistent, hybrid or wal), a new cluster now gets a volume ID,
kept in its record, and its container mounts floci-aws-neptune-<id>, or
binds <host-path>/neptune/<id> when the host persistent path is an
absolute path. Neo4j keeps its data directory there. Gremlin Server's
image has its data directory there, and Floci writes the image's
TinkerGraph properties before the container starts so the graph is
saved to it when the server stops and loaded from it when it starts.
Under the host path Gremlin Server runs as root, since the directory
belongs to whoever created it rather than to the image's gremlin user.
An image laid out otherwise keeps its graph in memory, with a warning.
A container now has 30 seconds to stop before Docker kills it, as
Gremlin Server saves its graph a few seconds after the stop signal.

DeleteDBCluster removes the volume as the storage policy says, under
the storage mode Neptune's records are kept in, its own or the global
one; a create that fails removes it whatever the policy. A cluster created
again under a deleted one's identifier starts on a new, empty volume.

Starting the clusters' containers again on these volumes when Floci
restarts comes next.

Part of #5664.
2026-11-26 08:19:46 -04:00
Niels Kootstra 370b49861a fix(ec2): apply the shutdown behavior when an instance's guest powers itself off (#9475)
EC2 watches each instance container once it runs, and an exit Floci did not cause applies the instance's InstanceInitiatedShutdownBehavior: StopInstances by default, TerminateInstances for terminate, with the state reason Client.InstanceInitiatedShutdown. The behavior comes from RunInstances, its launch template or ModifyInstanceAttribute, is set before any container starts, is reported by DescribeInstanceAttribute, and must be stop or terminate. Reboots queue behind the container's other lifecycle operations, and the wait-stream exit watcher moves from Lambda to core.common.docker.

Fixes #9385
2026-11-26 01:14:24 -04:00
Priamo Germosen 4792c97902 fix(docdb): start clusters' containers again when Floci restarts (#9498)
Floci's shutdown removed every DocumentDB cluster's MongoDB container
and nothing started them again, so after a restart with persistent
storage a cluster reported available with nothing behind its endpoint.

At startup each cluster now reports maintenance, and its instances
starting, and its container comes back in the background on the volume
the cluster's data is kept in, with the master password the data was
set up with. Floci now keeps that password in the cluster's record,
never returned by the API, since a snapshot authenticates with it. The
cluster and its instances then report the new container's port and
available. With no Docker daemon reachable they come back available
with no container, as a cluster created then does. A cluster whose
container does not start is left with none and its instances failed,
and is tried again at the next start. The restore runs in each
cluster's own account and Region.

A cluster recorded before Floci kept the master password reads it from
the container it left, if one is there, and keeps it in its record
before that container is replaced; with none left it cannot be started,
and the restore says to create it again. One recorded before
its data was kept in a volume gets a new volume, kept in its record
before any Docker call.

Marking the clusters calls no Docker; the containers, and the removal
of a delete Floci did not live to finish, are all in the background.

A DeleteDBCluster during the restore leaves the cluster deleting until
its container has started, a second one too, and the restore removes it
then; one still deleting at the next start is removed then. The restore
applies its result only to the cluster it marked. CreateDBInstance is
refused with InvalidDBClusterStateFault for a cluster that is not
available, as RDS refuses it, so a deferred delete leaves no instance
behind. Shutdown now marks the
container manager first, after which no container starts, and a start
it overtakes removes its container.

Part of #5664.
2026-11-26 01:01:13 -04:00
Priamo GermosenandJames McMahon 05b77db069 feat(ssm): support agent-backed Session Manager sessions (#9492)
Session Manager for Linux EC2 guests running the stock SSM agent and the Session Manager plugin: interactive shells, SSH and port forwarding, with StartSession, ResumeSession, TerminateSession, DescribeSessions and GetConnectionStatus, and session document validation. Direct SendCommand execution on instances without the agent is unchanged.

StartSession and GetConnectionStatus are checked on the EC2 target, and StartSession on the selected or default session document, read from the Session Manager guide and API reference pages vendored in tools/aws/sources/ssm-session-permissions.json.

Replaces #9366, rebased onto main with the generated IAM table refreshed. On top of it, GetConnectionStatus echoes the Target it was asked about, as AWS answers. The agent's OpenDataChannel is checked on the session ARN, as the client's is, so a deny on one session reaches the instance role. Starting a session deletes the account's history older than the 30 days DescribeSessions lists.

Closes #9365

Co-authored-by: James McMahon <james@jamesmcmahon.co.uk>
2026-11-26 00:04:57 -04:00
Priamo Germosen c829b397ab fix(mwaa): start environments again when Floci restarts (#9466)
Floci's shutdown removed every MWAA environment's Postgres and Airflow
containers, with their volumes, and nothing started them again, so after
a restart with persistent storage an environment reported AVAILABLE with
nothing behind its webserver URL.

Shutdown now keeps the volumes while the environments are stored to come
back, and Floci keeps the secrets the metadata database was set up with
(its password, the Fernet key and the admin password) in a store of its
own, which GetEnvironment never returns. Shutdown removes containers by
the IDs Floci holds and under the environments' names, so none outlives
it, the ones a restore had not reached yet included. At startup each
environment reports MAINTENANCE, or CREATING while it was being created,
and its containers come back in the background. Containers that outlived
Floci are taken over, their secrets read back from the Airflow
container. Otherwise new ones start on the kept volumes with the kept
secrets, so DAG runs, connections and variables are back, and the
startup script and requirements.txt run as at creation. Containers and
volumes named before the floci-aws- prefix are found too. The web proxy
comes back on the port WebserverUrl names, or on a new one when that
port is taken. The first DAG sync after the restore compares the DAG
volume with S3, so a DAG deleted while Floci was stopped is removed; the
sync reads every page of the S3 listing, so no DAG past the first
thousand reads as deleted. The readiness poller reports the environment
AVAILABLE once Airflow is healthy, or UNAVAILABLE when a container exits
first; one whose containers do not start is UNAVAILABLE, and tried again
at the next start.

An environment stored before Floci kept the secrets gets them back from
a container left under its name, or, with none left, new ones, as its
volumes went at the shutdown then; one whose volumes are still there is
left UNAVAILABLE rather than started on new ones. Secrets found or given
are kept before anything starts. When Docker cannot say which containers
or volumes are left, the environment's restore fails, removing nothing.

A DeleteEnvironment during the restore leaves the environment DELETING
until its containers have started, and the restore then removes it; one
still DELETING at the next start is removed then. A start that shutdown
overtakes removes its containers. A new environment starts on empty
volumes, so it never inherits a database set up with other secrets.

Part of #5664.
2026-11-25 17:23:27 -04:00
Priamo GermosenandAndre Kurait b012f4d6bf fix(iam): check VPC endpoint IDs in EC2 tag calls on their endpoint ARN (#9467)
CreateTags and DeleteTags checked a vpce- ID in their Resources list on `*`, because the generated table learns
each ID prefix from botocore's examples and botocore gives none for VPC endpoints. A grant on one endpoint was
refused and a deny on it never applied.

fetch_ec2_id_examples.py copies the identifier examples of the EC2 API reference's CreateVpcEndpoint page into
tools/aws/sources/ec2-id-examples.json, and the generator matches their XML paths to botocore's output shapes,
which gives VpcEndpointId the vpce- prefix. That prefix joins botocore's in the one prefix map and reads only the
tagging calls' generic list, so DeleteVpcEndpoints keeps its typed reader. The source names its namespace and
pages, and the shared source verifier checks it against the live page.

The regenerated table also takes in what the Service Reference added on 2026-11-25: CloudWatch's omni-slo,
experiment and lookup types, which its tag operations now act on, Elastic Load Balancing's proxy type and the
amplifygen3 namespace.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-25 17:22:55 -04:00
Priamo Germosen 215e37eb48 fix(cloudtrail): name S3 denials as CloudTrail records the operation's data event (#9460)
IamEnforcementFilter named the CloudTrail data event of a denied S3 request
from a hand-written table keyed by the IAM action, so a request checked
under another operation's action took that operation's name: HeadBucket
was recorded as ListObjects, CopyObject, UploadPart and UploadPartCopy as
PutObject, GetObjectTorrent as GetObject, ListBuckets as a data event,
and ListObjectVersions, ListParts, DeleteObjects, AbortMultipartUpload and
the legal hold and retention calls were not recorded.

A denial is now recorded under the data event of the operation the request
matched, from src/main/resources/aws/cloudtrail-s3-data-events.json, which
tools/aws/regen_cloudtrail_s3_data_events.py generates from botocore's S3
model, the S3 user guide's data events table and its sentence naming the
event a call is recorded with (vendored by
tools/aws/fetch_cloudtrail_s3_data_events.py), and AWS's S3 service
reference. An operation the table for general purpose buckets lists is
recorded under its name or the one the guide gives it (PutObjectRetention
as PutObjectLockRetention), a versioned one under the version-less name
the table lists (ListObjectsV2 as ListObjects), and an operation it does
not list records no data event. readOnly is the service reference's, by
the reading iam-action-resources.json's readOnlyActions are vendored by,
in place of CloudTrailService's hand-written list.

The IAM data drift workflow runs on a pull request touching any of the six
new files, so the online check covers a change to the table alone.
2026-11-25 15:10:24 -04:00
Priamo Germosen c843dcbdfc fix(opensearch): start domain containers again when Floci restarts (#9434)
Floci's shutdown removes every OpenSearch domain's container, and
nothing started them again, so after a restart with persistent storage
a domain reported an endpoint nothing answered on.

At startup, each domain goes back to Processing, and its container
comes back in the background. A container that outlived Floci, kept
running across the shutdown or left behind by a killed Floci, is kept:
found by the container ID the record names, started again if it
stopped, and its host port reserved again. Otherwise the domain gets a
new container on the data it kept, so its indices are back, and the
readiness poller reports it ready once it answers. A domain started
again keeps the storage its record names, whatever the data-volume
setting says then: the operator's volume, or bind-mounted directory,
whose path the record now keeps, or its own Floci-managed volume. With no Docker
daemon reachable, a domain has no container, as one created then has.

A domain deleted during its restore reads Deleted, keeps its name, and
is removed with its container and data once the restore's start is
through; one still Deleted at the next start is removed then. Each
removal is confirmed with Docker, and deleting again a domain whose
delete Docker kept the container of confirms it the same way, one
retry at a time, on the record still stored. A start that shutdown overtakes
removes its container.

Part of #5664.
2026-11-25 10:05:46 -04:00
Priamo Germosen 732001a90f fix(kinesisanalytics): start Flink clusters again when Floci restarts (#9390)
Floci's shutdown removes every application's Flink cluster, and nothing
started them again, so after a restart with persistent storage an
application still reported RUNNING with no cluster and no job behind
it.

At startup, each application that was RUNNING or still STARTING goes
back to STARTING, and its cluster starts in the background. A cluster
that outlived Floci is kept when its JobManager, TaskManager and job
still run. Otherwise what survives of it is removed, under the current
or the old floci- names, and the application gets a new cluster, as
StartApplication starts one, in the application's own account, and the
readiness poller runs its job afresh and reports it RUNNING. An
application whose cluster cannot be started goes back to READY, from
which StartApplication starts it again. An application stopped while
its restore is starting the cluster is STOPPING, as AWS reports a stop
in progress, until the restore has removed that cluster by its
containers' IDs, and READY then. StartApplication and DeleteApplication
refuse it meanwhile, so no second start runs under the cluster's names.
One still STOPPING at the next start has what survives of its cluster
removed before it turns READY. Each removal is confirmed with Docker:
while Docker keeps the cluster, the application stays STOPPING and the
cluster stays named and tracked, for shutdown and the next start.
Records stored under the keys of older builds move onto their current
keys first, so no application is restored twice. A start that shutdown
overtakes removes its containers.

Part of #5664.
2026-11-25 06:40:37 -04:00
Mitch Just 0e32c55191 fix(docker): move the image bases to UBI 9.9 (#9309)
UBI 9.8 is out of standard support. The native runtime, packaged native,
compatibility tools and zstd action test images now build on UBI 9.9.
2026-11-24 21:59:31 -04:00
Hector Ventura 0b232e7f06 test: run the Docker end-to-end classes nightly and on pull requests that change their service (#9310) 2026-11-24 21:04:04 -04:00
Hector Ventura 06046bf707 docs: point Slack links at floci.io/slack (#9402)
The previous Slack invite expired. Link to floci.io/slack, which redirects to the current invite, so future rotations need no change here.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-24 18:20:42 -06:00
Priamo Germosen 8dd85097f0 feat(emr): run Trino on a docker cluster whose Applications name it (#9382)
A cluster whose Applications named Trino ran none, as no AWS image
carries it. With floci.services.emr.trino.enabled on, off by default, a
docker cluster that installs Trino now runs its coordinator, and its
steps run EMR's trino-cli against it.

- The coordinator, which runs the queries too, runs on the cluster's
  primary node, in a container of its own that shares the node's
  network: from the Trino project's image of the version the release's
  page in the Release Guide gives (trino.image, trinodb/trino:%s, 446
  for emr-7.5.0), with trino.memory-mb of memory (2048), on port 8889,
  EMR's.
- EMR installs hive-client and hcatalog-server with Trino, so the
  cluster's image has Hive and its primary node runs Hive's metastore
  service. Trino's hive catalog is that metastore, or Floci's Glue Data
  Catalog when trino-connector-hive sets hive.metastore to glue, the
  classification's other properties after Floci's. Trino reaches S3 and
  Glue with a session for the cluster's instance profile's role, as the
  metastore does.
- The cluster's image gets Trino's CLI from Trino's image, and a
  trino-cli that runs it on the image's Java 17 against the coordinator,
  whose address the steps get, unless a step names a server of its own.
- The cluster's first step starts Trino with the HDFS and waits for it.
  It goes before the primary node when the cluster ends, on a reset and
  on a shutdown, and one an earlier Floci left goes when the service
  starts.
- A nightly check runs trino-cli steps on a cluster with the metastore
  and on one with Glue. It joins the docker-runner group, whose budget
  grows by its 24 minutes, and the prefetch pulls its Trino image.
2026-11-24 17:17:07 -04:00
Priamo Germosen 4a9ae4a569 fix(amazonmq): start broker containers again when Floci restarts (#9377)
Floci's shutdown removes every broker container, and nothing started
them again, so after a restart with persistent storage a broker still
reported RUNNING while nothing answered on its endpoints. A new
container would not have helped either: RabbitMQ keeps its data under
the node name, which defaults to the hostname Docker sets to the
container id, so a new container on the same volume started an empty
node without the broker's users.

Broker containers now run as the fixed node name rabbit@localhost. At
startup, each broker that was RUNNING or still starting goes back to
CREATION_IN_PROGRESS, and its container starts in the background. A
container that outlived Floci is kept when it still answers. Otherwise
the broker gets a new container on its volume, without seeding the
admin user, whose password is never stored, and on the host ports it
had when they are free. The readiness poller reports it RUNNING once
the console it probed answers.

A broker from before fixed node names with no surviving container is
reported CREATION_FAILED. One whose restore fails is reported
CREATION_FAILED and tried again at the next start, one CreateBroker
failed for is left as it is, and one a crash left DELETION_IN_PROGRESS
is deleted.

Part of #5664.
2026-11-24 16:17:21 -04:00
Hector Ventura 73aa27f2aa test: run the plain test classes four at a time in CI (#9311) 2026-11-23 22:41:25 -04:00
Priamo Germosen ec372b4f9d ci: give the vendored AWS data job thirty minutes (#9322)
The "Vendored AWS data in sync" job now takes six to nine minutes, nearly
all of it the IAM request-resources check, which grows with each namespace
the generated table reads, so runs on a slower runner reach the job's
ten-minute limit and are cancelled inside that check. Raise the limit to
thirty minutes; nothing else changes.
2026-11-23 22:39:45 -04:00
Priamo Germosen a1b96f5c3f fix(emr-containers): give a managed endpoint's Scala kernel Toree's magics (#9313)
Toree finds its built-in magics (%AddJar, %AddDeps, %LsMagic, %%sql,
%%dataframe and the rest) by scanning its own jar for plugin classes,
and its class finder reads each entry's name through a reflective call
to JarFile$JarFileEntry.getName(). The notebook image's Java 17 refuses
that call unless java.util.jar is open to the caller, so the scan
failed ("PluginSearcher: Failed to load class info from classpath",
an InaccessibleObjectException) and the kernel started with no magics.

- The Scala kernel spec exports JDK_JAVA_OPTIONS with
  --add-opens=java.base/java.util.jar=ALL-UNNAMED, after any value
  already set, before it runs spark-submit. Java reads the variable
  itself, so the image's spark.driver.extraJavaOptions stay as they
  are, where --driver-java-options would replace them. The option
  comes from EmrServerlessSparkRunner.javaBaseOpens, which now builds
  YARN's options from their package list too.
- The nightly check's Scala kernel adds a jar with %AddJar, then
  compiles a cell against a class in it. Its method's timeout grows by
  the two cells' four minutes, and the docker-runner group's with it.
2026-11-23 21:16:50 -04:00
Priamo Germosen 0dd02aed44 feat(emr-containers): run a managed endpoint's overridden kernels in containers of their own (#9293)
An endpoint's jupyter-kernel-overrides gives a kernel its own
container-image ("Custom kernel image with interactive endpoint"), and
on EMR on EKS each kernel is a pod of its image. A Floci endpoint ran
every kernel in its gateway's container, whatever image the overrides
named.

- The gateway job tells the gateway program which kernels the
  overrides give an image (python3 and spark-python-kubernetes, the
  kernels the guide's example names, as "You can't add new kernel image
  types"), where it asks Floci for their containers, and a secret Floci
  gives that gateway alone.
- EmrContainersKernelContainersRoute takes the gateway's POST and
  DELETE on /_aws/emr-containers/kernel-containers/<endpoint>/<kernel>.
  The service checks the secret, that the endpoint is ACTIVE and its
  overrides give the kernel an image, and the kernel id, response
  address and public key, then EmrContainersKernelContainers runs the
  kernel's container: the override image, with the gateway's settings
  and environment and the kernel's KERNEL_ variables, running the
  image's Jupyter Enterprise Gateway launcher (launch_ipykernel.py),
  under spark-submit with the %%configure magic for a PySpark kernel.
  A launch is admitted under the lock the gateway's end takes, so an
  endpoint's kernel containers all stop with its gateway, and a reset
  or Floci's shutdown stops every one.
- The gateway program gives such a kernel a jupyter_client provisioner
  that speaks the launcher's protocol: it asks Floci for the container
  with an RSA public key and a response address, decrypts the
  connection the launcher sends back (an AES key, under RSA, over
  AES-GCM), and polls, signals and stops the kernel through the
  launcher's comm port and Floci. It waits KERNEL_LAUNCH_TIMEOUT
  seconds, at most the guide's 400, or 400, and a launch that fails
  once the container was asked for stops it.
- Such a kernel's %%configure magic posts to its ENDPOINT_IP, the
  gateway, on port 9547 over TLS, with a certificate the image's openssl
  makes; the program checks it with the launcher's AES key, which each
  launch refreshes. Every restart, the kernels API's, the
  auto-restarter's or %%configure's, gives the kernel a new container
  with new ports and a new key, and the program moves the kernel's
  clients and its activity watch onto them.
- The nightly check gains a method: an endpoint that overrides both
  kernels with the release's own image runs each in its own container,
  the PySpark one counting an S3 file's lines and taking %%configure.
  The docker-runner group's budget grows by its eighteen minutes.
2026-11-23 15:32:02 -04:00
Priamo Germosen 5c7ab956f9 feat(emr-containers): run the Scala kernel on a managed endpoint's gateway (#9276)
Interactive endpoints "support the following kernels: Python 3, PySpark
on Kubernetes, Apache Spark with Scala" (EMR on EKS Development Guide,
"Overview of interactive endpoints"). A Floci endpoint's gateway had no
Scala kernel.

- The gateway program writes a spark-scala-kubernetes kernel spec,
  "Apache Spark with Scala", a name of Floci's beside the guide's
  spark-python-kubernetes, as the guide gives the Scala kernel none. It
  runs the image's Apache Toree, beside Jupyter Enterprise Gateway's
  Scala launcher, under spark-submit as Toree's own kernel spec does:
  org.apache.toree.Main with the connection file as its profile, after
  KERNEL_EXTRA_SPARK_OPTS. Its spark is a Spark session in Spark's
  local mode on Floci's S3, as the PySpark kernel's is.
- The docs move the Scala kernel out of "Not emulated yet", and the
  endpoint role every kernel runs with out of it too: "All kernels and
  users that connect to the interactive endpoint utilize the role that
  you specified when you created the endpoint".
- The nightly check lists the new kernel spec and counts an S3 file's
  lines in the Scala kernel. Kernel start, connection and deletion
  become helpers. The method's timeout and the docker-runner group's
  budget grow by its four minutes.
2026-11-23 11:20:15 -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
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
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
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
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
Jackson PriceandAndre Kurait fbedde4c2c fix(docker): probe the configured healthcheck listener (#8572)
Use the existing HTTP host and port environment settings for the container
probe. Map wildcard hosts to loopback and keep TLS probes on the public
multiplexed port. Preserve readiness and startup-grace handling.

Honor the LocalStack listener aliases the way LocalStackParity does:
USE_SSL, EDGE_PORT and the first GATEWAY_LISTEN entry, with a nonempty
Floci setting winning and LOCALSTACK_PARITY=false turning them off.

Add socket-level coverage for listener selection and failure responses,
run in the existing Docker runner job.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
2026-11-21 15:41:25 -04:00
Andre Kurait 0400332432 fix(ci): run IAM drift selector tests for Makefile changes (#9063)
* fix(ci): run IAM drift selector tests for Makefile changes
* docs(ci): clarify selector-only IAM drift triggers
2026-11-21 12:19:33 -04:00
Andre Kurait 430088b772 fix(ci): pass IAM drift changed paths through a file (#9025)
A large pull request diff could fail the IAM data gate before any check
ran, because the workflow passed every changed path in one make argument
("Argument list too long"). The workflow now writes the paths to a file
and iam-data-verify reads it through CHANGED_FILE, keeping affected-check
selection, the CHANGED interface, full verification for an empty diff or
the weekly run, and the report of every failed check. A Python test runs
the target with stubbed checks for each of those cases.
2026-11-19 21:19:01 -04:00
Hector Ventura 3205a62cf7 chore(ci): prune only main's superseded Maven caches (#8994)
The prune job added in #8956 listed maven-Linux- caches across every ref, so a cache another ref saved under the current pom's key could pass its guard and let it delete main's older entries while main's own current one was missing. It now lists and checks only refs/heads/main. No other ref saves that key today, since the save runs only on a push to main, but the guard no longer depends on it.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-19 17:07:16 -06:00
Hector Ventura 3bf5e2a5f9 chore(ci): check the amd64 native image after each Nightly, not on every pull request (#8959)
* chore(ci): check the amd64 native image after each Nightly, not on every pull request

compatibility.yml built the amd64 native image on every pull request (7 to 9 minutes in the last five green runs) to run one 2-minute suite, sdk-test-python, whose Firehose compression delivery test needs the x86_64 snappy JNI library. Pull requests now build and test arm64 only. compat-partitions.yml, which already runs after each Nightly against the published floci/floci:nightly image, gains an amd64 sdk-test-python job in the commercial partition, so the amd64 half of the multi-arch image is still checked once a day, against the image users pull.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* chore(ci): keep the amd64 job's test results, and skip it on a single-region dispatch

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-19 17:06:52 -06:00
Hector Ventura 030ba3d72b chore(ci): run the EMR Docker runner test nightly, beside the cluster shrink check (#8957)
EmrDockerRunnerDockerIntegrationTest pulls a 3.5 GB image and took about 640 s of a passing pull request shard, so after #8903 moved its cluster shrink scenario to the nightly checks, the rest of the class follows as EmrDockerRunnerNightlyIntegrationTest. partition.sh no longer weighs it: SLOW_CLASSES comes from PARTITION_SLOW_CLASSES, empty by default, and test_partition.py passes its own. The standard nightly group has no room for it (339 of its 359 minutes), so the cluster-shrink group becomes docker-runner, with both classes in 42 minutes of bounds in a 62-minute job. On a pull request, the nightly checks now run only the nightly classes it adds or changes, or all of them when it changes the workflow.
2026-11-19 11:22:50 -04:00
Hector Ventura 9ea2f038f7 fix(ci): ship the darwin-amd64 binary to every Mac, built for Rosetta 2 (#8997)
* fix(ci): ship the darwin-amd64 binary to every Mac, built for Rosetta 2
2026-11-19 10:23:39 -04:00
Hector Ventura b0bed09bc6 chore(ci): pin the shared PR limit workflow, drop merge_group triggers, bound every job (#8960) 2026-11-19 10:19:33 -04:00