File tree 7 files changed +28
-28
lines changed
7 files changed +28
-28
lines changed Original file line number Diff line number Diff line change @@ -54,17 +54,17 @@ RewriteRule .* index.php [L]
54
54
55
55
## Begin - Security
56
56
# Block all direct access for these folders
57
- RewriteRule ^(.git|cache|bin|logs|backup|webserver-configs|tests)/(.*) error [F]
57
+ RewriteRule ^(\ .git|cache|bin|logs|backup|webserver-configs|tests)/(.*) error [F]
58
58
# Block access to specific file types for these system folders
59
- RewriteRule ^(system|vendor)/(.*)\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ error [F]
59
+ RewriteRule ^(system|vendor)/(.*)\.(txt|xml|md|html|yaml|yml| php|pl|py|cgi|twig|sh|bat)$ error [F]
60
60
# Block access to specific file types for these user folders
61
- RewriteRule ^(user)/(.*)\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ error [F]
61
+ RewriteRule ^(user)/(.*)\.(txt|md|yaml|yml| php|pl|py|cgi|twig|sh|bat)$ error [F]
62
62
# Block all direct access to .md files:
63
63
RewriteRule \.md$ error [F]
64
64
# Block all direct access to files and folders beginning with a dot
65
65
RewriteRule (^|/)\.(?!well-known) - [F]
66
66
# Block access to specific files in the root folder
67
- RewriteRule ^(LICENSE.txt|composer.lock|composer.json|\.htaccess)$ error [F]
67
+ RewriteRule ^(LICENSE\ .txt|composer\ .lock|composer\ .json|\.htaccess)$ error [F]
68
68
## End - Security
69
69
70
70
</IfModule >
Original file line number Diff line number Diff line change @@ -5,22 +5,22 @@ fastcgi / 127.0.0.1:9000 php
5
5
# Begin - Security
6
6
# deny all direct access for these folders
7
7
rewrite {
8
- r /(.git|cache|bin|logs|backups|tests)/.*$
8
+ r /(\ .git|cache|bin|logs|backups|tests)/.*$
9
9
to /403
10
10
}
11
11
# deny running scripts inside core system folders
12
12
rewrite {
13
- r /(system|vendor)/.* \.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$
13
+ r /(system|vendor)/.* \.(txt|xml|md|html|yaml|yml| php|pl|py|cgi|twig|sh|bat)$
14
14
to /403
15
15
}
16
16
# deny running scripts inside user folder
17
17
rewrite {
18
- r /user/.* \.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$
18
+ r /user/.* \.(txt|md|yaml|yml| php|pl|py|cgi|twig|sh|bat)$
19
19
to /403
20
20
}
21
21
# deny access to specific files in the root folder
22
22
rewrite {
23
- r /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess)
23
+ r /(LICENSE\ .txt|composer\ .lock|composer\ .json|nginx\ .conf|web\ .config|htaccess\ .txt|\.htaccess)
24
24
to /403
25
25
}
26
26
Original file line number Diff line number Diff line change @@ -7,22 +7,22 @@ fastcgi / 127.0.0.1:9000 php
7
7
# Begin - Security
8
8
# deny all direct access for these folders
9
9
rewrite {
10
- r /(.git |cache|bin|logs|backups|tests)/.*$
10
+ r /(\ .git |cache|bin|logs|backups|tests)/.*$
11
11
status 403
12
12
}
13
13
# deny running scripts inside core system folders
14
14
rewrite {
15
- r /(system |vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$
15
+ r /(system |vendor)/.*\.(txt|xml|md|html|yaml|yml| php|pl|py|cgi|twig|sh|bat)$
16
16
status 403
17
17
}
18
18
# deny running scripts inside user folder
19
19
rewrite {
20
- r /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$
20
+ r /user/.*\.(txt|md|yaml|yml| php|pl|py|cgi|twig|sh|bat)$
21
21
status 403
22
22
}
23
23
# deny access to specific files in the root folder
24
24
rewrite {
25
- r /(LICENSE.txt |composer.lock |composer.json |nginx.conf |web.config |htaccess.txt |\.htaccess )
25
+ r /(LICENSE\ .txt |composer\ .lock |composer\ .json |nginx\ .conf |web\ .config |htaccess\ .txt |\.htaccess )
26
26
status 403
27
27
}
28
28
## End - Security
Original file line number Diff line number Diff line change @@ -54,22 +54,22 @@ RewriteRule .* index.php [L]
54
54
55
55
## Begin - Security
56
56
# Block all direct access for these folders
57
- RewriteRule ^(.git|cache|bin|logs|backup|webserver-configs|tests)/(.*) error [F]
57
+ RewriteRule ^(\ .git|cache|bin|logs|backup|webserver-configs|tests)/(.*) error [F]
58
58
# Block access to specific file types for these system folders
59
- RewriteRule ^(system|vendor)/(.*)\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ error [F]
59
+ RewriteRule ^(system|vendor)/(.*)\.(txt|xml|md|html|yaml|yml| php|pl|py|cgi|twig|sh|bat)$ error [F]
60
60
# Block access to specific file types for these user folders
61
- RewriteRule ^(user)/(.*)\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ error [F]
61
+ RewriteRule ^(user)/(.*)\.(txt|md|yaml|yml| php|pl|py|cgi|twig|sh|bat)$ error [F]
62
62
# Block all direct access to .md files:
63
63
RewriteRule \.md$ error [F]
64
64
# Block all direct access to files and folders beginning with a dot
65
65
RewriteRule (^|/)\.(?!well-known) - [F]
66
66
# Block access to specific files in the root folder
67
- RewriteRule ^(LICENSE.txt|composer.lock|composer.json|\.htaccess)$ error [F]
67
+ RewriteRule ^(LICENSE\ .txt|composer\ .lock|composer\ .json|\.htaccess)$ error [F]
68
68
## End - Security
69
69
70
70
</IfModule>
71
71
72
72
# Begin - Prevent Browsing and Set Default Resources
73
73
Options -Indexes
74
74
DirectoryIndex index.php index.html index.htm
75
- # End - Prevent Browsing and Set Default Resources
75
+ # End - Prevent Browsing and Set Default Resources
Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ url.rewrite-if-not-file = (
27
27
)
28
28
29
29
#IMPROVING SECURITY
30
- $HTTP["url"] =~ "^/grav_path/(LICENSE.txt|composer.json|composer.lock|nginx.conf|web.config)$" {
30
+ $HTTP["url"] =~ "^/grav_path/(LICENSE\ .txt|composer\ .json|composer\ .lock|nginx\ .conf|web\ .config)$" {
31
31
url.access-deny = ("")
32
32
}
33
- $HTTP["url"] =~ "^/grav_path/(.git|cache|bin|logs|backup|tests)/(.*)" {
33
+ $HTTP["url"] =~ "^/grav_path/(\ .git|cache|bin|logs|backup|tests)/(.*)" {
34
34
url.access-deny = ("")
35
35
}
36
- $HTTP["url"] =~ "^/grav_path/(system|user|vendor)/(.*)\.(txt|md|html|yaml|php|twig|sh|bat)$" {
36
+ $HTTP["url"] =~ "^/grav_path/(system|user|vendor)/(.*)\.(txt|md|html|yaml|yml| php|twig|sh|bat)$" {
37
37
url.access-deny = ("")
38
38
}
39
39
$HTTP["url"] =~ "^/grav_path/(\.(.*))" {
Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ server {
18
18
19
19
## Begin - Security
20
20
# deny all direct access for these folders
21
- location ~* /(.git|cache|bin|logs|backup|tests)/.*$ { return 403 ; }
21
+ location ~* /(\ .git|cache|bin|logs|backup|tests)/.*$ { return 403 ; }
22
22
# deny running scripts inside core system folders
23
- location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403 ; }
23
+ location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml| php|pl|py|cgi|twig|sh|bat)$ { return 403 ; }
24
24
# deny running scripts inside user folder
25
- location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403 ; }
25
+ location ~* /user/.*\.(txt|md|yaml|yml| php|pl|py|cgi|twig|sh|bat)$ { return 403 ; }
26
26
# deny access to specific files in the root folder
27
- location ~ /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403 ; }
27
+ location ~ /(LICENSE\ .txt|composer\ .lock|composer\ .json|nginx\ .conf|web\ .config|htaccess\ .txt|\.htaccess) { return 403 ; }
28
28
## End - Security
29
29
30
30
## Begin - PHP
Original file line number Diff line number Diff line change 18
18
<action type =" Rewrite" url =" index.php" />
19
19
</rule >
20
20
<rule name =" user_error_redirect" stopProcessing =" true" >
21
- <match url =" ^(user)/(.*)\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$" ignoreCase =" false" />
21
+ <match url =" ^(user)/(.*)\.(txt|md|yaml|yml| php|pl|py|cgi|twig|sh|bat)$" ignoreCase =" false" />
22
22
<action type =" Redirect" url =" error" redirectType =" Permanent" />
23
23
</rule >
24
24
<rule name =" ignore_folders" stopProcessing =" true" >
25
- <match url =" ^(.git|cache|bin|logs|backup|webserver-configs|tests)/(.*)" ignoreCase =" false" />
25
+ <match url =" ^(\ .git|cache|bin|logs|backup|webserver-configs|tests)/(.*)" ignoreCase =" false" />
26
26
<action type =" Redirect" url =" error" redirectType =" Permanent" />
27
27
</rule >
28
28
<rule name =" system" stopProcessing =" true" >
29
- <match url =" ^system/(.*)\.(txt|md|html|yaml|php|twig|sh|bat)$" ignoreCase =" false" />
29
+ <match url =" ^system/(.*)\.(txt|md|html|yaml|yml| php|twig|sh|bat)$" ignoreCase =" false" />
30
30
<action type =" Redirect" url =" error" redirectType =" Permanent" />
31
31
</rule >
32
32
<rule name =" vendor" stopProcessing =" true" >
33
- <match url =" ^vendor/(.*)\.(txt|md|html|yaml|php|twig|sh|bat)$" ignoreCase =" false" />
33
+ <match url =" ^vendor/(.*)\.(txt|md|html|yaml|yml| php|twig|sh|bat)$" ignoreCase =" false" />
34
34
<action type =" Redirect" url =" error" redirectType =" Permanent" />
35
35
</rule >
36
36
</rules >
You can’t perform that action at this time.
0 commit comments