Overview
SafeNetworking uses the Palo Alto Networks AutoFocus API to enrich threat data with intelligence about malicious domains, URLs, and files. This page covers how to configure the AutoFocus API key and manage point usage to ensure continuous operation.Obtaining an AutoFocus API Key
To use SafeNetworking’s threat intelligence features, you need an AutoFocus API key:- Log in to the AutoFocus portal
- Navigate to Settings > API Settings
- Generate a new API key or copy your existing key
- Store the key securely - you’ll need it for configuration
Configuration File
All AutoFocus settings are configured in the.panrc file located in your home directory:
Setting the API Key
Add your AutoFocus API key to the.panrc file:
The AutoFocus API key must be set before SafeNetworking can process events and gather threat intelligence data.
Point Management Configuration
AutoFocus uses a point-based system to rate limit API queries. SafeNetworking includes several settings to manage point consumption and prevent service disruption.Low Points Threshold
When AutoFocus points drop below this threshold, SafeNetworking automatically switches to slow processing mode (one event at a time) to conserve points:5000 points
Point Exhaustion Protection
When points drop below this critical threshold, SafeNetworking stops all processing to prevent point exhaustion:500 points
Check Interval
When processing is paused due to low points, SafeNetworking checks the point balance at this interval and resumes when points are above theAF_POINT_NOEXEC threshold:
3600 seconds (1 hour)
AutoFocus points typically regenerate over time. The 1-hour check interval allows points to replenish before resuming operations.
API Timeout Configuration
AutoFocus queries can take significant time when searching through billions of records. These settings control query timeouts to balance thoroughness with performance.Lookup Timeout
Maximum time to wait for an AutoFocus query to complete:2 minutes
Most relevant threat intelligence is returned within the first few minutes. This setting prevents queries from running for extended periods (which can exceed 20 minutes).
Maximum Query Percentage
If the query completion percentage is below this threshold when the timeout is reached, SafeNetworking will abandon the query:20 percent
Processing Pool Configuration
Control the number of concurrent processes for DNS and URL lookups:Pool Timing
Control how frequently each pool checks for new events:API Endpoints
SafeNetworking uses the following AutoFocus API endpoints (configured inproject/__init__.py):
Rate Limiting Best Practices
Monitor Point Usage
Regularly check your AutoFocus point balance to ensure you have sufficient points for your workload.
Adjust Pool Counts
If you’re consuming points too quickly, reduce
DNS_POOL_COUNT or increase DNS_POOL_TIME to slow processing.Set Conservative Thresholds
Keep
AF_POINTS_LOW high enough (5000+) to allow time to address point exhaustion before hitting AF_POINT_NOEXEC.Configuration Example
Here’s a complete.panrc configuration for AutoFocus:
Troubleshooting
API Key Not Set
Error: SafeNetworking fails to start or cannot query AutoFocus Solution: VerifyAUTOFOCUS_API_KEY is set in ~/.panrc and is not set to "NOT-SET" or empty.
Point Exhaustion
Symptom: Processing stops frequently Solutions:- Increase
AF_POINTS_LOWthreshold - Reduce
DNS_POOL_COUNT - Increase
DNS_POOL_TIMEinterval - Increase
DNS_DOMAIN_INFO_MAX_AGEto reduce queries
Slow Performance
Symptom: Threat enrichment takes too long Solutions:- Decrease
AF_LOOKUP_TIMEOUT(but you may get incomplete results) - Increase
AF_LOOKUP_MAX_PERCENTAGEfor more complete queries - Increase
DNS_POOL_COUNT(if points allow)
Related Configuration
- Elasticsearch Configuration - Configure the backend datastore
- Logstash Pipelines - Configure log ingestion
Source References
Configuration options are defined in:project/__init__.py:184-190- API endpoints and keyproject/__init__.py:76-127- Point management and timeout settingsinstall/sfn/.panrc- Example configuration file
