fix: tighten gosec file/dir permission findings - #1142
Draft
skevetter wants to merge 1 commit into
Draft
Conversation
Fix gosec G301/G304/G306 findings flagged in pkg/ide/rstudio/rstudio.go, pkg/ide/jetbrains/generic.go, pkg/platform/client/client.go, and pkg/devcontainer/config/prebuild.go: - MkdirAll dirs with 0o750 instead of os.ModePerm/0o755 (G301) - WriteFile configs with 0o600 instead of os.ModePerm; chown rstudio db/server confs to the server user so it keeps read access (G306) - platform client config written 0o660 -> 0o600 (G306) - annotate internal-path os.Open calls with #nosec G304 where paths derive from build context or install options
✅ Deploy Preview for images-devsy-sh canceled.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for devsydev canceled.
|
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.
Task 2d3b5743-e3a5-4013-bc87-154fe3e07b1a.
Summary
MkdirAlldirs now created with0o750(rstudio data folder, jetbrains download folder, platform client config dir)0o600; rstudio db/server confs chowned to the server user so rserver (running viasu <user>) keeps read accessos.Opencalls with#nosec G304where paths derive from the build context or install options; hoisted dockerignore path construction so suppression stays on a single lineVerification
golangci-lint runon all four touched packages: zero G301/G304/G306 findings remain (was 9); remaining scoped findings pre-exist on maingo test ./pkg/devcontainer/config/... ./pkg/copy/...pass; touched packages have no other test filesgo test ./...failures (pkg/git, hack/sign_commit, e2e) reproduce identically on clean main — environmental, unrelated to this difftask cli:formatapplied (golines stable)