Solid Security
Solid Security Pro WP-CLI Integration
Overview
Solid Security Pro provides WP-CLI commands to manage security settings, monitor activity, and configure various protection features directly from the command line. This document outlines the available commands, their usage, and options.
Prerequisites
- Ensure WP-CLI is installed. – https://wp-cli.org/
- Verify Solid Security Pro is active on your WordPress installation. (Solid Security Basic does not support WP-CLI)
- Use an administrator-level WordPress user account to execute commands.
Commands
General Commands
While in your WordPress installation, run wp itsec <command> in the command line. Below are the subcommands to manage Solid Security Pro functionality:
ban
browser Analyse the User-Agent with the Browser library.
change-admin-user Changes the "admin" username and/or the user id of 1.
dashboard Configure dashboards.
events View events scheduled by Solid Security.
feature-flag
firewall
generate-password Generates a random password.
geo Access geolocation functionality.
getlockouts Retrieve active lockouts.
getrecent List the most recent log items
import-export
lockout
log
map Access the static map image API.
modules Enable and disable Solid Security modules.
nc Manage and configure all the notifications sent by Solid Security. View any errors that arise during the sending of notifications.
network-brute-force Manage the Brute Force Network.
releaselockout Release a lockout using one or more ID's provided by getlockouts.
remote-messages
reset Resets all Solid Security data and settings.
scaffold-entry Scaffold a JavaScript entry.
schema Create the database schema.
settings Class ITSEC_Settings_Command
site-scanner
tool
two-factor
upgrade Run the upgrade routine.
user-group
zxcvbn Evaluates a password's strength.
Check Available Modules
wp itsec modules list
Lists all available Solid Security modules.
Activate/Deactivate Modules
wp itsec modules activate <module>
wp itsec modules deactivate <module>
Enables or disables specific security modules.
Reset Solid Security Settings
wp itsec reset
It resets all settings to factory defaults. Logging into the WordPress admin panel and navigating to Solid Security prompts you to reconfigure the plugin.
Security and Lockouts
Check Active Lockouts
wp itsec getlockouts
Displays a list of current lockouts due to security restrictions.
Release Lockout
wp itsec releaselockout [<id>...] [--id=<id>]
Releases a locked-out user or IP using one or more ID’s provided by the `getlockout` command.
Evaluate Password Strength
wp itsec zxcvbn <password> [--fields=<fields>] [--field=<field>] [--format=<format>]
Analyzes a password’s strength using security heuristics.
Security Configuration
Whitelist an IP address
wp itsec settings set global lockout_white_list X.X.X.X
Adds an IP address to the Authorized Hosts list in Solid Security Global Settings. For whitelisting multiple IPs, separate them using commas (ex. wp itsec settings set global lockout_white_list 73.73.73.73,74.74.74.74)
View/Edit reCAPTCHA Settings
wp itsec settings list recaptcha
wp itsec settings edit recaptcha
wp itsec settings set recaptcha <settings> [<value>]
Displays and modifies using built-in editor to edit a module’s settings as JSON or update a specific reCAPTCHA setting.
Disable All Notifications
wp itsec settings get notification-center notifications --format=json
Outputs notification settings in JSON format. You can modify the JSON and apply updates using:
wp itsec settings set notification-center notifications --format=json
Miscellaneous Commands
Check Browser Information
wp itsec browser <user-agent> [--fields=<fields>] [--format=<format>]
Retrieves security-related information about a given user-agent.
Modify Admin User
wp itsec change-admin-user [--username=<username>] [--change-id]
Changes the default WordPress admin username.
Generate a Secure Password
wp itsec generate-password [<length>]
Generates a secure password of specified length.
Manage Feature Flags
wp itsec feature-flag <command>
Enables or disables experimental security features.
View Geo-Related Security Data
wp itsec geo <command>
Handles geolocation-based security settings.
Manage Log Entries
wp itsec log <command>
Manages security logs and stored event data.
View and Modify Notification Center
wp itsec nc <command>
Handles notification center settings.
Manage Network Brute Force Protection
wp itsec network-brute-force <command>
Configures network-wide brute force protection settings.
Manage Remote Messages
wp itsec remote-messages <command>
Handles security messages received from external sources.
Scaffold Security Module Entries
wp itsec scaffold-entry <module> <name> [--as-plugin]
Scaffold a JavaScript entry.
View Database Schema
wp itsec schema
Creates the database schema for Solid Security.
Perform a Site Security Scan
wp itsec site-scanner <command>
Runs a security scan on the WordPress site.
Updating the Plugin
To update Solid Security Pro to the latest version, use:
wp plugin update ithemes-security-pro
This command does not support rollbacks to specific versions.
Manage Solid Security Plugin Version
wp itsec upgrade [--build=<build>]
Upgrades Solid Security to a specified build version.
Getting More Information
For detailed information about any command, you can use the built-in help command:
wp help itsec <command>
This will display usage details, available subcommands, and options for the specified command.
This document ensures comprehensive coverage of WP-CLI commands for Solid Security. If you have further questions or need additional details, feel free to reach out to support.