-
-
Notifications
You must be signed in to change notification settings - Fork 950
feat(graphql): more security : with max query depth and max query complexity #6859
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
Conversation
|
Really important for avoid dos attack |
|
🤔 Hmm, the scenario "Introspect the GraphQL schema" from |
I changed the value in |
258f72b to
940b169
Compare
soyuka
left a comment
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.
Nice one, just a few comments, thanks for this addition!
| // 'datetime_format' => \DateTimeInterface::RFC3339 | ||
| ] | ||
| ], | ||
| ]; |
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.
I see this file modified but it looks like cs fixes that I should probably do in another PR. Would you be able to add the configuration at https://github.com/api-platform/core/blob/main/src/Laravel/ApiPlatformProvider.php#L1295 as well?
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.
Yes, cs fixer did it :)
…o 500 Set max query depth to 200 in test AppKernel, it's required for introspection.feature
d7eb6cd to
8862596
Compare
1ab86e4 to
ee4c125
Compare
…max query complexity
|
@soyuka I have some failed on behat's tests (features/hydra/docs.feature:10), but I don't know why |
|
Thanks! |
On our GraphQL APi, we run GraphQL COP and it's detected some security leak.
So I tried to fix some of this like "Alias overloading" and "Field Duplication".
Webonyx has this following rules : QueryComplexity and QueryDepth. So I implemented this on Api Platform to be configurable in api_platform.yml. And setted by default to 100