# Artisan Commands and Scheduled Tasks (Crons) Command list, arguments/options, usage # Artisan Commands # Command Line Commands (Artisan) CFM includes a number of custom Laravel Artisan commands to help automate and manage blocklists, phishing detection, feed ingestion, and other system behaviors. To view available commands, use the following in your project root: ``` php artisan ``` Below is an overview of the key command groups available in CFM:
---
## ๐Ÿ”Œ `agents`
CommandDescription
`agents:check-notifications`Checks the last-seen status of each agent and sends notifications (e.g., Slack) if any are down.
---
## ๐Ÿ—‘๏ธ `autodelete`
CommandDescription
`autodelete:run`Runs `AutoDeleteJob` to remove old records (e.g., blocklist entries, logs) based on custom rules.
---
## ๐Ÿšซ `blocklist`
CommandDescription
`blocklist:fetch-geodata`Bulk fetches GeoIP data for blocklist entries (country, ASN, etc.).
`blocklist:resolve-geodata`Resolves GeoIP data with optional processing limits for batching.
`blocklist:resolve-ptr`Resolves PTR (Reverse DNS) records for IPs in batches. Parallel processing supported.
---
## ๐Ÿงน `cache`
CommandDescription
`cache:clear`Clears the Laravel application cache.
---
## ๐Ÿฆ  `clamav`
CommandDescription
`clamav:generate-signatures`Generates ClamAV-compatible signature files from phishing URLs and malware file hashes (MD5, SHA1, SHA256).
---
## โš™๏ธ `config` > *This section may include config sync-related commands, depending on future additions.*
---
## ๐ŸŒ `data-feeds`
CommandDescription
`data-feeds:fetch`Fetches and processes all active data feeds configured in the system.
`import:blocklist`Imports a list of IPs into the blocklist, whitelist, or greylist.
`import:domains`Imports domains into the blocklist or whitelist.
`import:mail-filters`Imports email sender/domain filters from a file.
---
## ๐Ÿ“„ `iplists`
CommandDescription
`iplists:generate`Generates `whitelist.txt`, `greylist.txt`, and `blacklist.txt` files from the database for CSF or DNS use.
---
## ๐Ÿ“ฌ `mailfromfilters`
CommandDescription
`mailfromfilters:generate`Generates `mailfromfilters.cf` used by the mail filtering system, based on DB entries.
---
## ๐Ÿง  `spamassassin`
CommandDescription
`spamassassin:generate-rules`Generates a SpamAssassin custom keyword rule file from the `spam_keywords` table. Supports strict and loose matching, Greek normalization, etc.
---
These commands allow you to maintain and automate your security infrastructure directly from the console, and can be scheduled or run on-demand as needed. # Scheduled Tasks / Cron and Supervisor settings ## โฑ๏ธ Scheduled Commands (Cron) Scheduled tasks are defined in `routes/console.php` and executed using Laravel's `schedule:run` command. They can be run via a cron shell script or with a process manager like **Supervisor**. ### Shell Cron Example: \#!/bin/bash cd "$(dirname "$0")" php artisan schedule:run >> /dev/null 2>&1 ### Supervisor Setup (Recommended) **Service file:** `supervisor.service` \[Unit\] Description=Supervisor process control system for UNIX After=network.target \[Service\] ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown ExecReload=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf $OPTIONS reload Restart=on-failure RestartSec=50s **Program config:** `/etc/supervisor/conf.d/cfm.conf` \[program:cfm\] command=php /home/cfm/artisan queue:work redis --memory=2048 --tries=3 --timeout=600 user=cfm autostart=true autorestart=true numprocs=2 redirect\_stderr=true stdout\_logfile=/var/log/supervisor/cfm.log ### Scheduled Commands
CommandScheduleDescription
`iplists:generate`Every 10 minutesGenerate updated IP lists from the DB
`clamav:generate-signatures`Hourly at :50Generate ClamAV signature files
`agents:check-notifications`Every minuteCheck agent status and send alerts
`autodelete:run`Daily at 08:00Run AutoDelete cleanup job
`config:sync-storage`Every 5 minutesSync configuration files from disk
`blocklist:resolve-ptr`Every 10 minutesResolve PTR records in batches
`blocklist:resolve-geodata`Every 10 minutesResolve ASN/Country data in bulk
`unblocks:cleanup`Every 5 minutesCleanup old unblock requests
`phishlist:generate`Every 30 minutesRegenerate phishing domain list
`mailfromfilters:generate`HourlyRegenerate mailfromfilters.cf
`execution:dispatch`Every minuteDispatch queued execution rules
`DataFeedJob (callback)`Every minuteDispatch data feed jobs for active feeds
These scheduled commands are critical for keeping data up-to-date, automating cleanup, syncing feeds and configurations, and dispatching jobs to agents or queues.