Skip to content

fix: tighten gosec file/dir permission findings - #1142

Draft
skevetter wants to merge 1 commit into
mainfrom
devsy/auto/2d3b5743
Draft

fix: tighten gosec file/dir permission findings#1142
skevetter wants to merge 1 commit into
mainfrom
devsy/auto/2d3b5743

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Task 2d3b5743-e3a5-4013-bc87-154fe3e07b1a.

Summary

  • Fix gosec G301: MkdirAll dirs now created with 0o750 (rstudio data folder, jetbrains download folder, platform client config dir)
  • Fix gosec G306: config files written with 0o600; rstudio db/server confs chowned to the server user so rserver (running via su <user>) keeps read access
  • Annotate internal-path os.Open calls with #nosec G304 where paths derive from the build context or install options; hoisted dockerignore path construction so suppression stays on a single line

Verification

  • golangci-lint run on all four touched packages: zero G301/G304/G306 findings remain (was 9); remaining scoped findings pre-exist on main
  • go test ./pkg/devcontainer/config/... ./pkg/copy/... pass; touched packages have no other test files
  • Full go test ./... failures (pkg/git, hack/sign_commit, e2e) reproduce identically on clean main — environmental, unrelated to this diff
  • task cli:format applied (golines stable)

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
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 78b0e61
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a8ecbeb6a74d900084f5b72

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 78b0e61
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a8ecbeb285b7d000865a754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant