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

Update args for gosec, with no args it runs the -h option #47

Merged
merged 6 commits into from
Feb 3, 2022

Conversation

randeepdell
Copy link
Contributor

@randeepdell randeepdell commented Jan 31, 2022

Description

By default gosec expects args without it it defaults to -h option and lists the way to run gosec and does not run any actual test.

Excluded G304 for the below, which seems a valid change needed.
[/github/workspace/service/service.go:561] - G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM)

561: configBytes, err := ioutil.ReadFile(isilonConfigFile)

Made changes to address the below,
Addressed other issues.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#128

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Built the image and tested creation of sc, pvc and pod.
  • Testing actions via PR

prablr79
prablr79 previously approved these changes Feb 1, 2022
Copy link
Collaborator

@prablr79 prablr79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@randeepdell randeepdell requested a review from prablr79 February 1, 2022 13:44
@@ -622,7 +623,8 @@ func (s *service) getNewIsilonConfigs(ctx context.Context, configBytes []byte) (
}

newIsiClusters := make(map[interface{}]interface{})
for i, config := range inputConfigs.IsilonClusters {
for i, clusterConfig := range inputConfigs.IsilonClusters {
config := clusterConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why introduce one more variable? either use config or clusterConfig, and remove one of these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to address the below,
[/github/workspace/service/service.go:664] - G601 (CWE-118): Implicit memory aliasing in for loop. (Confidence: MEDIUM, Severity: MEDIUM)

664: config.isiSvc, _ = s.GetIsiService(clientCtx, &config, logLevel)

@randeepdell randeepdell merged commit 11c0953 into main Feb 3, 2022
@randeepdell randeepdell deleted the update-gosec-with-args branch July 6, 2022 10:17
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.

3 participants