Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tailscale/policy.hujson
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,42 @@
"dst": ["tag:subnet-router:*"],
},


// Sandbox hosts reach only the Incus cluster API through the lab
// subnet route.
{
"action": "accept",
"src": ["tag:sandbox"],
"proto": "tcp",
"dst": [
"10.10.10.11:8443",
"10.10.10.12:8443",
"10.10.10.13:8443",
"10.10.10.14:8443",
],
},
// Routed hosts in the lab and home ranges reach each other in both
// directions.
{"action": "accept", "src": ["10.10.0.0/16"], "dst": ["172.16.0.0/16:*"]},
{"action": "accept", "src": ["172.16.0.0/16"], "dst": ["10.10.0.0/16:*"]},
],

"tests": [
{
"src": "tag:sandbox",
"accept": [
"10.10.10.11:8443",
"10.10.10.12:8443",
"10.10.10.13:8443",
"10.10.10.14:8443",
],
"deny": [
"10.10.10.10:8443",
"10.10.10.11:8444",
],
},
],

"ssh": [
// Tailscale SSH to your own devices, with periodic reauthentication.
{
Expand Down
14 changes: 14 additions & 0 deletions tests/test_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ def test_rtr01_gateway_health_probe_is_allowed() -> None:
}""" in load_template()


def test_sandbox_to_management_is_allowed() -> None:
from networking_vyos.render import load_template

assert """rule 10 {
action accept
description "Allow sandbox to management"
destination {
group {
network-group LAB_MGMT
}
}
}""" in load_template()


def test_invented_footer_is_rejected() -> None:
with pytest.raises(ToolError, match="must not invent"):
validate_template(VALID_TEMPLATE + '\n// vyos-config-version: "guessed@1"\n')
Expand Down
4 changes: 2 additions & 2 deletions vyos/gw01/config.boot.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ firewall {
default-log
description "Forward from sandbox"
rule 10 {
action drop
description "Block sandbox to management"
action accept
description "Allow sandbox to management"
destination {
group {
network-group LAB_MGMT
Expand Down