Deny Rule for Specific IPs in Network Access Control #1334

Open
opened 2025-11-20 05:28:39 -05:00 by saavagebueno · 3 comments
Owner

Originally created by @marcportabellaclotet-mt on GitHub (Oct 14, 2024).

Feature Request: Deny Rule for Specific IPs in Network Access Control

Description:
We are currently using Netbird to manage network access and have a question about network access control. We would like to grant a user access to a broader network range (e.g., 10.10.0.0/16) but restrict access to a specific endpoint within that range (e.g., 10.10.3.4/32).

Currently, there doesn't seem to be an option to add a deny rule or similar mechanism that would allow us to achieve this more granular control. We believe that having the ability to define deny rules in the access control settings would be beneficial in scenarios like ours, where we need to restrict certain resources while still granting access to others within the same network range.

Proposed Solution:

  • Add the ability to create deny rules in the access control settings, allowing users to deny access to specific IP addresses or ranges even when a broader range is allowed.
  • These deny rules would take precedence over allow rules, ensuring that specific endpoints can be restricted even when a network range is permitted.

Use Case:

  • We want to grant a user access to the 10.10.0.0/16 range but restrict access to the endpoint 10.10.3.4/32.
  • With deny rules, we could grant access to the entire network range while ensuring that sensitive endpoints remain inaccessible.

Benefit:
This feature would provide more granular control over network access, helping users secure specific endpoints within broader network ranges. It would also reduce the need to create overly specific allow rules that might be cumbersome to manage in complex network setups.

Thank you for considering this feature!

Originally created by @marcportabellaclotet-mt on GitHub (Oct 14, 2024). ### Feature Request: Deny Rule for Specific IPs in Network Access Control **Description:** We are currently using Netbird to manage network access and have a question about network access control. We would like to grant a user access to a broader network range (e.g., 10.10.0.0/16) but restrict access to a specific endpoint within that range (e.g., 10.10.3.4/32). Currently, there doesn't seem to be an option to add a deny rule or similar mechanism that would allow us to achieve this more granular control. We believe that having the ability to define deny rules in the access control settings would be beneficial in scenarios like ours, where we need to restrict certain resources while still granting access to others within the same network range. **Proposed Solution:** - Add the ability to create deny rules in the access control settings, allowing users to deny access to specific IP addresses or ranges even when a broader range is allowed. - These deny rules would take precedence over allow rules, ensuring that specific endpoints can be restricted even when a network range is permitted. **Use Case:** - We want to grant a user access to the 10.10.0.0/16 range but restrict access to the endpoint 10.10.3.4/32. - With deny rules, we could grant access to the entire network range while ensuring that sensitive endpoints remain inaccessible. **Benefit:** This feature would provide more granular control over network access, helping users secure specific endpoints within broader network ranges. It would also reduce the need to create overly specific allow rules that might be cumbersome to manage in complex network setups. Thank you for considering this feature!
saavagebueno added the feature-request label 2025-11-20 05:28:39 -05:00
Author
Owner

@bbenouarets commented on GitHub (Oct 29, 2024):

I hereby also express my interest in this function. An allow or deny list for the ports that may be used for the endpoint would also be helpful. Either you create an allow list, which would be better for the zero trust concept. However, I would favor an allow list.

@bbenouarets commented on GitHub (Oct 29, 2024): I hereby also express my interest in this function. An allow or deny list for the ports that may be used for the endpoint would also be helpful. Either you create an allow list, which would be better for the zero trust concept. However, I would favor an allow list.
Author
Owner

@galiev commented on GitHub (Mar 7, 2025):

I understand that this isn't exactly a solution, but as a workaround, you can manually remove the address from the range:

>>> from netaddr import IPSet
>>> my_route = IPSet(['10.10.0.0/16'])
>>> my_route.remove("10.10.3.4/32")
>>> my_route
IPSet(['10.10.0.0/23', '10.10.2.0/24', '10.10.3.0/30', '10.10.3.5/32', '10.10.3.6/31', '10.10.3.8/29', '10.10.3.16/28', '10.10.3.32/27', '10.10.3.64/26', '10.10.3.128/25', '10.10.4.0/22', '10.10.8.0/21', '10.10.16.0/20', '10.10.32.0/19', '10.10.64.0/18', '10.10.128.0/17'])

However, with a large number of routes, like in my case—a default route with exceptions for reserved addresses, specific regions, etc.—I ended up with 21,221 routes, and the client gave an error:

2025-03-08T01:58:31Z WARN management/client/grpc.go:171: disconnected from the Management service but will retry silently. Reason: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (11708029 vs. 4194304)
@galiev commented on GitHub (Mar 7, 2025): I understand that this isn't exactly a solution, but as a workaround, you can manually remove the address from the range: ```bash >>> from netaddr import IPSet >>> my_route = IPSet(['10.10.0.0/16']) >>> my_route.remove("10.10.3.4/32") >>> my_route IPSet(['10.10.0.0/23', '10.10.2.0/24', '10.10.3.0/30', '10.10.3.5/32', '10.10.3.6/31', '10.10.3.8/29', '10.10.3.16/28', '10.10.3.32/27', '10.10.3.64/26', '10.10.3.128/25', '10.10.4.0/22', '10.10.8.0/21', '10.10.16.0/20', '10.10.32.0/19', '10.10.64.0/18', '10.10.128.0/17']) ``` However, with a large number of routes, like in my case—a default route with exceptions for reserved addresses, specific regions, etc.—I ended up with 21,221 routes, and the client gave an error: ```bash 2025-03-08T01:58:31Z WARN management/client/grpc.go:171: disconnected from the Management service but will retry silently. Reason: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (11708029 vs. 4194304) ```
Author
Owner

@ivanky4kin commented on GitHub (Oct 8, 2025):

+1
This feature is essential for managing access inside corporate networks.
Often we have to grant users access to internal ranges (e.g., 10.0.0.0/8) but still block traffic to specific sensitive hosts or subnets.
Without deny rules, it’s impossible to properly isolate internal resources while keeping general access available.

@ivanky4kin commented on GitHub (Oct 8, 2025): +1 This feature is essential for managing access inside corporate networks. Often we have to grant users access to internal ranges (e.g., 10.0.0.0/8) but still block traffic to specific sensitive hosts or subnets. Without deny rules, it’s impossible to properly isolate internal resources while keeping general access available.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1334