Skip to content

FarSSH 1.0.0: harden image/IAM and move to a v1 image tag - #2

Merged
apparentorder-bot merged 16 commits into
mainfrom
cursor/drop-rsa-host-key-1c40
Sep 3, 2026
Merged

FarSSH 1.0.0: harden image/IAM and move to a v1 image tag#2
apparentorder-bot merged 16 commits into
mainfrom
cursor/drop-rsa-host-key-1c40

Conversation

@apparentorder-bot

@apparentorder-bot apparentorder-bot commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Harden the FarSSH image, IAM, and client packaging after the security review of v0.6.1. Version 1.0.0; the moving image tag is :v1.

Image and SSH

  • Drop RSA host keys; Ed25519 only. Document that the host private key is still passed via the ECS RunTask override (only useful with an active MITM of that handshake).
  • PasswordAuthentication no
  • apk add --no-cache openssh
  • Install the Ed25519 host key with printf | base64 -d instead of eval

IAM and ECS Exec

  • Empty default FarSshTaskRole; FarSshExecTaskRole holds the SSM policy and is used only with --execute-command
  • SSM setattr allowlist: public_subnets, security_group, ssh_port, force_public_ipv4, exec_task_role_arn
  • Execution role: logs on /ecs/farssh/${suffix}:* only (no AmazonECSTaskExecutionRolePolicy)
  • Trust on execution and both task roles: SourceAccount plus ArnLike arn:…:ecs:region:account:* (a cluster ARN is not supported by ECS assume-role)

Image tags and CI

  • CloudFormation default public.ecr.aws/apparentorder/farssh:v1 (moving tag for patched sshd). AllowedValues are the v1 ECR Public and Docker Hub URIs only.
  • CI pushes $VERSION, :v1, and :latest
  • Actions SHA-pinned; PyPI trusted publishing on v* tags

Packaging

  • Copy the repo README.md into client/ in a thin PEP 517 backend so hatchling 1.32+ is happy, then pin hatchling>=1.24,<2 instead of <1.32.
Open in Web Open in Cursor 

cursoragent and others added 16 commits September 2, 2026 21:08
Ed25519 is the only host key now. The host private key still goes to the
task as an environment override; the README caveat records that this is
visible via the ECS API and only useful with an active MITM of the one
SSH handshake.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
Append PasswordAuthentication no so sshd does not offer password
auth even if Alpine defaults change.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
The default task role no longer has the SSM managed policy. --execute-command
enables Exec and overrides the task role to FarSshExecTaskRole; the flag is
applied after SSM so a parameter cannot turn Exec on.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
--execute-command on a stack that has not been updated still enables Exec
and uses the existing task role, which already has the SSM policy.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
Only public_subnets, security_group, ssh_port, force_public_ipv4, and
exec_task_role_arn are copied from Parameter Store.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
CloudFormation now uses :v0 so one-shot stacks pick up rebuilt images
(including sshd patches) on the next task. CI publishes :v0 alongside the
version tag, weekly plus workflow_dispatch. Dependabot watches the
Dockerfile. The S3 template no longer substitutes a frozen version.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
Existing stacks that pull :latest should still receive rebuilt images.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
Dependabot already watches github-actions (security updates only) and
will refresh these pins.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
publish-pypi.yaml builds the client package and uploads via OIDC when a
v* tag is pushed. No environment, matching the PyPI publisher setup.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
The entrypoint only supports FARSSH_SSH_HOST_ED25519_KEY_BASE64 now that
RSA host keys are gone.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
Replace AmazonECSTaskExecutionRolePolicy with logs on
/ecs/farssh/${suffix} only. Trust policies require aws:SourceArn on
cluster/farssh as well as SourceAccount.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
apk add --no-cache so the image does not keep the package index.
hatchling is pinned to >=1.24,<1.32 because 1.32 rejects a readme path
outside the project directory (this package uses ../README.md).

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
hatchling 1.32 rejects a readme path outside the project directory, so
the PEP 517 backend copies ../README.md into client/ before delegating
to hatchling. That lets the hatchling pin stay at >=1.24,<2.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
Both services have dual-stack endpoints now. Fargate in a dual-stack
subnet still uses IPv4 for registry and awslogs calls, with no
task-definition switch, so Docker Hub and disabling awslogs remain
the no-public-IPv4 path.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
The compatible image line is :v1 (weekly sshd rebuilds). CloudFormation
AllowedValues are only the v1 ECR Public and Docker Hub URIs.

Co-authored-by: apparentorder-bot <apparentorder-bot@users.noreply.github.com>
@cursor cursor Bot changed the title Harden FarSSH: drop RSA keys, tighten IAM, and un-pin hatchling FarSSH 1.0.0: harden image/IAM and move to a v1 image tag Sep 3, 2026
@apparentorder-bot
apparentorder-bot marked this pull request as ready for review September 3, 2026 21:22
@apparentorder-bot
apparentorder-bot merged commit 79adbd1 into main Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants