Access Control
Domain Restriction
Best practices:- Set during initial setup - Don’t deploy without domain restriction
- Use your corporate domain - Typically your Google Workspace domain
- Verify enforcement - Test with non-allowed domain before going live
- Document exceptions - If allowing multiple domains, maintain a list of approved domains
If you need to support multiple domains, consider implementing a whitelist in the
GoogleController or using a custom OAuth provider.Admin Account Management
Recommendations:- Use a group email if multiple administrators are needed
- Rotate admin access when personnel changes occur
- Document who has admin access and review regularly
- Use personal accounts rather than shared credentials
- Enable MFA on admin Google accounts
User Permissions
Principle of Least Privilege:- Regular users can only modify their own resources
- Admins should use regular accounts for day-to-day work
- Review user list regularly and remove departed employees
- Use the activity log to audit user actions
API Token Management
NetBird API Token Security
TheNETBIRD_API_TOKEN is your most sensitive credential:
Storage
Store in
.env file with 600 permissions (owner read/write only)Rotation
Rotate every 90 days or immediately after suspected compromise
Separation
Use different tokens for development, staging, and production
Monitoring
Monitor API usage in NetBird dashboard for anomalies
Token Rotation Procedure
- Generate new token in NetBird dashboard
- Update
.envfile on production server - Restart application to load new token
- Verify functionality with test resource creation
- Revoke old token in NetBird dashboard
- Document rotation in change log
Secrets Management
For enhanced security, consider using a secrets management system: Options:- AWS Secrets Manager
- HashiCorp Vault
- Azure Key Vault
- Google Secret Manager
Resource Address Security
Understanding Blocked Ranges
NetBird Selfservice blocks certain address ranges to prevent security issues:Why are private networks blocked?
Why are private networks blocked?
Private Networks Blocked:
10.0.0.0/8- Class A private172.16.0.0/12- Class B private192.168.0.0/16- Class C private
- Conflict with users’ local networks
- Expose internal infrastructure
- Cause routing loops
- Create connectivity issues for remote workers
Why is 0.0.0.0/0 blocked?
Why is 0.0.0.0/0 blocked?
Blocked Ranges:
0.0.0.0/0- All IPv4 traffic::/0- All IPv6 traffic0.0.0.0/1and128.0.0.0/1- Halves of IPv4 space
- Create a full tunnel VPN (not the intended use case)
- Impact performance for all user traffic
- Create single point of failure
- Increase NetBird infrastructure costs
- Potentially violate user privacy
Why are loopback and link-local blocked?
Why are loopback and link-local blocked?
Blocked Ranges:
127.0.0.0/8- Loopback169.254.0.0/16- Link-local224.0.0.0/4- Multicast240.0.0.0/4- Reserved255.255.255.255/32- Broadcast
- Don’t represent routable resources
- Could cause routing confusion
- Serve no legitimate business purpose
- Might indicate user error or malicious intent
Resource Naming Best Practices
Good resource names:- Include customer/client name for easy identification
- Specify environment (prod, staging, dev) if applicable
- Use consistent naming convention across organization
- Avoid sensitive information in names (e.g., “Bank XYZ - Critical”)
- Keep descriptions detailed but professional
Activity Log Monitoring
Regular Audit Schedule
Establish a regular review schedule: Daily (for high-security environments):- Review approvals and denials
- Check for unusual deletion patterns
- Verify admin actions
- Review all resource changes
- Verify user access patterns
- Check for unauthorized modifications
- Audit user list against employee roster
- Review blocked address attempts
- Analyze resource growth trends
Suspicious Activity Indicators
Watch for:Rapid Changes
Multiple resources created/deleted in short timeframe
Off-Hours Access
Activity during unusual hours for the user’s timezone
Failed Validations
Repeated attempts to add blocked addresses
Unauthorized Access
Access attempts from non-allowed domains
Log Retention
Recommendations:- Minimum: 90 days for compliance
- Recommended: 1 year for trend analysis
- High-security: 3-7 years
Consult your legal and compliance teams for specific retention requirements in your industry and jurisdiction.
Network Security
HTTPS Requirements
Implementation checklist:- Obtain valid SSL/TLS certificate (Let’s Encrypt, commercial CA, or internal CA)
- Configure web server for HTTPS
- Set
APP_URL=https://your-domain.com - Set
SESSION_SECURE_COOKIE=true - Redirect HTTP to HTTPS at web server level
- Enable HSTS header
- Test with SSL Labs (https://www.ssllabs.com/ssltest/)
Firewall Configuration
Recommended rules:- Only expose HTTPS (port 443) to the internet
- Restrict SSH access to known IP ranges
- Never expose database directly to the internet
- Use VPN or jump host for administrative access
- Keep firewall rules minimal and well-documented
Backup & Disaster Recovery
What to Back Up
Database
Complete database with users, resources, and logs
Environment Config
.env file with all configuration (store securely)Application Code
Version-controlled, but back up custom modifications
SSL Certificates
Private keys and certificates (encrypted storage)
Backup Schedule
Database:- Frequency: Daily (minimum), hourly (recommended)
- Retention: 30 daily, 12 weekly, 12 monthly
- Location: Off-site, encrypted
- Frequency: After any change
- Retention: Version controlled
- Location: Secure secrets management system
Automated Database Backup
Disaster Recovery Procedure
Steps to restore:- Provision new server with same OS version
- Install dependencies (PHP, MySQL, etc.)
- Clone application from version control
- Restore
.envfile from secure backup - Restore database from latest backup
- Restore SSL certificates
- Run migrations if needed:
php artisan migrate - Test application functionality
- Update DNS if IP changed
- Verify OAuth callbacks still work
Operational Security
Security Audit Schedule
Quarterly:- Review access logs
- Audit user accounts
- Check for outdated dependencies:
composer outdated - Review security advisories
- Test backup restoration
- Rotate API tokens
- Rotate SSL certificates (if not automated)
- Review and update security policies
- Conduct penetration testing
- Update disaster recovery documentation
Dependency Management
Keep dependencies updated:- Laravel Security Announcements
- PHP Security Advisories
- NetBird Status Updates
- GitHub Security Alerts (if using GitHub for code hosting)
Incident Response
If you suspect a security breach:-
Contain
- Take application offline if necessary
- Revoke compromised API tokens immediately
- Lock compromised user accounts
-
Investigate
- Review activity logs for unauthorized access
- Check system logs for intrusion attempts
- Identify scope of compromise
-
Remediate
- Patch vulnerabilities
- Rotate all credentials
- Reset user sessions:
php artisan session:flush - Restore from backup if needed
-
Document
- Record timeline of events
- Document actions taken
- Identify root cause
- Create post-mortem report
-
Prevent
- Implement additional controls
- Update security procedures
- Conduct team training
- Monitor for similar attacks
Compliance Considerations
Data Privacy
Personal data stored:- User names (from Google OAuth)
- Email addresses
- User avatars
- IP addresses (in logs)
- Activity timestamps
- GDPR (if EU users)
- CCPA (if California users)
- SOC 2 (if enterprise customers)
- HIPAA (if healthcare data)
Consult legal counsel to determine which regulations apply to your organization and implement appropriate controls.
Data Subject Rights
Be prepared to handle: Right to access:- Users can update their own resource descriptions
- Admins can correct data on behalf of users
- Activity logs are immutable by design
Next Steps
Overview
Return to security overview
Configuration
Review security configuration
Deployment
Learn about secure deployment