Quick Start Guide
This guide will help you get SafeNetworking up and running quickly. You’ll configure the basic components, set up your AutoFocus API key, and verify that the system is processing events.If you received a pre-installed VM from your Palo Alto Networks account team, it comes ready to go and you can skip most of these steps. You’ll only need to configure your AutoFocus API key and firewall syslog settings.
Prerequisites
Before you begin, ensure you have:System Requirements
- Ubuntu 18.04 LTS or compatible Linux distribution
- Minimum 8GB RAM (16GB recommended)
- Python 3.6 or higher
- Root or sudo access
Required Accounts
- Palo Alto Networks AutoFocus subscription
- AutoFocus API key (obtainable from the AutoFocus portal)
Installation
1. Clone the Repository
2. Run the Setup Script
Thesetup.sh script automates the installation of ElasticStack components and SafeNetworking configuration.
- Create necessary directories (
~/es_backupfor Elasticsearch backups) - Set up Python virtual environment in
.env/ - Install Python dependencies from
requirements.txt - Configure Elasticsearch, Logstash, and Kibana
- Set system limits for Elasticsearch
- Install index mappings and templates
- Enable services to start on boot
3. Configure AutoFocus API Key
Edit the.panrc configuration file in your home directory:
4. Verify ElasticStack Services
Check that all services are running:- Elasticsearch: JSON response with cluster information
- Logstash: UDP port 5514 should be listening
- Kibana: HTTP 200 response or redirect
Configure Your Firewall
Configure your Palo Alto Networks firewall to send syslog events to SafeNetworking.Syslog Server Configuration
Add Syslog Server Profile
Navigate to Device → Server Profiles → Syslog and create a new profile:
- Name:
SafeNetworking - Server: IP address of your SafeNetworking system
- Port:
5514 - Facility:
LOG_USER - Format:
Default
Configure Log Forwarding
Navigate to Objects → Log Forwarding and create profiles for:
- Threat Logs: Forward DNS threat logs to SafeNetworking syslog profile
- Traffic Logs: (Optional) Forward traffic logs for additional context
Example Syslog Configuration
Start SafeNetworking
Now you’re ready to start the SafeNetworking application.Start the Application
The application will continue running in the foreground. To run it in the background, use
nohup ./sfn start & or set up a systemd service.Verify Processing
Check the SafeNetworking log file:- Background processes initialized
- DNS processing routines started
- AutoFocus point totals being queried
- Events being processed (once firewall logs arrive)
Access Kibana Dashboards
Once SafeNetworking is running and processing events, you can view the data in Kibana.Import Visualizations
Create Index Patterns
Go to Management → Index Patterns and create patterns for:
threat-*sfn-domain-details*sfn-tag-details*sfn-iot-details*(if using IoT features)
@timestamp as the time field.Available Dashboards
After importing, you’ll have access to several pre-built dashboards:- Safe Networking Overview: High-level threat summary
- DNS Threat Analysis: Detailed DNS threat events and malware families
- IoT Threat Detection: IoT-specific threat intelligence
- GTP/SCTP Events: Mobile network event analysis
- Malware Timeline: Temporal analysis of malware detections
Verify Event Enrichment
To verify that SafeNetworking is enriching events with AutoFocus data:CLI Commands
SafeNetworking provides several CLI commands for management:Troubleshooting
SafeNetworking won't start - API key error
SafeNetworking won't start - API key error
If you see:
CRITICAL - API Key for Autofocus is not set in .panrc, exitingSolution: Edit ~/.panrc and set your AUTOFOCUS_API_KEYNo events appearing in Elasticsearch
No events appearing in Elasticsearch
Check:
- Firewall syslog configuration is correct
- Logstash is listening:
netstat -tuln | grep 5514 - No firewall rules blocking UDP 5514
- Check Logstash logs:
/var/log/logstash/logstash-plain.log
Elasticsearch connection errors
Elasticsearch connection errors
Check:
- Elasticsearch is running:
curl localhost:9200 - Check Elasticsearch logs:
/var/log/elasticsearch/ - Verify disk space and memory available
High AutoFocus API point usage
High AutoFocus API point usage
SafeNetworking caches domain information to reduce API calls. You can adjust caching behavior in
.panrc:Next Steps
Full Installation Guide
Learn about advanced configuration options and production deployment best practices.
Configuration Reference
Detailed reference for all configuration parameters in
.panrc.