Skip to content

mpi: a peer image made before #1338 keeps the parent cohort's untagged cluster-key line in root's authorized_keys #1343

Closed

Description

@scttfrdmn

Follow-up to #1338 (fixed in the PR for branch fix/1338-1168-mpi-efa).

After that fix every spawn MPI cluster key carries the comment spawn-mpi-cohort, and installPubKeyCommand (pkg/mpicohort/assembler.go) replaces every line carrying it, so images made from now on are covered on every rank. Rank 0 also drops the line matching the /root/.ssh/id_rsa.pub it replaces, which covers a rank-0 image made by an earlier release.

Not covered: an image of a NON-zero rank made by a release before the fix. That peer's /root/.ssh/authorized_keys holds rank 0's public key as ssh-rsa AAAA... root@ip-10-... (ssh-keygen's default comment), the peer has no id_rsa.pub of its own to match against, and nothing on the instance distinguishes that line from a key the user added. So an instance launched from such an image (MPI or not) keeps authorizing the old cohort's key for root.

Evidence: worked out from the code (pkg/userdata/mpi.go key section; pkg/mpicohort/assembler.go installPubKeyCommand); not reproduced on AWS.

Options: spawn ami create (launcher.ImageStateCleanupScript) could strip root's cluster-key lines before the snapshot when the source carries spawn:job-array-* tags; or document that images of MPI peers from releases before the fix should be rebuilt. Exposure is bounded: it needs the old cohort's rank-0 private key, which lives only on that rank 0 and on images of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions