저는 워드 프레스를 처음 접했고 공개 리소스가 아닌 것을 숨겨 워드 프레스 멀티 사이트의 보안을 향상시키고 싶습니다. wp-admin, wp-config 등
내 설정이 작동하는 것 같지만이 설정으로 인해 문제가 발생할 수 있는지 잘 모르겠습니다 (핵심 기능, 인기있는 플러그인 등).
- 내 설정이 일반적인 방식으로 양호합니까?
- 내 설정이 실제 보안을 향상 시키거나 시간을 낭비하고 있습니까?
httpd-vhosts.conf (apache)
# Disallow public access php for .htaccess and .htpasswd files
<Files ".ht*">
Require all denied
</Files>
# Disallow public access for *.php files in upload directory
<Directory "/htdocs/wp-content/uploads/">
<Files "*.php">
deny from all
</Files>
</Directory>
# Disallow public access for...
<Files "wp-config.php">
order allow,deny
deny from all
</Files>
<Files "readme.html">
order allow,deny
deny from all
</Files>
<Files "license.html">
order allow,deny
deny from all
</Files>
<Files "license.txt">
order allow,deny
deny from all
</Files>
# Because we do not use any remote connections to publish on WP
<Files "xmlrpc.php">
order allow,deny
deny from all
</Files>
.htaccess
RewriteEngine On
RewriteBase /
# List of ACME company IP Address
SetEnvIf Remote_Addr "^127\.0\.0\." NETWORK=ACME
SetEnvIf Remote_Addr "^XX\.XX\.XX\.XX$" NETWORK=ACME
SetEnvIf Remote_Addr "^XX\.XX\.XX\.XX$" NETWORK=ACME
SetEnvIf Remote_Addr "^XX\.XX\.XX\.XX$" NETWORK=ACME
# Disallow access to wp-admin and wp-login.php
RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php$ # allow fo admin-ajax.php
RewriteCond %{ENV:NETWORK} !^ACME$ # allow for ACME
RewriteCond %{SCRIPT_FILENAME} ^(.*)?wp-login\.php$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin\/
RewriteRule ^(.*)$ - [R=403,L]
# Block user enumeration
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^/?author=([0-9]*)
RewriteRule ^(.*)$ / [L,R=301]
# Block the include-only files.
# see: http://codex.wordpress.org/Hardening_WordPress (Securing wp-includes)
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
#RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] # Comment for Multisite
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
function.php
<?php
// Remove unnecessary meta tags
// <meta name="generator" content="WordPress 4.1" />
remove_action('wp_head', 'wp_generator');
// Disable WordPress Login Hints
function no_wordpress_errors(){
return 'GET OFF MY LAWN !! RIGHT NOW !!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );
wp-config.php
<?php
define('DISALLOW_FILE_EDIT', true);
define('DISALLOW_FILE_MODS', true);
3
새롭고 확실하지 않은 경우 Sucuri Security, iThemes Security, Wordfence Security와 같은 플러그인을 확인하십시오. 여러 옵션이 있습니다. (플러그인을 사용하도록 강요하지는 않지만 견고한 사용자 기반이 있음)
—
bravokeyl