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

Default CLPs for new classes to disallow public read/write #8823

Open
3 tasks done
johanarnor opened this issue Nov 22, 2023 · 4 comments
Open
3 tasks done

Default CLPs for new classes to disallow public read/write #8823

johanarnor opened this issue Nov 22, 2023 · 4 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@johanarnor
Copy link

Current Limitation

The current behaviour when adding a new class via the Parse dashboard is that new classes are created with public read and write permissions in the CLP. This introduces the risk of forgetting to change them which in turn can lead to data leakage and data corruption.

I've searched in the documentation and previous issues, but I have not found a solution or a similar issue discussing this. If there is, please point me in the right direction!

Feature / Enhancement Description

I think the best way would probably be to always default to no permissions at all, and let the developer choose what read and write operations to allow and for what role. Sure, it's an extra step compared to public read/write which allows everything, but it's at the same time much easier to adapt your code in the beginning to use either sessionToken or masterKey where appropriate, rather than changing the permissions a while later and going through your code to find the places where you might have missed it.

If it's not feasible to have as a default, it could be added as a configuration option.

Thanks in advance! 🙏

Copy link

Thanks for opening this issue!

@mtrezza
Copy link
Member

mtrezza commented Feb 15, 2024

Is that a Parse Server or Parse Dashboard issue? From your description I'd assume a Parse Dashboard issue, or is there a default behavior when creating a new class in code that you'd like to change as well?

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Feb 15, 2024
@johanarnor
Copy link
Author

Hi and thanks for your reply! I think this can be solved in a few ways with different severity regarding the breaking nature of the changes.

  • Include a default CLP from Parse Dashboard. As a developer it would still be possible to create public classes by misstake from code though.
  • Set a "private CLP" if it's not included when creating a class in Parse Server.
  • Treat a missing CLP as a "private CLP" for all classes. This is of course the most breaking alternative, since it will change permissions on already created classes. But also the most secure since I suspect that many users of Parse Server can have public accessible classes without thinking about it. This is what we did for our deployment with a simple code change of the following line
    const defaultCLPS = Object.freeze({

As I mentioned before this could also be behind an environment variable or something as well.

What do you think?

@mtrezza
Copy link
Member

mtrezza commented Feb 15, 2024

Any breaking changes that involve data migration (as opposed to just app code adaptation) come with a significant cost for developers that would have to be justified by an even greater benefit. I don't see this as given with the facts currently known about issue at hand.

I'd say that a solution can either involve the Dashboard creating a class with a more restrictive default CLP, or the code for creating classes getting a more restrictive new default behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants