Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore warning of the latest gosec tool #138

Merged
merged 1 commit into from Oct 18, 2021

Conversation

isimluk
Copy link
Contributor

@isimluk isimluk commented Oct 18, 2021

This looks like a possible false positives, at least until we learn more at securego/gosec#714

Addressing:

[/github/workspace/examples/falcon_sensor_download/main.go:104-108] - G307 (CWE-703): Deferring unsafe method "Close" on type "*os.File" (Confidence: HIGH, Severity: MEDIUM)
    103: 	}
  > 104: 	defer func() {
  > 105: 		if err := file.Close(); err != nil {
  > 106: 			fmt.Fprintf(os.Stderr, "Error closing file: %s\n", err)
  > 107: 		}
  > 108: 	}()
    109:

@redhatrises
Copy link
Collaborator

I would expect gosec to pass now... am I wrong?

This looks like a possible false positives, at least until we learn more at
securego/gosec#714

Addressing:
[/github/workspace/examples/falcon_sensor_download/main.go:104-108] - G307 (CWE-703): Deferring unsafe method "Close" on type "*os.File" (Confidence: HIGH, Severity: MEDIUM)
    103: 	}
  > 104: 	defer func() {
  > 105: 		if err := file.Close(); err != nil {
  > 106: 			fmt.Fprintf(os.Stderr, "Error closing file: %s\n", err)
  > 107: 		}
  > 108: 	}()
    109:
@isimluk
Copy link
Contributor Author

isimluk commented Oct 18, 2021

I would expect gosec to pass now... am I wrong?

Indeed.

@redhatrises redhatrises merged commit d5461e5 into CrowdStrike:main Oct 18, 2021
@isimluk isimluk deleted the gosec-ignore branch October 19, 2021 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants