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

ACL rules don't apply correctly when locator listens on multiple interfaces #1159

Closed
oteffahi opened this issue Jun 17, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@oteffahi
Copy link
Contributor

oteffahi commented Jun 17, 2024

Describe the bug

When the listener locator matches multiple interfaces, ACL rules can allow traffic which should be denied on a specific interface in certain edge-cases. This is because the current code logic loops on interfaces looking for at least one explicit allow without checking the message's destination interface.

To reproduce

  1. Run z_sub example with listener on all interfaces: cargo run --example z_sub -- -c config.json5 -l tcp/0.0.0.0:7447 --no-multicast-scouting with following config file:
{
  access_control: {
    "enabled": true,
    "default_permission": "deny",
    "rules": [
      { // allow outgoing "declare_subscriber" on en0 and lo0
        "actions": [
          "declare_subscriber"
        ],
        "flows":["egress"],
        "permission": "allow",
        "key_exprs": [
          "demo/example/**"
        ],
        "interfaces": [
          "en0", "lo0"
        ]
      },
      { // allow incoming "put" on en0
        "actions": [
          "put"
        ],
        "flows":["ingress"],
        "permission": "allow",
        "key_exprs": [
          "demo/example/**"
        ],
        "interfaces": [
          "en0"
        ]
      },
    ]
  },   
}
  1. Run z_pub example with localhost endpoint: cargo run --example z_pub -- -e tcp/127.0.0.1:7447 --no-multicast-scouting
  • Expected behavior: Published messages are blocked on lo0 through the default_permission="deny"config
  • Current behavior: Published messages reach the subscriber through the lo0 interface.

System info

  • MacOS 14
  • Apple Silicon M2
  • Zenoh release 0.11.0
@oteffahi oteffahi added the bug Something isn't working label Jun 17, 2024
@oteffahi
Copy link
Contributor Author

oteffahi commented Jun 17, 2024

It looks like this issue is linked to #1093, and was fixed by #1123.
At the moment it still applies to UDP: #1126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant