pfSense Development and Automation
pfSense Development and Automation
pfSense offers several mechanisms for programmatic configuration management and task automation. The REST API enables firewall integration into CI/CD pipelines and orchestration platforms, custom scripts extend built-in functionality, and tools such as Ansible and Terraform provide declarative infrastructure management. All of these approaches rely on the config.xml configuration file as the single source of truth for system settings.
When automating pfSense, keep in mind that any changes made outside the standard web interface or API may be overwritten during system upgrades. All custom modifications should be documented and included in backup procedures.
Section Contents
- API and Automation - REST API (pfSense-api package), authentication, management via Ansible and Terraform, xmlrpc, backup via API
- Custom Scripts - command execution, Shellcmd and Cron packages, PHP scripts, startup scripts, and common automation tasks
- Package Development - pfSense package structure, XML manifest, PHP files, menu integration, FreeBSD ports, testing, and submission
- Building from Source - development environment, repository structure, System Patches, gitsync, pull requests, and contributing
Related Sections
- Backup and Restore - configuration export and restore, AutoConfigBackup
- pfSense Packages - installing and managing packages through Package Manager
- pfSense Monitoring - built-in monitoring tools and external system integration
Last updated on