Strict headers and CSS nonce

This commit is contained in:
James Cole
2021-04-08 12:10:04 +02:00
parent e580093a34
commit 849c7dfe02
7 changed files with 15 additions and 14 deletions

View File

@@ -53,8 +53,9 @@ class SecureHeaders
$csp = [
"default-src 'none'",
"object-src 'self'",
sprintf("script-src 'unsafe-inline' 'nonce-%1s' %2s", $nonce, $trackingScriptSrc),
"style-src 'self' 'unsafe-inline'",
sprintf("script-src 'unsafe-inline' 'nonce-%1s' %2s 'strict-dynamic'", $nonce, $trackingScriptSrc),
"style-src 'unsafe-inline' 'self'",
"frame-ancestors 'none'",
"base-uri 'self'",
"font-src 'self' data:",
"connect-src 'self'",

View File

@@ -8,8 +8,8 @@
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css">
<link rel="stylesheet" href="v2/css/app.css">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css" nonce="{{ JS_NONCE }}">
<link rel="stylesheet" href="v2/css/app.css" nonce="{{ JS_NONCE }}">
</head>
<body>

View File

@@ -8,8 +8,8 @@
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css">
<link rel="stylesheet" href="v2/css/app.css">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css" nonce="{{ JS_NONCE }}">
<link rel="stylesheet" href="v2/css/app.css" nonce="{{ JS_NONCE }}">
</head>
<body>

View File

@@ -8,8 +8,8 @@
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css">
<link rel="stylesheet" href="v2/css/app.css">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css" nonce="{{ JS_NONCE }}">
<link rel="stylesheet" href="v2/css/app.css" nonce="{{ JS_NONCE }}">
</head>
<body>

View File

@@ -8,8 +8,8 @@
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css">
<link rel="stylesheet" href="v2/css/app.css">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css" nonce="{{ JS_NONCE }}">
<link rel="stylesheet" href="v2/css/app.css" nonce="{{ JS_NONCE }}">
</head>
<body>

View File

@@ -13,8 +13,8 @@
// {{ subTitle }}
{% endif %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css">
<link rel="stylesheet" href="v2/css/app.css">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css" nonce="{{ JS_NONCE }}">
<link rel="stylesheet" href="v2/css/app.css" nonce="{{ JS_NONCE }}">
</head>
<body class="hold-transition login-page">
{% block content %}{% endblock %}

View File

@@ -24,8 +24,8 @@
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css">
<link rel="stylesheet" href="v2/css/app.css">
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css" nonce="{{ JS_NONCE }}">
<link rel="stylesheet" href="v2/css/app.css" nonce="{{ JS_NONCE }}">
</head>
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed">
<div class="wrapper">