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

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

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

GiedriusS
Copy link
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 <[email protected]>
Copy link
Contributor

@daipom daipom left a comment

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}],
]
Copy link
Member

@ashie ashie Sep 5, 2023

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
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
Copy link

github-actions bot commented Oct 5, 2023

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
Copy link

github-actions bot commented Nov 9, 2023

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
12 of 16 checks passed
@ashie
Copy link
Member

ashie commented Apr 30, 2024

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 <[email protected]>
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 <[email protected]>
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