Skip to content

Log invalid http requests into oauth server #30

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

Merged
merged 3 commits into from
Oct 1, 2018

Conversation

gabrie30
Copy link
Contributor

Log HTTP requests to OAuth HTTP server #29

Description

This PR will provide more logging around invalid http requests into the oauth server.

Currently, if any 3rd party apps or plugins, such as wappalyzer, make the first request into oauth server the redirect cannot be handled and there are no logs indicating what is happening or how to fix.

In the case of wappalyzer it's sending a request to /robots.txt, which can be used to give users a useful debugging suggestion.

if req.RequestURI == "/robots.txt" {
fmt.Printf("** You may have an app or browser plugin that needs to be turned off **\n\n")
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just logging the issue won't avoid the server shutdown. Here we should return a 403 or 404 in those cases, but without using the badRequest method, as it will send a signal to stop the server.
We should also use os.Stderr to log those errors.

@maraino
Copy link
Collaborator

maraino commented Oct 1, 2018

I'm merging this as a first pass to resolve the issue. It's more informative than what we currently have.

@maraino maraino merged commit 2609703 into smallstep:master Oct 1, 2018
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