{"id":165,"date":"2019-11-20T12:06:00","date_gmt":"2019-11-20T17:06:00","guid":{"rendered":"http:\/\/127.0.0.1:8080\/?p=165"},"modified":"2024-01-13T13:56:16","modified_gmt":"2024-01-13T18:56:16","slug":"no-unauthorized-access-to-wordpress-admin","status":"publish","type":"post","link":"http:\/\/10.42.0.68:8080\/blog\/no-unauthorized-access-to-wordpress-admin","title":{"rendered":"No unauthorized access to WordPress Admin"},"content":{"rendered":"\n

To safeguard your WordPress site and prevent unauthorized access to your admin panel, you can take the following steps:<\/p>\n\n\n\n\n\n\n\n

Keep WordPress core up-to-date<\/h2>\n\n\n\n

By default, WordPress only updates minor versions automatically. To enable automatic updates for major versions, add the following line to your wp-config.php file:<\/p>\n\n\n\n

define('WP_AUTO_UPDATE_CORE', true);<\/code><\/pre>\n\n\n\n

Keep plugins up-to-date<\/h2>\n\n\n\n

It’s very weird because you need to modify your template to activate it \u2026<\/p>\n\n\n\n

\n

WTF\u2026 template not core?<\/p>\n\n\n\n

Core developers = asshole! – sycured<\/a><\/p>\n<\/blockquote>\n\n\n\n

Create child theme<\/h3>\n\n\n\n

Never, never, never modify the official theme directly, you need to use a child theme.<\/p>\n\n\n\n

I let you read the official documentation<\/a><\/p>\n\n\n\n

Activate automatic update<\/h3>\n\n\n\n

You need to add two lines in functions.php<\/strong><\/p>\n\n\n\n

add_filter( 'auto_update_plugin', '__return_true' );\nadd_filter( 'auto_update_theme', '__return_true' );<\/code><\/pre>\n\n\n\n

U2F and OTP for all users<\/h2>\n\n\n\n

2FA rules the world and we use it right now to let hackers outside of wp-admin.<\/p>\n\n\n\n

Plugin<\/h3>\n\n\n\n

It’s an open-source plugin: Two-Factor<\/a><\/p>\n\n\n\n

Configuration<\/h4>\n\n\n\n

All configuration is inside each user’s account:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

I recommend you use the same settings to have the best security\u2026
After taking this screenshot, I added my 2 other U2F keys.<\/p>\n\n\n\n

SSO when you can<\/h2>\n\n\n\n

SSO can be used to unify the login method but keep in mind that U2F & OTP must be activated at the SSO provider level.<\/p>\n\n\n\n

Plugin<\/h3>\n\n\n\n

It’s another open-source plugin: OpenID Connect Generic Client<\/a><\/p>\n\n\n\n

Configuration<\/h4>\n\n\n\n
\"\"<\/figure>\n\n\n\n
\"\"<\/figure>\n\n\n\n
\"\"<\/figure>\n\n\n\n

Error in log<\/h4>\n\n\n\n

This is an example of failure to authenticate to the WordPress, no authorized access<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n
\"\"<\/figure>\n\n\n\n

Caution<\/h3>\n\n\n\n

In this configuration, you need to create users in your WordPress using the same email address that connects to SSO: no automatic registration\/synchronization.<\/p>\n\n\n\n

Conclusion<\/h2>\n\n\n\n

You have a better security level without high computing costs.
I prefer the SSO way due to having the possibility to force OTP\/U2F.<\/p>\n","protected":false},"excerpt":{"rendered":"

To safeguard your WordPress site and prevent unauthorized access to your admin panel, you can take the following steps:<\/p>\n","protected":false},"author":1,"featured_media":111,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[17],"tags":[18,19,20,21],"_links":{"self":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts\/165"}],"collection":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":1,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":166,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts\/165\/revisions\/166"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/media\/111"}],"wp:attachment":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}