Debian Codegraph @

policy/testdata/restricted_destinations/tests.yaml

raw symbols SCIP
1 # Copyright 2024 Google LLC
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # https://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 description: Restricted destinations conformance tests.
16 section:
17 - name: "valid"
18 tests:
19 - name: "ip_allowed"
20 input:
21 spec.origin:
22 value: "us"
23 spec.restricted_destinations:
24 value:
25 - "cu"
26 - "ir"
27 - "kp"
28 - "sd"
29 - "sy"
30 destination.ip:
31 value: "10.0.0.1"
32 origin.ip:
33 value: "10.0.0.1"
34 request:
35 value:
36 auth:
37 claims: {}
38 resource:
39 value:
40 name: "/company/acme/secrets/doomsday-device"
41 labels:
42 location: "us"
43 output:
44 value: false # false means unrestricted
45 - name: "nationality_allowed"
46 input:
47 spec.origin:
48 value: "us"
49 spec.restricted_destinations:
50 value:
51 - "cu"
52 - "ir"
53 - "kp"
54 - "sd"
55 - "sy"
56 destination.ip:
57 value: "10.0.0.1"
58 request:
59 value:
60 auth:
61 claims:
62 nationality: "us"
63 resource:
64 value:
65 name: "/company/acme/secrets/doomsday-device"
66 labels:
67 location: "us"
68 output:
69 value: false
70 - name: "invalid"
71 tests:
72 - name: "destination_ip_prohibited"
73 input:
74 spec.origin:
75 value: "us"
76 spec.restricted_destinations:
77 value:
78 - "cu"
79 - "ir"
80 - "kp"
81 - "sd"
82 - "sy"
83 destination.ip:
84 value: "123.123.123.123"
85 origin.ip:
86 value: "10.0.0.1"
87 request:
88 value:
89 auth:
90 claims: {}
91 resource:
92 value:
93 name: "/company/acme/secrets/doomsday-device"
94 labels:
95 location: "us"
96 output:
97 value: true # true means restricted
98 - name: "resource_nationality_prohibited"
99 input:
100 spec.origin:
101 value: "us"
102 spec.restricted_destinations:
103 value:
104 - "cu"
105 - "ir"
106 - "kp"
107 - "sd"
108 - "sy"
109 destination.ip:
110 value: "10.0.0.1"
111 request:
112 value:
113 auth:
114 claims:
115 nationality: "us"
116 resource:
117 value:
118 name: "/company/acme/secrets/doomsday-device"
119 labels:
120 location: "cu"
121 output:
122 value: true