Skip to content

Commit

Permalink
feat: implement CSP for Bootstrap CSS files
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongerig committed Jun 21, 2023
1 parent 46903cc commit b7463ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": {
"php": ">=8.0",
"laminas/laminas-diagnostics": "^1.24",
"pimcore/pimcore": "^10.0",
"pimcore/pimcore": "^10.4",
"spatie/ssl-certificate": "^2.4"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function health(RunnerManager $runnerManager): JsonResponse
// Check rights
if (!$adminUser || !$adminUser->isAdmin()) {
Logger::error(
'User {user} attempted to access the system health report results, but has no permission to do so',
'User {user} attempted to access the system health report results, but has no permission to do so.',
['user' => $adminUser->getName()]
);

Expand All @@ -58,7 +58,7 @@ public function status(RunnerManager $runnerManager): Response
// Check rights
if (!$adminUser || !$adminUser->isAdmin()) {
Logger::error(
'User {user} attempted to access the system health status page, but has no permission to do so',
'User {user} attempted to access the system health status page, but has no permission to do so.',
['user' => $adminUser->getName()]
);

Expand Down
9 changes: 9 additions & 0 deletions src/PimcoreMonitorBundle/Resources/config/pimcore/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pimcore_admin:
admin_csp_header:
additional_urls:
style-src:
- 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css'
- 'https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css'
font-src:
- 'https://cdn.jsdelivr.net/npm/[email protected]/font/fonts/bootstrap-icons.woff'
- 'https://cdn.jsdelivr.net/npm/[email protected]/font/fonts/bootstrap-icons.woff2'

0 comments on commit b7463ba

Please sign in to comment.