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

92 security headers #112

Merged
merged 2 commits into from
Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/wp-content/themes/dctx2/assets/sass/views/_blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ article.post {
box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.1);
}

time a,
time,
.author a,
.tags-links a {
text-decoration: underline;
Expand Down
21 changes: 21 additions & 0 deletions web/wp-content/themes/dctx2/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,24 @@ function dctx_widgets_init() {
* Scaffolding Library.
*/
require get_template_directory() . '/inc/scaffolding.php';

/**
* Add security headers for Nginx based sites
*
* @param [type] $headers add security headers as array.
*
* @return array
*/
function additional_securityheaders( $headers ) {
if ( ! is_admin() ) {
$headers['Referrer-Policy'] = 'no-referrer-when-downgrade';
$headers['X-Content-Type-Options'] = 'nosniff';
$headers['XX-XSS-Protection'] = '1; mode=block';
$headers['Feature-Policy'] = 'geolocation "none" ; camera "none"';
$headers['X-Frame-Options'] = 'SAMEORIGIN';
$headers['Content-Security-Policy'] = "script-src-elem 'self' 'unsafe-inline' https://www.google.com https://js-agent.newrelic.com https://bam.nr-data.net https://www.gstatic.com https://cdn.datatables.net; script-src 'unsafe-inline' 'unsafe-eval' https://www.google.com https://fonts.googleapis.com https://cdnjs.cloudflare.com https://www.gstatic.com https://js-agent.newrelic.com/";
}

return $headers;
}
add_filter( 'wp_headers', 'additional_securityheaders' );
4 changes: 2 additions & 2 deletions web/wp-content/themes/dctx2/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/wp-content/themes/dctx2/style.min.css

Large diffs are not rendered by default.