Repository navigation
Keep ~/.spawn and DCV session pages owner-only (#1593) - #1615
Merged
Merged
Conversation
The session page embeds the DCV session token. #1603 made new pages 0600 and the sessions directory 0700, but ~/.spawn itself was still created 0755 by spawn cleanup's log, and pages older releases wrote stayed 0644. spawnHomeSubdir creates and tightens ~/.spawn and the subdirectory to 0700; getSessionsDir tightens existing pages to 0600; the sweeps state dir and the cleanup log follow.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 #1593
What
#1603 already made a new DCV session page 0600 and
~/.spawn/sessions0700. Three gaps remained, and this PR closes them:~/.spawnitself was created 0755 byspawn cleanup's log, and MkdirAll never changes an existing parent. A newspawnHomeSubdircreates~/.spawnand the subdirectory 0700, and tightens either to 0700 when it is looser. The chmod skips symlinks and is best-effort.getSessionsDirnow tightens every*.htmlin the directory to 0600.~/.spawn/sweeps, 0755) and the cleanup log (0644) were looser than needed. Both are now owner-only.Tests
TestSessionFilesAreOwnerOnly: an old 0755/0644 layout ends up 0700/0600, and a new page is 0600. I watched it fail with the tighten step disabled.TestCleanupLogKeepsSpawnHomeOwnerOnly.This PR changes only local files on the CLI host. There is no user-data, bootstrap, IAM or spored change.
Live check (optional, local only)
chmod 755 ~/.spawn ~/.spawn/sessions; chmod 644 ~/.spawn/sessions/*.html.spawn app launch <DCV app> --ttl 15m, orspawn app listif it opens the sessions directory.stat -c '%a %n' ~/.spawn ~/.spawn/sessions ~/.spawn/sessions/*should show 700, 700 and 600.