What Are Resources?
Resources in NetBird represent network endpoints that users can access. Each resource consists of:- Name: A descriptive identifier for the resource
- Address: The network address (IP, CIDR, or domain)
- Description: Optional details about the resource
- Enabled/Disabled: Control whether the resource is active
- Owner: The user who created the resource
Supported Address Types
NetBird Selfservice supports three types of resource addresses:IP Addresses
Individual IPv4 or IPv6 addressesExamples:
192.168.1.1002001:db8::1
CIDR Ranges
Network ranges in CIDR notationExamples:
10.50.0.0/24192.168.1.0/28
Domain Names
Fully qualified domain names with optional wildcardsExamples:
api.example.com*.internal.company.com
Address Validation Rules
When adding or editing resources, addresses are validated using theValidResourceAddress rule to ensure network security:
Blocked Address Ranges
The following address ranges are blocked to prevent security issues:Domain Validation
Domain names must meet these requirements:- Valid DNS format with proper labels
- Maximum 253 characters total length
- Each label maximum 63 characters
- No consecutive dots (
.) - Support for wildcard subdomains (
*.example.com)
Creating Resources
Navigate to Resources
From the dashboard, click on the “Resources” section to view all your resources.
Fill in Details
Enter the resource information:
- Name: Choose a descriptive name (e.g., “Production API Server”)
- Address: Enter a valid IP, CIDR, or domain
- Description: Add optional details about the resource
- Enabled: Toggle whether the resource should be active immediately
When you create a resource, it’s logged in the activity log with action type
created for audit purposes.Updating Resources
You can modify existing resources to change their configuration:Edit Details
Click the edit button to modify:
- Resource name
- Network address
- Description
- Enabled/disabled status
Enabling and Disabling Resources
You can quickly toggle resources on or off without deleting them:- Enable: Makes the resource accessible through the VPN
- Disable: Temporarily blocks access to the resource
ToggleResourceAction which flips the enabled status and logs the action.
Deleting Resources
To permanently remove a resource:Ownership Controls
Resource ownership is tracked to ensure proper access control:- Every resource is associated with a
user_id(the owner) - Resources also track
created_by(the name of the creator) - Ownership is checked via the
isOwnedBy()method on the Resource model
Implementation Details
Resources are managed through dedicated action classes that handle the business logic:| Action | Class | Description |
|---|---|---|
| Create | CreateResourceAction | Creates a new resource in NetBird |
| Update | UpdateResourceAction | Modifies an existing resource |
| Delete | DeleteResourceAction | Removes a resource |
| Toggle | ToggleResourceAction | Enables/disables a resource |
- Interact with the NetBird API via
NetbirdService - Log activities using
ResourceLog::logAction() - Track changes for audit purposes
- Associate resources with the acting user
Best Practices
Use Descriptive Names
Name resources clearly so team members can identify them easily (e.g., “Production DB Cluster” instead of “DB1”)
Validate Before Creating
Double-check IP addresses and domain names to avoid typos that could create security issues
Document with Descriptions
Use the description field to note important details like purpose, owner team, or access requirements
Disable Instead of Delete
For temporary changes, disable resources rather than deleting them to preserve configuration