Skip to content

[4.0] System - HTTP Headers - Write headers to the configuration file#24674

Merged
wilsonge merged 34 commits intojoomla:4.0-devfrom
zero-24:40_write_static_headers
Jul 25, 2019
Merged

[4.0] System - HTTP Headers - Write headers to the configuration file#24674
wilsonge merged 34 commits intojoomla:4.0-devfrom
zero-24:40_write_static_headers

Conversation

@zero-24
Copy link
Copy Markdown
Contributor

@zero-24 zero-24 commented Apr 21, 2019

Summary of Changes

Testing Instructions

Test Write headers to the configuration file

  • Install Joomla 4.0
  • apply this patch
  • go to the plugin config
  • enable the new option Write headers to the configuration file
  • save the plugin
  • check the content of the .htaccess | web.config file
  • change the static header configurations
  • save the plugin
  • check the .htaccess | web.config file

Test the CSP Component Integration

  • go to com_csp
  • enable the detect option
  • visit the backend and frontend
  • notice the collected reports
  • publish some of the reports
  • enable the auto mode from the options (keep it report only for now :D)
  • check the now generated csp header
  • enable the custom mode
  • configure a custom rule (adding script-src 'nonce-{nonce}' as minimum)
  • check that {nonce} has been replaced by the actual nonce

Expected result

The static headers are written to the respective server config file

Actual result

This option does not exists

Documentation Changes Required

  • Update Screenshots (Plugin and Component options)
  • Add new option description

https://docs.joomla.org/J4.x:Http_Header_Management

@zero-24 zero-24 added this to the Joomla 4.0 milestone Apr 21, 2019
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.0-dev labels Apr 21, 2019
@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Jun 16, 2019

@wilsonge I would like to add yet another feature that sets the frame-ancestors directive when enabled can you give me a status how do you want to handle this PR?

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Jun 16, 2019

And I have been asked by @SniperSister to work on an approach for hash based whitlisting too, wich would massive conflict with this PR here too.

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Jul 3, 2019

Any update @wilsonge ?


$this->app->setHeader(
'Content-Security-Policy-Report-Only',
'content-security-policy-report-only',
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.

Don't we want to set the headers in the app with the correct cases?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.

https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

I personally would go for the the lowercase version as it is now.

@wilsonge wilsonge merged commit ad41b4a into joomla:4.0-dev Jul 25, 2019
@wilsonge
Copy link
Copy Markdown
Contributor

Thanks!

@zero-24 zero-24 deleted the 40_write_static_headers branch July 27, 2019 04:18
@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Jul 27, 2019

Great, thanks 🎉

@brianteeman
Copy link
Copy Markdown
Contributor

This should not have been merged #25713 (comment)

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Aug 5, 2019

Removing the documentation required label as this feature is about to be removed here: #25754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants