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

Nginx security improvement #34

Open
kramos opened this issue May 23, 2017 · 0 comments
Open

Nginx security improvement #34

kramos opened this issue May 23, 2017 · 0 comments

Comments

@kramos
Copy link
Contributor

kramos commented May 23, 2017

I ran gixy on ADOP: https://github.com/yandex/gixy

It seems that adop-nginx/resources/configuration/sites-available/registry.conf has an area for improvement:

====================` Results ===================

>> Problem: [host_spoofing] The proxied Host header may be spoofed.
Description: In most cases "$host" variable are more appropriate, just use it.
Additional info: https://github.com/yandex/gixy/blob/master/docs/en/plugins/hostspoofing.md
Pseudo config:

include /etc/nginx/sites-enabled/registry.conf;

        server {
                server_name ~^registry*;

                location /v2/ {
                        proxy_set_header Host $http_host;
                }
        }

==================== Summary ===================
Total issues:
    Unspecified: 0
    Low: 0
    Medium: 1
    High: 0

I changed:

proxy_set_header Host $http_host;

to

proxy_set_header    Host                $host;

And it made gixy happy.

I wasn't sure how to test the docker registry with this change. Happy to test it and do a PR if anyone can suggest some test cases.

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

No branches or pull requests

1 participant