Repository navigation
No world-open SSH on the DCV, web and MPI groups (#1596) - #1614
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
|
Live check (spore-host-dev, 2026-11-13). The build integrated #1612, #1613, #1614 and #1616 on main.
Not run live: Windows (#1617), the egress proxy (#1618), the release manifest (#1619), retiring a reused DCV/MPI group, and interactive |
This was referenced Nov 13, 2026
spawn-dcv, spawn-web and spawn-mpi-* opened tcp/22 to 0.0.0.0/0. spawn connect never needed it: it uses SSM when no group admits SSH, and MPI's node-to-node SSH is covered by the self rule. New groups open no SSH; a reused group loses exactly the world-open rule an older spawn wrote (narrower SSH rules stay; failure is a warning). spawn app launch refuses an existing spawn-dcv/spawn-web group not tagged spawn:managed=true, since those fixed names could be pre-created by anyone able to create a group in the account. Substrate keeps no SG tags (substrate#1440) and revokes every range of a multi-range permission (substrate#1453, filed); tests work around both, named.
scttfrdmn
marked this pull request as ready for review
November 13, 2026 22:51
scttfrdmn
force-pushed
the
fix/1596-sg-ssh
branch
from
November 13, 2026 22:51
b9ddca6 to
03dd5f4
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1596
What
spawn-dcv(DCV apps and desktops),spawn-web(web apps) andspawn-mpi-*(MPI job arrays) no longer get atcp/22 0.0.0.0/0rule. The DCV and web groups keep only 8443 and 443. The MPI group keeps only its all-traffic self rule, which also covers mpirun's node-to-node SSH.retireWorldSSHrevokes exactly the tcp/22 rule from0.0.0.0/0/::/0. A narrower SSH rule (e.g. a user's/32) stays. If the revoke fails, spawn prints a warning and still launches.spawn-dcvandspawn-webare adopted only if they are taggedspawn:managed=true. spawn has tagged both at creation since they were added. The cluster groups (spawn-mpi-<array>,spawn-efa-<name>) are joined by a caller-chosen name on purpose, so they are not held to this.spawn connectalready picks SSM when no attached group admits tcp/22 (linuxConnectTransport, Plain Linux spawn launch into a default VPC waits 2 min for SSH and fails: only the VPC default SG is attached, and it has no port-22 rule #1296), so it keeps working with no change: interactive sessions, one-shot commands, and DCV's--session-manager. For direct SSH, attach your own group with--security-group-ids. A shared per-VPC group is the wrong place for a per-caller CIDR, because each caller's rule would accumulate there.Tests
TestManagedGroupsOpenNoSSH(substrate): no tcp/22 ingress on any of the three groups. I watched it fail when I re-added the web rule.TestReusedManagedGroupLosesWorldSSH: the world rule goes and the narrower rule stays. I watched it fail when I disabled the retire step.TestUnmanagedGroupOfTheSameNameIsRefused,TestRequireSpawnManagedGroup,TestWorldSSHPermissions.docs/reference/cli-iam-actions.mdregenerated.spawn app launchnow callsec2:RevokeSecurityGroupIngress, whichspawn launchalready needed, so the user baseline is unchanged.There is no IAM, user-data or spored change.
Live checks needed before merge (owner)
Run in 435415984226, with
--ttl 15mon every launch.spawn-dcvgroup (with22 0.0.0.0/0), runspawn app launch <a DCV app> --ttl 15m.aws ec2 describe-security-groups --group-ids <sg> --region us-east-1: 8443 tcp/udp only.spawn connect <name>opens the DCV session, andspawn connect <name> --session-managergives a shell.spawn-webwith a web app (e.g. code-server). Expect 443 only, the app loads, andspawn connectlands in an SSM shell.--count 2 --mpi --ttl 15m).mpirunacross both nodes works.spawn connect <array>-0works over SSM.spawn-dcv, create an untaggedspawn-dcvgroup by hand.spawn app launchmust refuse it, naming the group. Delete the hand-made group afterwards.