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

Added authorization and config warning #5

Merged
merged 1 commit into from Mar 16, 2021

Conversation

lzap
Copy link
Member

@lzap lzap commented Mar 15, 2021

Authorization was completely missing.

Also adding a warning comment to the example setting file.

I am gonna cut a new release with this patch.

Comment on lines 2 to 3
# Use of HTTPS only is strongly advised. Exposing shellhooks over http is
# technically possible but allows anyone to run things on your proxy.
Copy link
Member

Choose a reason for hiding this comment

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

Technically it doesn't allow anyone to run things, just those with a matching forward + reverse DNS that matches a name in trusted hosts. So if you have foreman.example.com, then when you connect from 192.0.2.1 then Smart Proxy will perform a reverse DNS lookup on that IP. If it finds foreman.example.com then it does a forward DNS lookup. If that finds 192.0.2.1, it is considered valid:
https://github.com/theforeman/smart-proxy/blob/fdeef1dc6febcfae22c8d3273cb18d6bdeb31a23/lib/sinatra/authorization.rb#L38

This calls remote_fqdn:

https://github.com/theforeman/smart-proxy/blob/fdeef1dc6febcfae22c8d3273cb18d6bdeb31a23/lib/proxy/helpers.rb#L81-L108

I would phrase it as

Suggested change
# Use of HTTPS only is strongly advised. Exposing shellhooks over http is
# technically possible but allows anyone to run things on your proxy.
# Use https for production deployments. http and true only make sense in development

Note that I explicitly used https in lower case since that's a valid value. I don't think HTTPS is accepted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok amended.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

@adamruzicka I suggested the wording so I'd appreciate it if you took a look as well.

@adamruzicka
Copy link

I'm fine with it. @ehelms was originally concerned about the wording, might be worth getting his approval too

Copy link
Member

@ehelms ehelms left a comment

Choose a reason for hiding this comment

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

Thanks for the consideration and addressing this!

@lzap
Copy link
Member Author

lzap commented Mar 16, 2021

Thanks all, that settles us with an improved message and also a security fix. I am merging and cutting a new release now.

@lzap lzap merged commit 35dafbf into theforeman:master Mar 16, 2021
@lzap lzap deleted the authorization branch March 16, 2021 12:36
@lzap
Copy link
Member Author

lzap commented Mar 16, 2021

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.

None yet

4 participants