magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.39k stars 9.29k forks source link

New Relic module does not complies with CSP #34707

Closed esteban-serfe closed 1 year ago

esteban-serfe commented 2 years ago

Preconditions (*)

  1. Magneto Commerce v2.4.2
  2. New Relic Reporting module v100.4.1

Steps to reproduce (*)

  1. Enable the extension to strart tracking website data.
  2. Enter to the homepage

Expected result (*)

  1. Domains for the new relic domains for browser reporting should be included into the CSP headers

Actual result (*)

  1. The following errors appears on the browser console (chrome):
    [Report Only] Refused to load the script 'https://js-agent.newrelic.com/nr-spa-1212.min.js' because it violates the following Content Security Policy directive: "script-src [.....] 'self' 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
    [Report Only] Refused to load the script 'https://bam.nr-data.net/1/[..]etToken' because it violates the following Content Security Policy directive: "script-src [..]'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

Current workarround:

  1. Add a new module and set this values explicitly. Requires developer knowhow.

m2-assistant[bot] commented 2 years ago

Hi @EstebanSerfe. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

github-jira-sync-bot commented 2 years ago

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

github-jira-sync-bot commented 2 years ago

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

github-jira-sync-bot commented 2 years ago

:x: Something went wrong. Cannot create Jira issue.

engcom-Alfa commented 2 years ago

Thanks for your contribution @EstebanSerfe

We have to re-confirm internally by reproducing it. Thanks for your patience!

@engcom-November Please try to reproduce at the earliest!

esteban-serfe commented 2 years ago

Related merge request: https://github.com/magento/magento2/pull/34708

m2-assistant[bot] commented 2 years ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Delta commented 2 years ago

Hi @esteban-serfe , Thank you for reporting the issue.We verified the issue on Magento Commerce 2.4-develop branch and the issue is reproducible.Hence marking the issue 'Issue Confirmed'.

Steps performed:

  1. Enable the new relic module extension to strart tracking website data.
  2. Enter to the homepage

Result: The following errors appears on the browser console (chrome): " ([Report Only] Refused to load the script 'https://js-agent.newrelic.com/nr-spa-1212.min.js' because it violates the following Content Security Policy directive: "script-src [.....] 'self' 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

[Report Only] Refused to load the script 'https://bam.nr-data.net/1/[..]etToken' because it violates the following Content Security Policy directive: "script-src [..]'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback."

new relic2 Thanks!

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2553 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 years ago

:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

github-jira-sync-bot commented 2 years ago

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-2553

github-jira-sync-bot commented 2 years ago

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-2553

Kiraberos commented 1 year ago

@magento I am working on this