-
Notifications
You must be signed in to change notification settings - Fork 190
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
CSRF breaks when changing the host:port #581
Comments
Hey @fortbridge, what exactly did you do to change the ports? The CSRF is all part of Django, and Django/CSRF doesn't look at the port used for the server. What matters is the CSRF token + related traffic makes it to the server. Also, what are the errors you see? What do the Django and nginx logs show after you make a request?
If you want to change the ports used for nginx, you must also update the nginx.conf. By default, nginx listens on 80 and 443, so prodction.yml exposes those ports. |
@chrismaddalena
these are the changes to production.yml:
and in the brwoser after login I get this
|
The nginx logs show the origin is untrusted. You changed the hostname to https://www.ghostwriter.wiki/getting-started/quickstart#customizing-the-domain-name-or-ip-address Also, if you're connecting via a web proxy, add your proxy as a trusted origin. That's covered in the section just below that one. Then, restart the containers with:
|
@chrismaddalena thanks, but I tried that as well, as mentioned in the first post and it didn't work. I've tried with both 'ghostwriter' and '*' and none of these worked. |
Let's revert your changes and try without changing the hostname. Are you able to connect? Usually, you only want to change the |
set all the configs to localhost, but still getting CSRF errors: correct, I try to map ghostwriter to my local ip so I can access it as https://ghostwriter:4443/. I really need to have this running on non-standard ports. |
fetched the latest version and re-did the test. Simply changing the ports in production.yml causes the following error:
this was the change
|
Describe the bug
A clear and concise description of what the bug is.
When exposing ports like 8080/4443 on the host the CSRF mitigations breaks everything
To Reproduce
Steps to reproduce the behavior:
in production.yaml change exposed ports on the host to 8080/4443
follow the intructions here:https://www.ghostwriter.wiki/getting-started/quickstart
to set allowhost, trustorigin, NGINX_HOST to "ghostwriter" for example
Expected Behavior
I'd expect d still be able to use the app
Screenshots
everytime I do a POST I get CSRF errors
Server Specs:
docker --version
anddocker-compose -v
]Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: