Skip to content

plugin/in_http: recognize CSP reports as JSON data - #4282

Merged
ashie merged 1 commit into
fluent:masterfrom
GiedriusS:recognize_csp
Apr 30, 2024
Merged

plugin/in_http: recognize CSP reports as JSON data#4282
ashie merged 1 commit into
fluent:masterfrom
GiedriusS:recognize_csp

Conversation

@GiedriusS

Copy link
Copy Markdown
Contributor

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.

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 daipom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +524 to +527
events = [
["tag1", time, {"a"=>1}],
["tag2", time, {"a"=>2}],
]

@ashie ashie Sep 5, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better that the test contents contain actual syntax of CSP report:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a trivial thing, no need to block merging.

@github-actions

github-actions Bot commented Oct 5, 2023

Copy link
Copy Markdown

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

@github-actions github-actions Bot added the stale label Oct 5, 2023
@ashie ashie removed the stale label Oct 10, 2023
@github-actions

github-actions Bot commented Nov 9, 2023

Copy link
Copy Markdown

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

@github-actions github-actions Bot added the stale label Nov 9, 2023
@daipom daipom removed the stale label Nov 9, 2023
@ashie ashie added the enhancement Feature request or improve operations label Nov 9, 2023
@ashie ashie added this to the v1.17.0 milestone Nov 9, 2023
@ashie
ashie merged commit 2faeb04 into fluent:master Apr 30, 2024
@ashie

ashie commented Apr 30, 2024

Copy link
Copy Markdown
Member

Thanks for your contribution!
I'm sorry for delaying merge.

daipom added a commit to fluent/fluentd-docs-gitbook that referenced this pull request May 15, 2024
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>
daipom added a commit to fluent/fluentd-docs-gitbook that referenced this pull request Jun 7, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature request or improve operations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants