plugin/in_http: recognize CSP reports as JSON data - #4282
Conversation
To make it easy to use fluentd for CSP reporting, let's parse retrieved data as JSON if the content type is `application/csp-report`. It is guaranteed to be a well formatted JSON according to the specification. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
daipom
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
I'm not familiar with Content Security Policy, but I understand it has a feature to send reports.
This fix is to allow the reports to be received by in_http plugin, right?
| events = [ | ||
| ["tag1", time, {"a"=>1}], | ||
| ["tag2", time, {"a"=>2}], | ||
| ] |
There was a problem hiding this comment.
It would be better that the test contents contain actual syntax of CSP report:
There was a problem hiding this comment.
It's a trivial thing, no need to block merging.
|
This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days |
|
This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days |
|
Thanks for your contribution! |
Need to add `application/x-ndjson` and `application/csp-report`. Related: * fluent/fluentd#3616 * fluent/fluentd#4282 Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
Need to add `application/x-ndjson` and `application/csp-report`. Related: * fluent/fluentd#3616 * fluent/fluentd#4282 Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
To make it easy to use fluentd for CSP reporting, let's parse retrieved data as JSON if the content type is
application/csp-report. It is guaranteed to be a well-formatted JSON according to the specification: https://www.w3.org/TR/CSP2/#violation-reports.