Run CLI commands with RSFirewall!
Joomla! 4 comes with a powerful application designed to carry out maintenance tasks without even logging into your website. More precisely, the Command-Line Interface, known as CLI. You can find more information on this topic here.
The new RSFirewall! CLI System plugin is designed to interact with the Joomla! 4 cli/joomla.php script and allows you to run the following commands:
- rsfirewall:download-geoip: use this command to download the GeoLite2 Country database
- rsfirewall:check-core: use this command to scan the integrity of your Joomla! (CMS) files
- rsfirewall:check-malware: use this command to scan your files for common malware
- rsfirewall:check-folders: use this command to scan your folders for improper permissions - not available for Windows Operating System
- rsfirewall:check-files: use this command to scan your files for improper permissions- not available for Windows Operating System
The System - RSFirewall! CLI plugin is installed by default with the component package. You will find it under System > Plugins area. Note that this is by default disabled and you will need to Enable it.
Works only on Joomla! 4 & 5 environments!
How to use the RSFirewall! CLI commands
Below you will find out how to configure these CLI Commands for RSFirewall! as well as some practical examples for each command.
GeoLite2 Country database download CLI command
Type the following to list available options for the GeoLite2 Country database download command:
php joomla.php help rsfirewall:download-geoip -h
Available options
- -k, --key=KEY The MaxMind License Key to be specified. [default: ""]
GeoLite2 Country database download CLI command examples:
To set the license key in case it is not stored in the database, pass the --key={your_license_key} parameter:
- php joomla.php rsfirewall:download-geoip --key=xxxxxxx
Check Core CLI command
Type the following to list available options for the Check Core command:
php joomla.php help rsfirewall:check-core -h
Available options
- -l, --log=LOG: 1 - Use log option / 0 - Just print the output [default: ""]
- -r, --restore=RESTORE: 1 - Restore from remote server / 0 - Skip restore [default: ""]"
- -c, --confirm=CONFIRM: 1 - Ask for confirmation before restore / 0 - Restore without confirmation [default: ""]
Check core CLI command examples:
This will allow to store the files with integrity problems in the log and receive email alerts based on the alert levels set in your configuration. These are Critical alerts:
- php joomla.php rsfirewall:check-core --log=1
This will restore the modified/deleted files from the Joomla installation:
- php joomla.php rsfirewall:check-core --log=1 --restore=1
This will ask for confirmation before restoring the files from the remote server:
- php joomla.php rsfirewall:check-core --log=1 --restore=1 --confirm=1
Malware Check CLI command
Type the following command to list available options for the Malware Check command:
php joomla.php rsfirewall:check-malware -h
Available options
- -l, --log=LOG: 1 - Use log option / 0 - Just print the output [default: ""]
Malware Check CLI command example:
This will allow to store the files with possible malware problems in the log and receive email alerts based on the alert levels set in your configuration. These are Critical alerts.
- php joomla.php rsfirewall:check-malware --log=1
Folders Check CLI command
Type the following command to list available options for the Folders Check command:
php joomla.php rsfirewall:check-folders -h
Available options
- -l, --log=LOG: 1 - Use log option / 0 - Just print the output [default: ""]
- -f, --fix=FIX: 1 - Fix folders permissions / 0 - Skip fixing [default: ""]
- -c, --confirm=CONFIRM: 1 - Ask for confirmation before fixing / 0 - Restore without fixing [default: ""]
Folders Check CLI command example:
This will allow to store the folders with improper permissions in the log and receive email alerts based on the alert levels set in your configuration. These are Critical alerts.
- php joomla.php rsfirewall:check-folders --log=1
This will fix the folders permissions.
- php joomla.php rsfirewall:check-folders --log=1 --fix=1
This will ask for confirmation before fixing the folders permissions.
- php joomla.php rsfirewall:check-folders --log=1 --fix=1 --confirm=1
Files Check CLI command
Type the following command to list available options for the Files Check command:
php joomla.php rsfirewall:check-files -h
Available options
- -l, --log=LOG: 1 - Use log option / 0 - Just print the output [default: ""]
- -f, --fix=FIX: 1 - Fix files permissions / 0 - Skip fixing [default: ""]
- -c, --confirm=CONFIRM: 1 - Ask for confirmation before fixing / 0 - Restore without fixing [default: ""]
Files Check CLI command example:
This will allow to store the files with improper permissions in the log and receive email alerts based on the alert levels set in your configuration. These are Critical alerts.
- php joomla.php rsfirewall:check-files --log=1
This will fix the files permissions.
- php joomla.php rsfirewall:check-files --log=1 --fix=1
This will ask for confirmation before fixing the files permissions.
- php joomla.php rsfirewall:check-files --log=1 --fix=1 --confirm=1