Estoy tratando de entender cómo asegurar un sitio de WordPress. Una tarea de seguridad que no entiendo es ... ¿Qué tan importante es proteger la "carpeta wp-admin"? Por ejemplo, consideraría que los intentos de inicio de sesión son muy importantes.
¿Cuál es el propósito de proteger la carpeta wp-admin? ¿Es para evitar que un hacker ingrese a su panel de WordPress? Pero si proteges wp-login.php, ¿cómo podría un hacker entrar al tablero de todos modos?
<Files wp-login.php>
order deny,allow
deny from all
allow from xxx.xxx.x.x
</Files>
Si usa el "Código A", ¿también necesitará agregar a la lista blanca la funcionalidad AJAX de la interfaz blanca y la lista blanca instalar.css?
"Código A": limite el acceso a la carpeta wp-admin
AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "WordPress Admin Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
allow from xx.xx.xx.xxx
</LIMIT>
.
.
¿Cómo se compara "Código A" con "Código B"? ¿Usaría uno u otro, o ambos al mismo tiempo?
.
"Código B" - Asegurar el directorio wp-admin
1 # enable basic authentication
2 AuthType Basic
3 # this text is displayed in the login dialog
4 AuthName “Restricted Area”
5 # The absolute path of the Apache htpasswd file. You should edit this
6 AuthUserFile /path/to/.htpasswd
7 # Allows any user in the .htpasswd file to access the directory
8 require valid-user
Allow front end Ajax functionality
Some WordPress plugins use Ajax functionality in WordPress.
This means that such plugins might need access to the file admin-ajax.php
To allow anonymous access to such file for the WordPress plugins to function,
add the below to .htaccess
1 <Files admin-ajax.php>
2 Order allow,deny
3 Allow from all
4 Satisfy any
5 </Files>
Update: /wp-admin/css/install.css is also sometimes needed on the frontend,
you should whitelist that as well. Here's the necessary configuration
to whitelist a file in a password protected location in lighttpd:
$HTTP["url"] =~ "^\/wp-admin\/.*" {
$HTTP["url"] !~ "^\/wp-admin\/(admin-ajax\.php|css\/.*)" {
auth.require = (
"" => (
"method" => "basic",
"realm" => "Password protected area",
"require" => "user=theuser",
),
),
},
},