mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-24 18:31:33 +01:00
Add 39 test fixtures captured from Tailscale SaaS API responses to validate SSH policy compilation parity. Each JSON file contains the SSH policy section and expected compiled SSHRule arrays for 5 test nodes (3 user-owned, 2 tagged). Test series: SSH-A (basic), SSH-B (specific sources), SSH-C (destination combos), SSH-D (localpart), SSH-E (edge cases), SSH-F (multi-rule), SSH-G (acceptEnv). The data-driven TestSSHDataCompat harness uses cmp.Diff with principal order tolerance but strict rule ordering (first-match-wins semantics require exact order). Updates #3049
112 lines
2.3 KiB
JSON
112 lines
2.3 KiB
JSON
{
|
|
"test_id": "SSH-F2",
|
|
"policy_file": "ssh_policies/ssh_f2.json",
|
|
"ssh_section": [
|
|
{
|
|
"action": "accept",
|
|
"src": [
|
|
"autogroup:member"
|
|
],
|
|
"dst": [
|
|
"tag:server"
|
|
],
|
|
"users": [
|
|
"root"
|
|
]
|
|
},
|
|
{
|
|
"action": "check",
|
|
"src": [
|
|
"autogroup:member"
|
|
],
|
|
"dst": [
|
|
"tag:server"
|
|
],
|
|
"users": [
|
|
"root"
|
|
]
|
|
}
|
|
],
|
|
"nodes": {
|
|
"user1": {
|
|
"rules": []
|
|
},
|
|
"user-kris": {
|
|
"rules": []
|
|
},
|
|
"user-mon": {
|
|
"rules": []
|
|
},
|
|
"tagged-server": {
|
|
"rules": [
|
|
{
|
|
"principals": [
|
|
{
|
|
"nodeIP": "100.103.90.82"
|
|
},
|
|
{
|
|
"nodeIP": "100.110.121.96"
|
|
},
|
|
{
|
|
"nodeIP": "100.90.199.68"
|
|
},
|
|
{
|
|
"nodeIP": "fd7a:115c:a1e0::1737:7960"
|
|
},
|
|
{
|
|
"nodeIP": "fd7a:115c:a1e0::2d01:c747"
|
|
},
|
|
{
|
|
"nodeIP": "fd7a:115c:a1e0::9e37:5a52"
|
|
}
|
|
],
|
|
"sshUsers": {
|
|
"root": "root"
|
|
},
|
|
"action": {
|
|
"holdAndDelegate": "unused-server-url/machine/ssh/action/from/$SRC_NODE_ID/to/$DST_NODE_ID?ssh_user=$SSH_USER&local_user=$LOCAL_USER",
|
|
"allowAgentForwarding": true,
|
|
"allowLocalPortForwarding": true,
|
|
"allowRemotePortForwarding": true,
|
|
"sessionDuration": 43200000000000
|
|
}
|
|
},
|
|
{
|
|
"principals": [
|
|
{
|
|
"nodeIP": "100.103.90.82"
|
|
},
|
|
{
|
|
"nodeIP": "100.110.121.96"
|
|
},
|
|
{
|
|
"nodeIP": "100.90.199.68"
|
|
},
|
|
{
|
|
"nodeIP": "fd7a:115c:a1e0::1737:7960"
|
|
},
|
|
{
|
|
"nodeIP": "fd7a:115c:a1e0::2d01:c747"
|
|
},
|
|
{
|
|
"nodeIP": "fd7a:115c:a1e0::9e37:5a52"
|
|
}
|
|
],
|
|
"sshUsers": {
|
|
"root": "root"
|
|
},
|
|
"action": {
|
|
"accept": true,
|
|
"allowAgentForwarding": true,
|
|
"allowLocalPortForwarding": true,
|
|
"allowRemotePortForwarding": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"tagged-prod": {
|
|
"rules": []
|
|
}
|
|
}
|
|
}
|