-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
The option "masterKeyIps" cannot be disabled #8421
Comments
Thanks for opening this issue!
|
I guess you'd need to specify IPv6 ranges separately. Could you try to set |
@alljinx Were you able to resolve this issue? |
Oh sorry, forgot this topic. I was able to make it work using |
Thanks for reporting back. I reopened to find out where this is actually a bug or only a docs issue. There should be 2 working solutions for the issue you described:
It seems you already verified that (a) works. Could you also verify (b), (c)? |
@mtrezza My original error was I was hosting the parse server on a LAN. Adding |
Thanks, that's strange. It reports an IPv6 address to not be allow-listed, but then it required an IPv4 CIDR range to allow-list it. If you don't mind trying it out:
|
Also, this is my serverURL: Server is running on Windows 10 x86_64 Pro. For testing the API, I used the postman client locally to send a request with |
I'll leave this issue open as there seems to be a bug in the parsing of IP addresses in |
Hi! I try to use parse-server 6.0.0 in docker, but have the same problem: which I can't resolve by adding maintenanceKeyIps: ['172.21.0.1'] to config. Any other ideas? |
@VKlapan |
Sorry, it is my misprint - of course, I had used masterKeyIps: [], but without effect. |
Could you copy/paste the log entry and the respective config you've set for Parse Server? Just to make sure. |
Useful hint! I have to check more carefully if a correct config are using, because a server works in docker container |
I understand that your issue has been resolved; we'll still keep this issue open since the OP issue still seems to exist. |
Yes! Thanks. All is ok |
@mtrezza what would be the fix here? Is the issue with the package ip-range-check? |
It could be that the package doesn't interpret IPv6 ranges properly. #8421 (comment) shows the log error mentions
|
@mtrezza |
I'm using dockers for dashboard and server, I tried to change this value with those you give here.
|
After adding masterKeyIps: ["0.0.0.0/0", "::/0"] the error is gone, but the master key stopped working. It gives no errors, just doesn't save with If I remove the masterKeyIps it gives the unauthorized error. |
@andreisucman which PR branch did you try out and which commit of that branch exactly? |
I guess it must be the To clarify I haven't changed the So, normally nothing should've gone wrong. |
The default is blocking all IPs except localhost. This makes sense since the masterkey should not be used outside of Cloud Cloud for security. It seems to me that the feature is working, but the confusion comes from how to define the IP list as env var, see #8421 (comment). So is this only a docs issue? |
Yes, I intend to disable this feature when I deploy my code to production, by setting FYI, I don't use master key to perform write. I used it for read. For any new codes that I add, I will try to avoid using master key. I will relook at old code to see if I can remove the use of master key. |
Do you mean |
Could you post the link here to the issue that you reported?
What do you mean with "some work" - are you referring to #8510 or has there been another PR? |
@andreisucman Please see #8510 (comment), I believe we should separate the "write" issue from the "connection" issue. We can only track issues for which a specific GitHub issue has been created; comments are unlikely to be tracked and may just fall out of focus in the flow of the conversation. |
@andreisucman We will try to reproduce the write issue internally to fix it; but to track and follow up on this, could you please open a new issue with all details, as I've mentioned in #8510 (comment)? |
@mtrezza My issue was related to some package I used for caching. I deleted my comments to avoid confusion. The ip detection works. |
Thanks, I'll reply in #8510. |
@alljinx @nebitrams @VKlapan @Artnforces @andreisucman @chillaxdev We would like to bring this issue to a closing. Could you please let us know:
|
For anyone who wants to allow any IP address to use the master key:
I've condensed this and amended the Parse Server options docs in #8814. If anyone is still facing issues after considering the above, please let us know. |
🎉 This change has been released in version 6.5.0-alpha.2 |
Personally still experiencing this issue with the latest version. I honestly think an option to disable the check completely would be the way to go, passing in IPs in different formats just isn't intuitive at all. |
@kantorcodes If you are experiencing any issues please open a new GitHub issue with a reference to this GitHub issue, and provide exact details so the issue can be reproduced. If it cannot be reproduced, then it cannot be fixed. |
I followed the exact steps suggested for IPv4 and IPv6 and deployed. Got the "unauthorized: master key required". That's all. Previous versions work fine. We should be able to turn this feature off. It is not intuitive at all. |
For anyone still experiencing this issue, please try |
🎉 This change has been released in version 6.5.0 |
🎉 This change has been released in version 7.0.0-beta.1 |
🎉 This change has been released in version 7.0.0 |
https://parseplatform.org/parse-server/api/master/ParseServerOptions.html It looks like the doc is still not updated |
New Issue Checklist
Issue Description
Parse-server 6.0.0 allow to restrict IPs than can use the MasterKey using the option "masterKeyIps".
The documentation says "Setting
['0.0.0.0/0']
means disabling the filter and the master key can be used from any IP address".In fact, even localhost is blocked.
Steps to reproduce
Juste install and configure Parse-Server v6 with the last Parse-Dashboard on your local machine.
Try to launch without the "masterKeyIps" option. Parse dashboard should works well.
Try with masterKeyIps: ['0.0.0.0/0'], after login, Parse Dashboard should display "Server not reachable: unauthorized: master key is required" and the node console should display "error: Request using master key rejected as the request IP address '::1' is not set in Parse Server option 'masterKeyIps'."
Actual Outcome
MasterKey is not usable anywhere with masterKeyIps: ['0.0.0.0/0']
Expected Outcome
MasterKey should be usable everywhere with masterKeyIps: ['0.0.0.0/0']
Environment
parse-server 6.0.0
parse-dashboard 5.0.0
Server
Database
Client
Logs
error: Request using master key rejected as the request IP address '::1' is not set in Parse Server option 'masterKeyIps'.
Error: unauthorized: master key is required
at handler (C:\GitProjects\jdm\node_modules\parse-server\src\middlewares.js:459:19)
at C:\GitProjects\jdm\node_modules\parse-server\src\PromiseRouter.js:72:20
at processTicksAndRejections (node:internal/process/task_queues:95:5)
The text was updated successfully, but these errors were encountered: