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

Fix Linting Errors #1835

Merged
merged 5 commits into from
Oct 21, 2022
Merged

Fix Linting Errors #1835

merged 5 commits into from
Oct 21, 2022

Conversation

devopstagon
Copy link
Contributor

@devopstagon devopstagon commented Oct 16, 2022

Description

Fixed linting errors. I also found a possible slowloris error and fixed that as well:

https://github.com/devopstagon/oauth2-proxy/blob/master/pkg/http/server.go#L189
https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6

Motivation and Context

I wanted to try and work on the Azure provider a bit, but I figured it would be a good idea to preemptively merge this into master first to have a "clean" base to work from.

How Has This Been Tested?

I ran make and also built an image and tested it in my environment.

Checklist:

  • [no] My change requires a change to the documentation or CHANGELOG.
  • [no] I have updated the documentation/CHANGELOG accordingly.
  • [no] I have created a feature (non-master) branch for my PR.

Signed-off-by: andrewphamade@gmail.com <andrewphamade@gmail.com>
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
@devopstagon devopstagon requested a review from a team as a code owner October 16, 2022 13:31
@devopstagon
Copy link
Contributor Author

Also fixes: #1646

@devopstagon
Copy link
Contributor Author

When it says make a non master branch does it mean on my fork?

@JoelSpeed
Copy link
Member

When it says make a non master branch does it mean on my fork?

Yes, typically we work from feature branches. There can sometimes be issues with the way our builds run if you PR from a branch called master, though I think they have been resolved now

Copy link
Member

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Quick question about one of the changes which looks like it could be a behaviour change, otherwise LGTM

@@ -186,7 +186,7 @@ func (s *server) Start(ctx context.Context) error {
// When the given context is cancelled the server will be shutdown.
// If any errors occur, only the first error will be returned.
func (s *server) startServer(ctx context.Context, listener net.Listener) error {
srv := &http.Server{Handler: s.handler}
srv := &http.Server{Handler: s.handler, ReadHeaderTimeout: time.Minute}
Copy link
Member

Choose a reason for hiding this comment

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

Where did this one come from?

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 mitigate a potential slowloris attack. https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6

I suppose we could make it configurable, but having this unset leaves the server vulnerable.

pkg/requests/result.go Show resolved Hide resolved
Signed-off-by: Andrew Hamade <andrewphamade@gmail.com>
@JoelSpeed JoelSpeed merged commit 7fe6384 into oauth2-proxy:master Oct 21, 2022
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.

2 participants