If you need to exclude specific files or directories from being scanned by cPFence, you can use the built-in commands to whitelist paths. This can be helpful when you have trusted files or folders that should not be flagged during virus scans.
Steps to Whitelist Files or Folders
-
Add a Path to the Whitelist:
Use the following command to whitelist a specific file or folder from all virus scanning jobs:cpfence --exclude-path PATH
Replace
PATH
with the full path to the file or folder you want to exclude. For example:cpfence --exclude-path /var/www/example.com/uploads
Output Example:
The path '/var/www/example.com/uploads' has been added to the whitelist. Applying new settings...please wait. New settings have been applied successfully.
Steps to Remove a Path from the Whitelist
-
Remove a Path from the Whitelist:
If you want to remove a file or folder from the whitelist, use this command:cpfence --del-exclude-path PATH
Replace
PATH
with the full path you want to remove from the whitelist. For example:cpfence --del-exclude-path /var/www/example.com/uploads
Output Example:
The path '/var/www/example.com/uploads' has been removed from the whitelist. Applying new settings...please wait. New settings have been applied successfully.
When to Whitelist Files or Folders?
Consider whitelisting paths only when necessary, such as:
- Trusted Custom Scripts: Files that are essential to your application but might be flagged due to uncommon behavior.
- Backup Folders: Exclude folders containing backups to avoid unnecessary scans.
- Temporary Files: Exclude directories with auto-generated temporary files that are frequently changing.
Whitelisting should only be used for paths that you trust completely. Adding unverified paths may compromise your server's security.
Need Further Assistance?
If you encounter any issues or need help, please contact our support team via the client portal.