How to configure webhook security settings on n8n
Configure webhook security in n8n by accessing the webhook trigger node settings, enabling authentication methods like API keys or basic auth, and setting up IP whitelisting. Security settings protect your webhooks from unauthorized access and ensure data integrity.
Prerequisites
- Access to n8n instance with admin privileges
- Basic understanding of webhooks and HTTP authentication
- Knowledge of API security concepts
- Running n8n workflow with webhook trigger
Step-by-Step Instructions
Access Webhook Trigger Node Settings
None, Basic Auth, Header Auth, and Query Auth.Configure Basic Authentication
Set Up Header-Based Authentication
X-API-Key or Authorization). In the Value field, specify the expected API key or token value. All requests must include this header with the correct value to be processed.Configure Query Parameter Authentication
token or api_key) and its expected Value. The webhook URL will include this parameter, and incoming requests must match the specified value exactly.Enable HTTPS and SSL Verification
false to enforce SSL certificate validation. Configure your n8n instance to use HTTPS by setting the N8N_PROTOCOL=https environment variable and providing valid SSL certificates.Implement IP Whitelisting
192.168.1.100 or 10.0.0.0/24). Save the configuration to restrict webhook access to specified networks only.Configure Request Validation
X-Content-Type-Options: nosniff and X-Frame-Options: DENY. Configure Response Code for unauthorized requests (typically 401 or 403).Test and Monitor Security Settings
curl or Postman with correct authentication credentials. Monitor the Executions tab for failed authentication attempts and adjust security settings as needed. Review webhook logs regularly for suspicious activity.Common Issues & Troubleshooting
Webhook returns 401 Unauthorized despite correct credentials
Verify the authentication method matches your configuration. Check for extra spaces in credentials and ensure the User/Password or header values are exactly as configured. Test with a simple HTTP client like curl to isolate the issue.
SSL certificate errors preventing webhook execution
Ensure your n8n instance has valid SSL certificates installed. Check that the Ignore SSL Issues option is disabled in production. Verify the webhook URL uses https:// protocol and the certificate chain is complete.
IP whitelisting blocks legitimate requests
Review the Allowed IPs configuration in security settings. Check if the source IP has changed or if you're behind a proxy/load balancer. Add the actual source IP address or appropriate CIDR range to the whitelist.
Webhook URL not generating with authentication parameters
Ensure you've saved the workflow after configuring authentication settings. Click Execute Workflow to activate the webhook trigger. The authenticated URL will appear in the webhook node after successful activation with the security parameters included.