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

Enable gosec as a linter and resolve potential security issues #1259

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

saswatamcode
Copy link
Member

Enable gosec as linter and resolve certain potential security issues. Should also fix sonarcloud checks.

Copy link
Contributor

@douglascamata douglascamata left a comment

Choose a reason for hiding this comment

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

Just a small question about something I've seen in two places, otherwise LGTM.

Addr: o.Listen,
Handler: handlers,
ReadHeaderTimeout: 1 * time.Second,
ReadTimeout: 5 * time.Second,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a good value? Why is the write timeout so much bigger?

Copy link
Member Author

Choose a reason for hiding this comment

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

Tbh, I copied this verbatim from obs API. I think the write timeout was bigger due to Loki stuff there.
Over here, I guess it will be remote write request to Obs API.

But yeah I can make both the same if you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm mostly worried about the read timeout being so low than the write timeout being too big. Maybe we could bump the read timeout to something like 15s and the read header one to 5s? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Addr: cfg.listenAddress,
Handler: handlers,
ReadHeaderTimeout: 1 * time.Second,
ReadTimeout: 5 * time.Second,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question about the big difference between read and write timeout.

Signed-off-by: Saswata Mukherjee <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
11.1% 11.1% Duplication

@saswatamcode
Copy link
Member Author

/retest

Copy link
Contributor

@douglascamata douglascamata left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Oct 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: douglascamata, saswatamcode

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [douglascamata,saswatamcode]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot merged commit f7668a0 into stolostron:main Oct 17, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants