Repository navigation
Tests
Validation and testing utilities for the pfSense Suricata Dashboard project.
There are two kinds of tests. All commands below are run from the repository root.
-
Unit tests (
tests/python/) — run anywhere, no infrastructure needed; CI runs these. -
Integration test scripts (
tests/test-*.sh) — need aconfig.envin the repository root plus SSH access to a live deployment (pfSense and the SIEM server), so they are not run in CI.
Unit tests for the core logic of scripts/forward-suricata-eve.py:
- Log-rotation handling (inode change and truncation) using temp files
- GeoIP enrichment, including the no-database fallback (maxminddb is not required — the GeoIP reader is stubbed, so no GeoIP database is needed)
- UDP event forwarding format (mocked socket)
Usage:
python3 -m pip install pytest # one-time
python3 -m pytest tests/python/ -vThese run in CI on every push via .github/workflows/lint.yml.
Both scripts source config.env from the repository root for SIEM_HOST,
PFSENSE_HOST, PFSENSE_USER, ports and Grafana credentials.
Tests multi-interface forwarder functionality.
Purpose: Verifies that the forwarder correctly detects and monitors all Suricata instances.
Usage:
./tests/test-multi-interface.sh # uses PFSENSE_HOST from config.env
./tests/test-multi-interface.sh <PFSENSE_IP> # or pass the host explicitlyChecks:
- Forwarder process is running
- All Suricata eve.json files are detected
- File descriptors are open for each interface
- GeoIP database is accessible
- Events are being forwarded
Tests Grafana panel compatibility with OpenSearch datasource.
Purpose: Validates which Grafana panel types work correctly with OpenSearch data.
Usage:
./tests/test-panel-compatibility.shTests:
- Table panels with logs type
- Pie/donut charts with aggregations
- Stat panels with metrics
- Geomap panels with geo_point data
- Time series visualizations
-
config.envpresent in the repository root - Key-based SSH access to pfSense as
PFSENSE_USER - pfSense with Suricata running and the forwarder deployed (
./setup.sh) - SIEM stack operational, with indexed data in OpenSearch
for test in tests/test-*.sh; do
echo "Running $test..."
"$test"
echo ""
doneTests output:
- ✓ Success: Green checkmarks with details
- ✗ Failure: Red X with error description
- ⚠ Warning: Yellow warning for non-critical issues
- Create the script:
tests/test-your-feature.sh - Make it executable:
chmod +x tests/test-your-feature.sh - Follow the naming convention
test-*.shand sourceconfig.envthe way the existing scripts do - Document it in this README
Issue: Cannot connect to pfSense
Fix: Check SSH access and PFSENSE_HOST / PFSENSE_USER in config.env
Issue: Forwarder not running
Fix: Deploy the forwarder with ./setup.sh, or ssh admin@<PFSENSE_IP> 'service suricata_forwarder.sh start'
Issue: No OpenSearch data Fix: Verify the forwarder is sending data and check the Logstash logs; see docs/troubleshooting/TROUBLESHOOTING.md
- Tests are non-destructive (read-only)
- Safe to run in production
- Tests do not modify configuration
- Some tests require active traffic for meaningful results
Source: tests/README.md. This wiki is generated from the repository on every push to main; edit the source file and open a pull request rather than editing the wiki page.
This wiki is generated from the Markdown files in pfsense-siem-stack on every push to main. Edits made here are overwritten; edit the source file named at the bottom of each page and open a pull request. Placeholders used throughout: admin@<PFSENSE_IP> is your pfSense SSH login, <SIEM_IP> your SIEM server, interface names like igc0 are examples. Licensed MPL 2.0.
Getting started
Suricata
pfBlockerNG
Telegraf
pfSense platform
- Upgrading pfSense ⭐
- Filterlog Stops After Rotation
- Traffic Shaping Guide
- Shaping Optimization Notes
- October 2026 Tuning Results
- CrowdSec (exploratory)
SIEM: deploy
- Quick Start
- New User Checklist
- SIEM Server Installation
- Forwarder Installation
- GeoIP Setup
- Dashboard Installation
SIEM: operate
- Management Console
- Forwarder Operations and Watchdog
- Multi-Interface and Retention
- Scripts Reference
SIEM: fix