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

Linter: gosec, Rule: G102 - Bind to all interfaces. Should we enable it? #12890

Closed
zak-pawel opened this issue Mar 18, 2023 · 2 comments · Fixed by #12976
Closed

Linter: gosec, Rule: G102 - Bind to all interfaces. Should we enable it? #12890

zak-pawel opened this issue Mar 18, 2023 · 2 comments · Fixed by #12976
Labels

Comments

@zak-pawel
Copy link
Collaborator

zak-pawel commented Mar 18, 2023

Use Case

This issue starts discussion about enabling:

Rule is mapped to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.

Expected behavior

Decision if rule should be enabled or not.

Actual behavior

For this rule following findings were found in current code:

plugins/common/proxy/socks5_test.go:23:12                    gosec  G102: Binds to all network interfaces
plugins/inputs/kafka_consumer/kafka_consumer_test.go:595:19  gosec  G102: Binds to all network interfaces
plugins/inputs/x509_cert/x509_cert_test.go:86:15             gosec  G102: Binds to all network interfaces

All of them are in tests (can be muted by //#nosec comment). But maybe it is worth to enable it to avoid such bindings in production code?

Additional info

For this rule no additional configuration can be provided.

@zak-pawel zak-pawel added feature request Requests for new plugin and for new features to existing plugins needs design review labels Mar 18, 2023
@Hipska
Copy link
Contributor

Hipska commented Mar 21, 2023

Could we fix the tests to not listen to all interfaces?

@powersj
Copy link
Contributor

powersj commented Mar 21, 2023

I think #12923 should do it, no?

This one sounds worth adding - if only to keep our tests consistent as well

@zak-pawel zak-pawel added linter and removed feature request Requests for new plugin and for new features to existing plugins needs design review labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants