Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Capabilities does not work #172

Closed
aruznieto opened this issue Oct 8, 2023 · 8 comments
Closed

bug: Capabilities does not work #172

aruznieto opened this issue Oct 8, 2023 · 8 comments
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.

Comments

@aruznieto
Copy link
Contributor

Bug Report

ZeroUI version:

v1.5.8 (latest)

Current behavior:

When I create an acceptance cap and then a drop, the packets drops.

cap test
  id 1000
  accept;
;

drop;

Steps to reproduce:

Create a Flow Rule like I show before, assign it to one client and try ping to other device connected at the network

@aruznieto aruznieto added the bug Inconsistencies or issues which will cause a problem for users or implementors. label Oct 8, 2023
@dec0dOS
Copy link
Owner

dec0dOS commented Oct 8, 2023

Need to investigate.
It appears that the issue may be related to the ZeroTier controller, possibly due to the 1.12 release. If the data is being written to the controller correctly from ZeroUI, then this could be the source of the problem.

Please report your ZeroTier controller version.
If it's higher than 1.12, you might want to consider downgrading and trying the 1.10 release to see if that resolves the issue.

@aruznieto
Copy link
Contributor Author

My version is 1.12.2 (zyclonite/zerotier:latest). Can I downgrade it without lossing anything?

@aruznieto
Copy link
Contributor Author

Need to investigate. It appears that the issue may be related to the ZeroTier controller, possibly due to the 1.12 release. If the data is being written to the controller correctly from ZeroUI, then this could be the source of the problem.

Please report your ZeroTier controller version. If it's higher than 1.12, you might want to consider downgrading and trying the 1.10 release to see if that resolves the issue.

Does not work with 1.10

@dec0dOS
Copy link
Owner

dec0dOS commented Oct 9, 2023

Hmm, may be it somehow related to #164 (comment)

@t3cneo
Copy link

t3cneo commented Oct 15, 2023

There is no bug here

It took me some times to understand how capabilities work : your rule should not end with drop;

have a look at my (working) flow rule :

# Allow only IPv4, IPv4 ARP, and IPv6 Ethernet frames.
#
drop
  not ethertype ipv4
  and not ethertype arp
  and not ethertype ipv6
  
;

#
# drop non-ZeroTier issued and managed IP addresses.
#
drop
  not chr ipauth
;

# Block TCP SYN,!ACK to prevent new non-whitelisted TCP connections from being initiated
# unless previously whitelisted or allowed by a capability.

break chr tcp_syn and not chr tcp_ack;
break ipprotocol 1;

# Capabilities

cap dns
  id 10
  accept ipprotocol udp;
  accept ipprotocol tcp;
  accept dport 53;
  ;


cap http
  id 11
  accept dport 80 or dport 443 and ipprotocol tcp;
  ;
  
cap ssh
  id 12
  accept dport 22 and ipprotocol tcp;
  ;
  
cap ping
  id 13
  accept ipprotocol 1;
  ;
  
cap zeroui
  id 14
  accept dport 4000 and ipprotocol tcp;
  ;

# Accept anything else. This is required since default is 'drop'.
accept;

as you'll see, my flow rule is greatly inspired from this article

@aruznieto
Copy link
Contributor Author

But the last rule is like the "default" rule right? If I want to drop by default... If I set a cap that accept the packets, it should be work right?

@t3cneo
Copy link

t3cneo commented Oct 15, 2023

No it is not, the default rule is drop as written in the default flow rule, read the comments in the flow rule I posted, it says it all

Docs says drop can't be overriden by capabilities, you want to break instead which can be overriden by a cap

@aruznieto
Copy link
Contributor Author

Mmmm, thanks you!!

@dec0dOS dec0dOS closed this as completed Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

3 participants