-
-
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
Add security check #7247
Add security check #7247
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7247 +/- ##
==========================================
+ Coverage 94.04% 94.06% +0.02%
==========================================
Files 172 179 +7
Lines 12970 13148 +178
==========================================
+ Hits 12197 12368 +171
- Misses 773 780 +7
Continue to review full report at Codecov.
|
Thanks for picking this up. You’ve taken this to another level that I couldn’t have imagined. I haven’t looked through it with much detail yet but it looks great, can’t wait to use in the next version. Feel free to remove me from the changelog, this is your fantastic work 👍 |
Thanks @dblythy, I think it would be beneficial to have you in the changelog because we did a lot of brainstorming together in preparation for this and you have an understanding what this is about, which may be helpful if someone looks for points of contact in the changelog. If you want to be removed I would do that of course. I think you talked about adding a Parse Dashboard page to display these checks. It would be amazing to see these checks in a nice UI. If you already had some thoughts about it and have some requirements regarding the report schema (see example above), I can add this in before merging. I opened parse-community/parse-dashboard#1665 for this. |
224cd86
to
c182c21
Compare
c182c21
to
02875da
Compare
@davimacedo, @dplewis, this is ready for review, again as summary: It contains only some sample checks, but the main purpose of this PR is to:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Very clean
* added Parse Server security option * added SecurityRouter * added Check class * added CheckGroup class * moved parameter validation to Utils * added CheckRunner class * added auto-run on server start * added custom security checks as Parse Server option * renamed script to check * reformat log output * added server config check * improved contributing guideline * improved contribution guide * added check security log * improved log format * added checks * fixed log fomat typo * added database checks * fixed database check * removed database auth check in initial version * improved contribution guide * added security check tests * fixed typo * improved wording guidelines * improved wording guidelines
🎉 This change has been released in version 5.0.0-beta.1 |
Hi,
The problem that I don't see anything in the log, moreover posting to /parse/security returns: "Cannot POST /parse/security" What I have missed, how can debug it ? |
Answering to myself, if someone will land here: Should it be added to docs? |
Sure, please open a PR with the suggested changes. |
🎉 This change has been released in version 5.0.0 |
New Pull Request Checklist
Issue Description
Adds security check for Parse Server.
Related issue: closes #7246
Approach
Adds a modularized feature to run pre-defined checks to identify weak security settings across Parse Server.
Features:
https://example.com/parse/security
that returns the security report in JSON format for automatic processing or display in the Parse Dashboard.Implementation:
SecurityRouter
with masterKey enforcement for the/security
endpointExample configuration
Example output
Report Schema
The report returned by the
/security
endpoint follows this schema:It includes the report version to implement other report schemas in the future. The report request can include the requested schema version, this way a schema change does not lead to a breaking change and multiple schemas can be offered in parallel, making it easier to follow a phased deprecation policy.
Adding checks
The modular implementation should make it easy for a developer to add new tests when submitting a PR for a new feature. In addition to the feature itself, developers already spend time writing tests and docs. The security checks implementation is designed to require minimal effort in an intuitive interface.
To add a new test:
./Security/CheckGroups/
to see whether there is an existingCheckGroup[Category].js
file of the category to which the test belongs (Database, Server configuration, etc.)../Security/CheckGroups/CheckGroup[Category].js
file and add the tests:./Security/CheckGroups/CheckGroups.js
, which the collector that merges all check groups:Custom security checks
The security checks can be fully customized, by reusing all or only some of the built-in check groups and adding custom check groups. A custom check group collector can be passed into the Parse Server configuration:
Possible future extensions
Side effects:
Utils.getObjectKeyPermutations
Utils.validateParams
Credits
Based on the idea by @davimacedo
Thanks to @dblythy for the initiative in #6973 to keep the discussion around this idea alive
TODOs before merging