Skip to content

Commit 6197dea

Browse files
authored
1 parent 933b609 commit 6197dea

File tree

5 files changed

+50
-10
lines changed

5 files changed

+50
-10
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ testdata:
55
-f testdata/input-parent.hujson \
66
-d testdata/departments/ \
77
-o testdata/output-file-to-compare-to.hujson \
8-
-allow=acls,autoApprovers,grants,groups,ipsets,ssh,tests
8+
-allow=acls,autoApprovers,grants,groups,ipsets,ssh,tests,sshTests

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var (
3636
"ssh": handleArray(),
3737
"tagOwners": handleObject(),
3838
"tests": handleArray(),
39+
"sshTests": handleArray(),
3940
"hosts": handleObject(),
4041
}
4142
)

testdata/departments/engineering/acls.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22
"acls": [
33
{
44
"action": "accept",
5-
"src": [
6-
7-
],
8-
"dst": [
9-
"tag:json-rule:22"
10-
],
11-
"srcPosture": [
12-
"posture:latestMac"
13-
]
5+
"src": ["[email protected]"],
6+
"dst": ["tag:json-rule:22"],
7+
"srcPosture": ["posture:latestMac"]
8+
}
9+
],
10+
"ssh": [
11+
{
12+
"action": "accept",
13+
"src": ["[email protected]"],
14+
"dst": ["autogroup:self"],
15+
"users": ["root", "autogroup:nonroot"]
16+
}
17+
],
18+
"sshTests": [
19+
{
20+
"src": ["[email protected]"],
21+
"dst": ["autogroup:self"],
22+
"accept": ["root", "autogroup:nonroot"]
1423
}
1524
]
1625
}

testdata/input-parent.hujson

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
},
5757
],
5858

59+
"sshTests": [
60+
{
61+
"src": ["autogroup:member"],
62+
"dst": ["autogroup:self"],
63+
"accept": ["root", "autogroup:nonroot"],
64+
},
65+
],
66+
5967
"tagOwners": {
6068
"tag:parent": [],
6169
"tag:user1": [

testdata/output-file-to-compare-to.hujson

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@
152152
"dst": ["autogroup:self"],
153153
"users": ["root", "autogroup:nonroot"],
154154
},
155+
// from `testdata/departments/engineering/acls.json`
156+
{
157+
"action": "accept",
158+
"src": ["[email protected]"],
159+
"dst": ["autogroup:self"],
160+
"users": ["root", "autogroup:nonroot"],
161+
},
155162
// from `testdata/departments/finance/ssh.hujson`
156163
{
157164
"action": "accept",
@@ -167,6 +174,21 @@
167174
},
168175
],
169176

177+
"sshTests": [
178+
// from `testdata/input-parent.hujson`
179+
{
180+
"src": ["autogroup:member"],
181+
"dst": ["autogroup:self"],
182+
"accept": ["root", "autogroup:nonroot"],
183+
},
184+
// from `testdata/departments/engineering/acls.json`
185+
{
186+
"src": ["[email protected]"],
187+
"dst": ["autogroup:self"],
188+
"accept": ["root", "autogroup:nonroot"],
189+
},
190+
],
191+
170192
"tagOwners": {
171193
// from `testdata/input-parent.hujson`
172194
"tag:parent": [],

0 commit comments

Comments
 (0)