Security Fix: Correct directory permissions in logs_download.go (Alerts #461, #460)#8855
Merged
Security Fix: Correct directory permissions in logs_download.go (Alerts #461, #460)#8855
Conversation
…download.go Fixes alerts #461 and #460 by using more restrictive directory permissions (owner+group only) instead of world-readable permissions. This follows the principle of least privilege for log artifact directories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Security Fix: Incorrect Directory Permissions
Alert Numbers: #461, #460
Severity: Medium
Rule: G301 - Expect directory permissions to be 0750 or less
File: pkg/cli/logs_download.go (lines 153, 160)
Vulnerability Description
The security scanner identified that directories were being created with overly permissive permissions (0755), which allows world-readable access. This violates the principle of least privilege and could potentially expose sensitive log data to unauthorized users on shared systems.
Affected locations:
os.MkdirAll(destPath, 0755)- when creating artifact directoriesos.MkdirAll(filepath.Dir(destPath), 0755)- when creating parent directories for filesFix Applied
Changed directory permissions from
0755to0750in both locations within theflattenUnifiedArtifactfunction:Before:
After:
Security Best Practices Applied
Permission Breakdown
rwxr-xr-x- Owner: read/write/execute, Group: read/execute, Others: read/executerwxr-x---- Owner: read/write/execute, Group: read/execute, Others: no accessTesting Considerations
go build ./pkg/cli/...Impact
This is a security-only fix with no functional changes:
Files Modified
pkg/cli/logs_download.go: Changed directory permissions from 0755 to 0750 (lines 153, 160)🤖 Generated by gh-aw security fix agent
Triggered by:
@pelikhanWorkflow Run: #20689975139