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

[4.0] Add the Report-To header to the http header config and allow to set the script-dynamic header #28724

Merged
merged 21 commits into from Oct 27, 2020

Conversation

zero-24
Copy link
Contributor

@zero-24 zero-24 commented Apr 18, 2020

Summary of Changes

Add the Report-To (#2) header to the http header config and allow to set the script-dynamic header

Testing Instructions

  • go to the plg_system_httpheaders
  • notice there is no report-to header in the force header option.
  • apply this patch
  • the option is there
  • set the option to any value. (or see here the details + example)
  • revert the patch
  • go to the com_csp options
  • notice there is no strict-dynamic setting
  • apply this patch
  • notice there is now a strict dynamatic setting. (details)
  • enable the strict dynamic setting
  • (when in custom mode make sure you setup a inital script-src dummy rule)
  • and check the generated csp header. (F12 -> Network tab)

Expected result

  • you can set the report-to via the plugin
  • you can set the strict-dynamic option for the CSP

Actual result

  • you can not set the report-to via the plugin
  • you can not set the strict-dynamic option for the CSP

Documentation Changes Required

The script-dynamic options needs to be added to doc pages the Report-To has been added already
https://docs.joomla.org/index.php?title=Help4.x:Components_CSP_Reports_Options
https://docs.joomla.org/J4.x:Http_Header_Management

@zero-24 zero-24 added this to the Joomla 4.0 milestone Apr 18, 2020
@zero-24 zero-24 self-assigned this Apr 18, 2020
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.0-dev labels Apr 18, 2020
Co-Authored-By: Quy <quy@fluxbb.org>
@zero-24
Copy link
Contributor Author

zero-24 commented Apr 19, 2020

Thanks @Quy

Co-Authored-By: Quy <quy@fluxbb.org>
thanks @Quy

Co-Authored-By: Quy <quy@fluxbb.org>
@zero-24
Copy link
Contributor Author

zero-24 commented Apr 21, 2020

Thanks merged @Quy

@Quy
Copy link
Contributor

Quy commented May 25, 2020

Please fix conflicts.

@zero-24
Copy link
Contributor Author

zero-24 commented May 26, 2020

Done @Quy

Co-authored-by: Quy <quy@fluxbb.org>
@richard67
Copy link
Member

referrer-policy | strict-origin-when-cross-origin

This what I'm looking for? Am new to CSP.

At this point @zero-24 can help netter than I do.

@zero-24
Copy link
Contributor Author

zero-24 commented Oct 17, 2020

This what I'm looking for? Am new to CSP.

Conent-security-poliy(-report-only)

Can you please post the settings you made?

@Bodge-IT
Copy link

com_csp:
image

@Bodge-IT
Copy link

Plugin:
image

@Bodge-IT
Copy link

headers:
image

@richard67
Copy link
Member

@Bodge-IT In your screenshot of the headers I see: "report-to: csp-endpoint". That's one of the headers added by this PR, so success for this point.

For the second point the strict-dynamic option option, your screenshot with the com_csp options shows that this option is there. So success also for this point.

@zero-24 Am I right? Or am I missing something?

@zero-24
Copy link
Contributor Author

zero-24 commented Oct 17, 2020

@zero-24 Am I right? Or am I missing something?

Yes @Bodge-IT in custom mode you can actually also add a custom rule ("last option") with script-src and some value and notice that the CSP header has that key value as well as script-dynamic.

@Bodge-IT
Copy link

Bodge-IT commented Oct 17, 2020

I get this:
image

@zero-24
Copy link
Contributor Author

zero-24 commented Oct 17, 2020

Ok found the issue please re apply this PR (revert and than apply again via patchtester) or manually apply this changes here: 304c468

@Bodge-IT
Copy link

Bodge-IT commented Oct 17, 2020

Boom:
image

Will reset @opn365 test and request new additional test

Thanks for your support...

@zero-24
Copy link
Contributor Author

zero-24 commented Oct 17, 2020

Thanks 👍

@Bodge-IT
Copy link

Do we need to get tests reset?

@zero-24, can you tweak test instructions to advise what we're looking for in headers?

@richard67
Copy link
Member

@Bodge-IT No need for reset, that happens automatically on GitHub with a new commit. In the tracker you might not see that. But it's here on GitHub which counts.

@opn365 Could you re apply this PR (revert, then fetch again patches and than apply again via patchtester if using patchtester, or pulling latest changes when using a git client) and then repeat your test? There have been changes made in this PR. Thanks in advance, and thanks for the previous test.

@zero-24
Copy link
Contributor Author

zero-24 commented Oct 17, 2020

@zero-24, can you tweak test instructions to advise what we're looking for in headers?

Done thanks

@Bodge-IT
Copy link

I have tested this item ✅ successfully on 80d1e1b

Checked options and headers...all good.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28724.

@flo-the-cat
Copy link

I have tested this item ✅ successfully on 80d1e1b

Was easy as pie to follow, once Gary added all the screen shots!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28724.

@Bodge-IT
Copy link

Pulled in Phil to get this done...

@richard67
Copy link
Member

Pulled in Phil to get this done...

Seems he did not have time and has sent his cat instead ;-)

@richard67 richard67 changed the title [4.0] Add the Report-To header to the http header config and allow to set the script-dynamic header [4.0] Add the Report-To header to the http header config and allow to set the script-dynamic header Oct 17, 2020
@joomla-cms-bot joomla-cms-bot removed this from the Joomla 4.0 milestone Oct 17, 2020
@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28724.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 17, 2020
@rdeutz rdeutz merged commit 7338e55 into joomla:4.0-dev Oct 27, 2020
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 27, 2020
@rdeutz rdeutz added this to the Joomla 4.0 milestone Oct 27, 2020
@zero-24 zero-24 deleted the reporttoandscriptdynamic branch October 27, 2020 12:44
@zero-24 zero-24 removed their assignment Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet