Skip to content

Commit

Permalink
anti-framing policy added with headers
Browse files Browse the repository at this point in the history
  • Loading branch information
alcalbg committed Sep 27, 2021
1 parent 8f1dfd9 commit 63645f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/Services/Security/Security.php
Expand Up @@ -89,5 +89,11 @@ public function init(array $config = [])
die;
}
}


if (empty($config['allow_insecure_overlays']) || !$config['allow_insecure_overlays']) {
$this->response->headers->set('X-Frame-Options', 'sameorigin');
$this->response->headers->set('Content-Security-Policy', 'frame-ancestors \'self\'');
}
}
}
1 change: 1 addition & 0 deletions configuration_sample.php
Expand Up @@ -72,6 +72,7 @@ function () {
'csrf_key' => "123456", // randomize this
'ip_allowlist' => [],
'ip_denylist' => [],
'allow_insecure_overlays' => false,
],
],
'Filegator\Services\View\ViewInterface' => [
Expand Down

0 comments on commit 63645f6

Please sign in to comment.