Skip to content

Commit

Permalink
fix: gosec: Expect file permissions to be 0600 or less
Browse files Browse the repository at this point in the history
  • Loading branch information
jhutar committed May 22, 2024
1 parent 0c82b90 commit 5161d36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/load-tests/pkg/logging/time_and_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func MeasurementsStop() {

// Append slice to a CSV file
func writeToCSV(outfile string, batch [][]string) error {
file, err := os.OpenFile(outfile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
file, err := os.OpenFile(outfile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)

Check failure

Code scanning / gosec

Potential file inclusion via variable Error test

Potential file inclusion via variable
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion tests/load-tests/pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (o *Opts) ProcessOptions() error {
}

// Dump options to JSON file in putput directory for refference
err3 := os.WriteFile(o.OutputDir + "/load-test-options.json", jsonOptions, 0644)
err3 := os.WriteFile(o.OutputDir + "/load-test-options.json", jsonOptions, 0600)
if err3 != nil {
return fmt.Errorf("Error writing to file: %v", err3)
}
Expand Down

0 comments on commit 5161d36

Please sign in to comment.