-
Notifications
You must be signed in to change notification settings - Fork 2
/
load.php
46 lines (43 loc) · 1.19 KB
/
load.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Altis Security Module.
*
* @package altis/security
*/
namespace Altis\Security; // phpcs:ignore
use Altis;
add_action( 'altis.modules.init', function () {
$default_settings = [
'enabled' => true,
'require-login' => ! in_array( Altis\get_environment_type(), [ 'production', 'local' ], true ),
'php-basic-auth' => false,
'audit-log' => true,
'disable-accounts' => true,
'2-factor-authentication' => Altis\get_environment_type() === 'local' ? true : [
'required' => [
'super-admin',
'administrator',
],
],
'minimum-password-strength' => 2,
'browser' => [
'automatic-integrity' => true,
'content-security-policy' => [
'base-uri' => [
'self',
],
'object-src' => [
'none',
],
],
'frame-options-header' => true,
'nosniff-header' => true,
'strict-transport-security' => Altis\get_environment_type() === 'local' ? false : 'max-age=31536000; includeSubDomains',
'xss-protection-header' => true,
],
];
$options = [
'defaults' => $default_settings,
];
Altis\register_module( 'security', __DIR__, 'Security', $options, __NAMESPACE__ . '\\bootstrap' );
} );