Debugging & Logging - IP Addresses
Configure IP filtering for debug output and secure debugging access
Overview
The IP Addresses page in ColdFusion Administrator provides centralized configuration for restricting debug output and debugging features to specific IP addresses. This critical security feature ensures that sensitive debugging information is only visible to authorized developers, not to end users or potential attackers. IP filtering enables safe debugging in staging and even production environments when emergency troubleshooting is required.
Without IP filtering, enabling debug output would expose application internals, database queries, variable contents, and file paths to all users. IP filtering creates a secure boundary where only requests from approved IP addresses receive debug output, while all other users see the application normally without any debugging information.
IP Address Configuration
Configure which IP addresses can receive debug output and debugging information.
Adding IP Addresses
192.168.1.100127.0.0.1 for server-based debuggingWildcard Patterns
* for range matching192.168.1.* (all IPs from .0 to .255)192.168.*.* (entire 192.168.0.0/16 range)10.0.* (matches 10.0.0.0 through 10.0.255.255)CIDR Notation
192.168.1.0/24 (network/prefix length)Removing IP Addresses
IP Detection and Challenges
Understanding how ColdFusion detects client IP addresses in different network configurations.
Direct Connections
- Scenario
- User connects directly to CF server
- IP Source
- CGI.REMOTE_ADDR contains actual client IP
- Reliability
- Most reliable scenario for IP filtering
CF compares CGI.REMOTE_ADDR to IP list for matching
Proxy Servers
- Challenge
- Proxy IP seen by CF, not client IP
- Solution
- X-Forwarded-For header passes original IP
- Configuration
- CF may need config to use X-Forwarded-For
Verify proxy sets this header reliably. Alternative: add proxy IP to allowed list (less secure)
Load Balancers
- Issue
- Load balancer IP appears as source
- Solution
- Configure load balancer to pass client IP
- Headers
- X-Forwarded-For, X-Real-IP, or custom headers
Use cfdump var="#CGI#" to see what CF detects
VPN Connections
- Challenge
- VPN exit node IP may change
- Solution
- Add all possible VPN exit node IPs
- Alternative
- Use wildcard or CIDR for VPN IP range
Corporate VPN usually has stable IP range. Test your IP while connected to VPN.
Dynamic IPs (Home/Mobile)
- Problem
- Developer IP changes frequently
- Solution 1
- Use broader ISP IP range (check WHOIS)
- Solution 2
- Use VPN with static IP
Security trade-off: broader range is less secure. Consider authentication instead of IP filtering.
Security Considerations
Information Disclosure Prevention
Security Best Practices
- Use specific IP addresses, not broad ranges
- Regularly audit and remove outdated IPs
- Document who owns each IP address
- Monitor for unauthorized access attempts
- Use VPN for remote developers when possible
- Never allow
0.0.0.0or*.*.*.*(matches everything) - Test IP filtering from both allowed and disallowed IPs
- Log IP filtering decisions for audit trail
Production Debugging
Common Mistakes
- Adding 0.0.0.0: May match all IPs or no IPs depending on implementation
- Using *.*.*.*: Defeats entire purpose of IP filtering
- Not testing from disallowed IP: May not realize filtering is ineffective
- Forgetting to update after IP changes: Legitimate developers blocked
- Overly broad wildcards: 10.*.*.* exposes debug to millions of IPs
- Not documenting IPs: Unclear who each IP belongs to
Testing IP Filtering
Verification Process
- Determine your current IP (use whatismyip.com or similar)
- Add your IP to allowed list in CF Administrator
- Enable debug output in Debug Output Settings
- Access application from your IP - debug output should appear
- Access from different IP or use proxy - no debug output should appear
- Check CF logs for IP filtering messages
Test IP Detection Script
Use this script to see what IP ColdFusion detects for your requests:
<!--- /admin/ip-test.cfm --->
<cfscript>
// Display all relevant IP-related CGI variables
ipInfo = {
"REMOTE_ADDR": cgi.remote_addr,
"HTTP_X_FORWARDED_FOR": cgi.http_x_forwarded_for ?: "Not set",
"HTTP_X_REAL_IP": cgi.http_x_real_ip ?: "Not set",
"HTTP_CLIENT_IP": cgi.http_client_ip ?: "Not set"
};
</cfscript>
<!DOCTYPE html>
<html>
<head>
<title>IP Detection Test</title>
<style>
body { font-family: Arial, sans-serif; padding: 20px; }
table { border-collapse: collapse; width: 100%; max-width: 600px; }
th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }
th { background-color: #f0f0f0; font-weight: bold; }
</style>
</head>
<body>
<h1>IP Detection Test</h1>
<p>This shows what IP information ColdFusion can see:</p>
<table>
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
<cfloop collection="#ipInfo#" item="key">
<tr>
<td><cfoutput>#key#</cfoutput></td>
<td><cfoutput>#ipInfo[key]#</cfoutput></td>
</tr>
</cfloop>
</table>
<h2>Recommendations</h2>
<ul>
<li>Add <strong><cfoutput>#cgi.remote_addr#</cfoutput></strong> to IP whitelist</li>
<cfif len(cgi.http_x_forwarded_for)>
<li>Note: X-Forwarded-For detected - you may be behind a proxy/load balancer</li>
</cfif>
</ul>
</body>
</html><!--- /admin/ip-test.cfm --->
<cfset ipInfo = {
"REMOTE_ADDR" = cgi.remote_addr,
"HTTP_X_FORWARDED_FOR" = len(cgi.http_x_forwarded_for) ? cgi.http_x_forwarded_for : "Not set",
"HTTP_X_REAL_IP" = len(cgi.http_x_real_ip) ? cgi.http_x_real_ip : "Not set",
"HTTP_CLIENT_IP" = len(cgi.http_client_ip) ? cgi.http_client_ip : "Not set"
}>
<!DOCTYPE html>
<html>
<head>
<title>IP Detection Test</title>
<style>
body { font-family: Arial, sans-serif; padding: 20px; }
table { border-collapse: collapse; width: 100%; max-width: 600px; }
th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }
th { background-color: #f0f0f0; font-weight: bold; }
</style>
</head>
<body>
<h1>IP Detection Test</h1>
<p>This shows what IP information ColdFusion can see:</p>
<table>
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
<cfloop collection="#ipInfo#" item="key">
<tr>
<td><cfoutput>#key#</cfoutput></td>
<td><cfoutput>#ipInfo[key]#</cfoutput></td>
</tr>
</cfloop>
</table>
<h2>Recommendations</h2>
<ul>
<li>Add <strong><cfoutput>#cgi.remote_addr#</cfoutput></strong> to IP whitelist</li>
<cfif len(cgi.http_x_forwarded_for)>
<li>Note: X-Forwarded-For detected - you may be behind a proxy/load balancer</li>
</cfif>
</ul>
</body>
</html>- Create this file in your webroot (e.g.,
/admin/ip-test.cfm) - Access it from your browser
- Note the REMOTE_ADDR value - this is what CF uses for IP filtering
- Add that IP to the CF Administrator IP whitelist
Troubleshooting Access Issues
- Verify IP actually matches allowed list using the test script above
- Check debug output is enabled in Debug Output Settings
- Confirm IP list has at least one entry
- Check for proxy/load balancer issues (X-Forwarded-For configuration)
- Test exact IP instead of wildcard first
- Verify IPv4 vs IPv6 - ensure using correct IP version
- Some CF versions may require restart after IP changes (rare)
Multi-Environment Testing
- Test IP filtering in each environment (dev, staging, production)
- Verify proxy/load balancer IP handling in each environment
- Different IPs may be needed for different environments
- Document environment-specific IP configurations
- Localhost (127.0.0.1) works for server-based testing
Development Workflows
Team Development
- IP Management
- Maintain list of all developer IPs
- Updates
- Update IP list as team members join/leave
- VPN
- Use VPN with static IP range for easier management
Document process for developers to add their IP. Consider broader range for office network.
Remote Development
- VPN
- Use VPN for consistent IP addressing
- SSH Tunnel
- Secure access to staging servers
- Multiple IPs
- Add home IP plus VPN IP for flexibility
Mobile hotspot IP may differ from home/office. Keep IP list updated as developers work from different locations.
Contractor/Temporary Access
- Documentation
- Note expiration date with contractor IPs
- Removal
- Review and remove after project ends
- Authorization
- Document who authorized each temporary IP
Consider time-limited access mechanisms. Maintain audit log for contractor access.
Configuration Examples
Single Developer
127.0.0.1
192.168.1.100Development Team in Office
127.0.0.1
10.0.1.* # Office network
74.125.224.100 # VPN exit nodeProduction Emergency Debugging
203.0.113.50 # Senior admin home IP
198.51.100.10 # Admin via VPNLoad Balanced Environment
127.0.0.1 # localhost
10.0.1.0/24 # Office network via load balancer
# Configure load balancer to pass X-Forwarded-For headerAlternative Approaches
Application-Level Filtering
- Implementation
- IP checking in Application.cfc
- Advantages
- More granular control than CF Administrator
- Features
- Database for dynamic IP management, time-based access rules
Allows per-application customization and dynamic IP lists without administrator access.
Authentication-Based Debugging
- Method
- Require login to enable debug mode
- Session
- Debug tied to authenticated user
- Auditing
- Track who enabled debugging
More flexible than IP-based filtering. Works well for dynamic IPs and remote teams.
Separate Debug URLs
- Method
- Special URL parameters enable debugging
- Security
- Combine with authentication or shared secret
- Control
- Enable/disable per request
Easy to enable/disable per request. Can implement custom debug output tailored to needs.
Common Issues and Solutions
IP Filtering Not Working
- Verify debug output is enabled in Debug Output Settings
- Confirm IP list has at least one entry
- Dump
CGI.REMOTE_ADDRto see detected IP - Match detected IP to allowed list format (exact match required)
- Check for typos in IP address entries
- Test with simple single IP before using wildcards
Can't Access from Expected IP
- Confirm whatismyip.com matches added IP exactly
- Check if proxy/load balancer is changing your IP
- Look for typos in IP address (e.g., 192.168.1.10 vs 192.168.1.100)
- Verify using IPv4 not IPv6 (or vice versa)
- Some CF versions may require restart after IP changes (rare but possible)
- Use the IP test script above to verify what CF sees
IP Changes Frequently
- Use broader IP range: Look up ISP IP range via WHOIS (security trade-off)
- Use VPN with static IP: Most reliable solution
- Dynamic IP update mechanism: Build admin tool for developers to update their IP
- Authentication-based debugging: Use login instead of IP filtering
- Wildcard for ISP range: e.g., 71.232.*.* for Comcast range (less secure)