Skip to content

Conversation

@rodolforeitz
Copy link

@rodolforeitz rodolforeitz commented Feb 14, 2025

gosec -fmt=sonarqube -exclude-generated -out secreport.json ./...

after

{
	"issues": []
}

before:

{
	"issues": [
		{
			"engineId": "gosec",
			"ruleId": "G304",
			"primaryLocation": {
				"message": "Potential file inclusion via variable",
				"filePath": "parser/pkgpath.go",
				"textRange": {
					"startLine": 114,
					"endLine": 114
				}
			},
			"type": "VULNERABILITY",
			"severity": "MAJOR",
			"effortMinutes": 5
		},
		{
			"engineId": "gosec",
			"ruleId": "G306",
			"primaryLocation": {
				"message": "Expect WriteFile permissions to be 0600 or less",
				"filePath": "bootstrap/bootstrap.go",
				"textRange": {
					"startLine": 215,
					"endLine": 215
				}
			},
			"type": "VULNERABILITY",
			"severity": "MAJOR",
			"effortMinutes": 5
		},
		{
			"engineId": "gosec",
			"ruleId": "G103",
			"primaryLocation": {
				"message": "Use of unsafe calls should be audited",
				"filePath": "jlexer/bytestostr.go",
				"textRange": {
					"startLine": 20,
					"endLine": 20
				}
			},
			"type": "VULNERABILITY",
			"severity": "MINOR",
			"effortMinutes": 5
		},
		{
			"engineId": "gosec",
			"ruleId": "G103",
			"primaryLocation": {
				"message": "Use of unsafe calls should be audited",
				"filePath": "helpers.go",
				"textRange": {
					"startLine": 47,
					"endLine": 47
				}
			},
			"type": "VULNERABILITY",
			"severity": "MINOR",
			"effortMinutes": 5
		},
		{
			"engineId": "gosec",
			"ruleId": "G103",
			"primaryLocation": {
				"message": "Use of unsafe calls should be audited",
				"filePath": "buffer/pool.go",
				"textRange": {
					"startLine": 55,
					"endLine": 55
				}
			},
			"type": "VULNERABILITY",
			"severity": "MINOR",
			"effortMinutes": 5
		},
		{
			"engineId": "gosec",
			"ruleId": "G104",
			"primaryLocation": {
				"message": "Errors unhandled",
				"filePath": "gen/generator.go",
				"textRange": {
					"startLine": 78,
					"endLine": 78
				}
			},
			"type": "VULNERABILITY",
			"severity": "MINOR",
			"effortMinutes": 5
		},
		{
			"engineId": "gosec",
			"ruleId": "G104",
			"primaryLocation": {
				"message": "Errors unhandled",
				"filePath": "bootstrap/bootstrap.go",
				"textRange": {
					"startLine": 199,
					"endLine": 199
				}
			},
			"type": "VULNERABILITY",
			"severity": "MINOR",
			"effortMinutes": 5
		}
	]
}

@rodolforeitz rodolforeitz changed the base branch from master to main February 14, 2025 20:00
Copy link

@yoursnerdly yoursnerdly left a comment

Choose a reason for hiding this comment

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

Can you please fix the workflow file so it triggers on PR/push to main?

return err
}
return ioutil.WriteFile(g.OutName, out, 0644)
return ioutil.WriteFile(g.OutName, out, 0644) // #nosec G306 -- Auto code generation.

Choose a reason for hiding this comment

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

Suggested change
return ioutil.WriteFile(g.OutName, out, 0644) // #nosec G306 -- Auto code generation.
return ioutil.WriteFile(g.OutName, out, 0644) // #nosec G306 -- autogenerated code file, 0644 is fine.

Copy link
Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

yes, I understand that.

Choose a reason for hiding this comment

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

I meant that the file being written here is autogenerated code file.

Choose a reason for hiding this comment

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

We can delete the step test-non-amd64 as we don't use the library on anything other than amd64. The check is failing and it does not seem worthwhile to invest time in it.

Copy link
Author

Choose a reason for hiding this comment

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

@rodolforeitz rodolforeitz merged commit 51ffa73 into main Feb 14, 2025
3 checks passed
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