on by default. No translations here: the firewall reads this before `init`. * * @return array */ public static function defaults() { return array( 'limit_login_attempts' => true, 'hide_login_errors' => true, 'login_honeypot' => true, 'login_captcha' => false, 'block_invalid_usernames' => true, 'strong_passwords' => true, 'breached_password_check' => false, 'two_factor' => false, 'custom_login_url' => false, 'idle_logout' => false, 'notify_admin_login' => false, 'disable_application_passwords' => false, 'block_wp_admin_for_subscribers' => false, 'admin_ip_allowlist' => false, 'disable_file_edit' => true, 'disable_file_mods' => false, 'disallow_unfiltered_html' => false, 'force_ssl_admin' => false, 'disable_directory_indexes' => false, 'protect_sensitive_files' => false, 'block_php_uploads' => false, 'block_php_includes' => false, 'block_bad_query_strings' => false, 'block_author_scan_htaccess' => false, 'block_xmlrpc_htaccess' => false, 'block_install_scripts' => false, 'disable_xmlrpc' => false, 'disable_pingbacks' => true, 'disable_rest_unauth' => false, 'disable_user_enumeration' => true, 'disable_author_archives' => false, 'remove_head_links' => true, 'hide_wp_version' => true, 'security_headers' => true, 'hsts' => false, 'csp' => false, 'upload_hardening' => true, 'firewall' => true, 'rate_limiting' => true, 'block_scanner_ua' => true, 'country_block' => false, 'scheduled_scan' => true, 'file_change_monitor' => true, 'activity_log' => true, 'email_alerts' => true, 'registration_guard' => true, 'registration_approval' => false, 'disable_feeds' => false, 'htaccess_basic' => false, 'htaccess_6g' => false, 'hotlink_protection' => false, 'comment_spam' => true, 'copy_protection' => false, 'maintenance_mode' => false, 'threat_feed' => false, 'site_monitor' => false, ); } public static function categories() { return array( 'login' => array( __( 'Login & accounts', 'ai-guardwall' ), 'dashicons-lock' ), 'core' => array( __( 'WordPress core & wp-config', 'ai-guardwall' ), 'dashicons-wordpress-alt' ), 'files' => array( __( 'Files & .htaccess', 'ai-guardwall' ), 'dashicons-media-code' ), 'api' => array( __( 'APIs & information leaks', 'ai-guardwall' ), 'dashicons-rest-api' ), 'headers' => array( __( 'Browser security headers', 'ai-guardwall' ), 'dashicons-shield-alt' ), 'uploads' => array( __( 'Uploads', 'ai-guardwall' ), 'dashicons-upload' ), 'visitors' => array( __( 'Visitors, spam & content', 'ai-guardwall' ), 'dashicons-groups' ), 'firewall' => array( __( 'Firewall', 'ai-guardwall' ), 'dashicons-superhero-alt' ), 'monitoring' => array( __( 'Monitoring & alerts', 'ai-guardwall' ), 'dashicons-visibility' ), ); } public static function risks() { return array( 'safe' => __( 'Safe', 'ai-guardwall' ), 'caution' => __( 'Check after enabling', 'ai-guardwall' ), 'advanced' => __( 'Advanced', 'ai-guardwall' ), ); } /** * Every rule. * * type: runtime (hooks), htaccess (server rules), setting (configured on another tab; shown read-only here). * * @return array id => rule */ public static function rules() { if ( null !== self::$rules ) { return self::$rules; } $r = array(); $defaults = self::defaults(); $add = function ( $id, $title, $desc, $category, $risk, $type, $default, $impact, $guide = '', $pro = false, $tab = '' ) use ( &$r, $defaults ) { $default = isset( $defaults[ $id ] ) ? $defaults[ $id ] : $default; $r[ $id ] = compact( 'id', 'title', 'desc', 'category', 'risk', 'type', 'default', 'impact', 'guide', 'pro', 'tab' ); }; // Login & accounts. $add( 'limit_login_attempts', __( 'Limit login attempts', 'ai-guardwall' ), __( 'Locks an IP out after too many failed logins, with a longer lockout for repeat offenders. Stops brute force.', 'ai-guardwall' ), 'login', 'safe', 'runtime', true, __( 'A visitor who mistypes their password several times waits a few minutes.', 'ai-guardwall' ), '§2 Limit login attempts', false, 'usersec' ); $add( 'hide_login_errors', __( 'Hide login error details', 'ai-guardwall' ), __( 'Replaces "wrong password for user X" with a generic message, so attackers cannot learn which usernames exist.', 'ai-guardwall' ), 'login', 'safe', 'runtime', true, __( 'None.', 'ai-guardwall' ), '§2' ); $add( 'login_honeypot', __( 'Honeypot field on the login form', 'ai-guardwall' ), __( 'An invisible field that bots fill in and people never see. Logins that fill it are rejected.', 'ai-guardwall' ), 'login', 'safe', 'runtime', true, __( 'None.', 'ai-guardwall' ), '§2', false, 'bruteforce' ); $add( 'login_captcha', __( 'CAPTCHA on the login and other forms', 'ai-guardwall' ), __( 'A check bots cannot pass on the forms you pick (login, registration, lost password, comments, WooCommerce): the built-in maths question, Cloudflare Turnstile or Google reCAPTCHA v2/v3.', 'ai-guardwall' ), 'login', 'safe', 'runtime', false, __( 'People answer one small question or tick a box; Turnstile and reCAPTCHA v3 are usually invisible.', 'ai-guardwall' ), '§2', false, 'bruteforce' ); $add( 'block_invalid_usernames', __( 'Instant lockout for attack usernames', 'ai-guardwall' ), __( 'Trying to log in as "admin", "test" or another name on your list that does not exist locks the IP out at once.', 'ai-guardwall' ), 'login', 'safe', 'runtime', true, __( 'None, as long as the listed names are not real accounts.', 'ai-guardwall' ), '§2 Change the default admin username', false, 'usersec' ); $add( 'strong_passwords', __( 'Require strong passwords', 'ai-guardwall' ), __( 'New and changed passwords must be at least 12 characters with three character types, and not contain common words.', 'ai-guardwall' ), 'login', 'safe', 'runtime', true, __( 'Users choose longer passwords.', 'ai-guardwall' ), '§2 Use strong passwords', false, 'usersec' ); $add( 'breached_password_check', __( 'Block passwords found in data breaches', 'ai-guardwall' ), __( 'Administrator passwords are checked against haveibeenpwned.com using k-anonymity (only the first 5 characters of a hash leave your server). A breached password must be reset before login.', 'ai-guardwall' ), 'login', 'caution', 'runtime', false, __( 'An administrator with a leaked password must reset it before logging in. Needs outbound HTTPS.', 'ai-guardwall' ), '§2', false, 'usersec' ); $add( 'two_factor', __( 'Two-factor authentication (2FA)', 'ai-guardwall' ), __( 'Authenticator-app (TOTP) or emailed codes for the roles you choose, with backup codes. Enforced after a grace period.', 'ai-guardwall' ), 'login', 'caution', 'runtime', false, __( 'Those users need their phone or inbox to log in. Set it up on your own profile first.', 'ai-guardwall' ), '§2 Enable Two-Factor Authentication', false, 'usersec' ); $add( 'custom_login_url', __( 'Hide the login URL', 'ai-guardwall' ), __( 'Moves the login page from /wp-login.php to your own slug and makes /wp-login.php and /wp-admin answer 404 to visitors who are not logged in.', 'ai-guardwall' ), 'login', 'caution', 'runtime', false, __( 'Bookmark the new address! Some plugins that link to wp-login.php may need updating.', 'ai-guardwall' ), '§2 Change the login URL', false, 'bruteforce' ); $add( 'idle_logout', __( 'Log out idle users', 'ai-guardwall' ), __( 'Ends sessions that have been inactive for the chosen number of minutes.', 'ai-guardwall' ), 'login', 'safe', 'runtime', false, __( 'Editors left logged in on a shared computer are signed out.', 'ai-guardwall' ), '', false, 'usersec' ); $add( 'notify_admin_login', __( 'Email me when an administrator logs in', 'ai-guardwall' ), __( 'An alert with the IP and browser for every administrator login.', 'ai-guardwall' ), 'login', 'safe', 'runtime', false, __( 'More email.', 'ai-guardwall' ), '§11', false, 'alerts' ); $add( 'disable_application_passwords', __( 'Disable application passwords', 'ai-guardwall' ), __( 'Switches off the REST API application passwords feature, an extra way to authenticate that most sites never use.', 'ai-guardwall' ), 'login', 'caution', 'runtime', false, __( 'Apps that connect through application passwords (some mobile apps, Zapier) stop working.', 'ai-guardwall' ) ); $add( 'block_wp_admin_for_subscribers', __( 'Keep subscribers out of wp-admin', 'ai-guardwall' ), __( 'Users who cannot edit posts are sent back to the site instead of the dashboard, and the admin bar is hidden for them.', 'ai-guardwall' ), 'login', 'caution', 'runtime', false, __( 'Membership or shop customers lose the dashboard (WooCommerce My Account still works).', 'ai-guardwall' ) ); $add( 'admin_ip_allowlist', __( 'Restrict wp-admin to my IP addresses', 'ai-guardwall' ), __( 'Only the listed IP addresses can open wp-admin and the login page. Your current address is always kept on the list when you save.', 'ai-guardwall' ), 'login', 'advanced', 'runtime', false, __( 'Anyone on another network (mobile data, a colleague) is locked out until their IP is added.', 'ai-guardwall' ), '§13', false, 'bruteforce' ); $add( 'passkeys', __( 'Passkeys', 'ai-guardwall' ), __( 'Users can sign in with a fingerprint, face, phone or security key instead of a password (WebAuthn). A passkey also counts as the second factor.', 'ai-guardwall' ), 'login', 'safe', 'runtime', false, __( 'None: passwords keep working. Browsers only offer passkeys on HTTPS sites.', 'ai-guardwall' ), '§2', false, 'usersec' ); $add( 'login_door', __( 'Login door (secret word)', 'ai-guardwall' ), __( 'The login page only opens after a visit to a link with your secret word; everyone else is sent to the home page. Stops bots from even seeing the form.', 'ai-guardwall' ), 'login', 'advanced', 'runtime', false, __( 'Bookmark the door link: without it you reach the login page only through the hidden login URL or a password reset.', 'ai-guardwall' ), '§2', false, 'bruteforce' ); $add( 'http_auth', __( 'Extra HTTP password', 'ai-guardwall' ), __( 'The browser asks for a separate user name and password (HTTP Basic authentication) before wp-admin and the login page, or before the whole site while it is being built.', 'ai-guardwall' ), 'login', 'advanced', 'runtime', false, __( 'Everyone who logs in needs the extra password too. Some hosts strip the Authorization header; test in a private window before closing this one.', 'ai-guardwall' ), '§13', false, 'usersec' ); $add( 'max_session', __( 'Maximum session length', 'ai-guardwall' ), __( 'Logins end after the number of hours you choose, however active the user is, so a stolen login cookie stops working.', 'ai-guardwall' ), 'login', 'safe', 'runtime', false, __( 'Users log in again more often.', 'ai-guardwall' ), '', false, 'usersec' ); $add( 'registration_guard', __( 'Protect the registration form', 'ai-guardwall' ), __( 'A hidden honeypot field catches bots, and names such as admin, administrator or root cannot be registered.', 'ai-guardwall' ), 'login', 'safe', 'runtime', true, __( 'None.', 'ai-guardwall' ), '', false, 'spam' ); $add( 'registration_approval', __( 'Approve new accounts by hand', 'ai-guardwall' ), __( 'New registrations wait for an administrator to approve them before they can log in. The user is emailed when approved.', 'ai-guardwall' ), 'login', 'caution', 'runtime', false, __( 'New users cannot log in until you approve them under Users.', 'ai-guardwall' ), '', false, 'usersec' ); // Core & wp-config. $add( 'disable_file_edit', __( 'Disable the theme/plugin file editor', 'ai-guardwall' ), __( 'Sets DISALLOW_FILE_EDIT so nobody can write PHP from the dashboard, even with a stolen admin login.', 'ai-guardwall' ), 'core', 'safe', 'runtime', true, __( 'Appearance > Theme File Editor and Plugins > Plugin File Editor disappear.', 'ai-guardwall' ), '§3 Harden wp-config.php' ); $add( 'disable_file_mods', __( 'Disable plugin/theme installs and updates from the dashboard', 'ai-guardwall' ), __( 'Sets DISALLOW_FILE_MODS: no installs, updates or deletions through wp-admin. For sites deployed from version control.', 'ai-guardwall' ), 'core', 'advanced', 'runtime', false, __( 'You must update WordPress, plugins and themes by other means. Automatic updates stop too.', 'ai-guardwall' ), '§3' ); $add( 'disallow_unfiltered_html', __( 'Strip unfiltered HTML for everyone', 'ai-guardwall' ), __( 'Even administrators cannot save raw scripts in posts or widgets (DISALLOW_UNFILTERED_HTML). Limits what a hijacked admin account can inject.', 'ai-guardwall' ), 'core', 'caution', 'runtime', false, __( 'Embeds that rely on pasted