-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathmain.yml
164 lines (151 loc) · 5.19 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
vault_configure_canary:
path: cubbyhole/configure_basic
value: complete # value does not matter
vault_kv1_mount_point: kv1
vault_kv1_path: testproject
vault_kv1_api_path: '{{ vault_kv1_mount_point }}/{{ vault_kv1_path }}'
vault_kv2_mount_point: kv2
unauthorized_vault_kv2_mount_point: kv2_noauth
cas_required_vault_kv2_mount_point: kv2_cas
vault_kv2_path: testproject
vault_kv2_multi_path: testmulti
vault_kv2_versioned_path: versioned
vault_kv2_api_path: '{{ vault_kv2_mount_point }}/data/{{ vault_kv2_path }}'
vault_kv2_multi_api_path: '{{ vault_kv2_mount_point }}/data/{{ vault_kv2_multi_path }}'
vault_kv2_versioned_api_path: '{{ vault_kv2_mount_point }}/data/{{ vault_kv2_versioned_path }}'
vault_kv2_delete_api_path: '{{ vault_kv2_mount_point }}/delete/{{ vault_kv2_versioned_path }}'
vault_kv2_metadata_api_path: '{{ vault_kv2_mount_point }}/metadata/{{ vault_kv2_versioned_path }}'
vault_kv2_api_list_mount_point: '{{ vault_kv2_mount_point }}/metadata'
vault_kv2_api_list_path: '{{ vault_kv2_mount_point }}/metadata/{{ vault_kv2_path }}'
vault_policy_api_list_path: 'sys/policies/acl'
vault_kv2_api_list_inexistent_path: '{{ vault_kv2_mount_point }}/metadata/__inexistent'
vault_kv2_api_list_inexistent_mount_point: '{{ vault_kv2_mount_point }}__inexistent/metadata'
vault_kv2_api_list_inexistent_unauthorized_path: '{{ vault_kv2_mount_point }}/metadata/__inexistent_no_auth'
vault_kv2_api_list_unauthorized_path: '{{ unauthorized_vault_kv2_mount_point }}/metadata'
vault_base_policy: |
path "{{ vault_kv1_api_path }}/secret1" {
capabilities = ["read"]
}
path "{{ vault_kv1_api_path }}/secret2" {
capabilities = ["read", "update"]
}
path "{{ vault_kv1_api_path }}/secret3" {
capabilities = ["deny"]
}
path "{{ vault_kv1_api_path }}/non_existent_secret" {
capabilities = ["read"]
}
path "{{ vault_kv2_api_path }}/secret1" {
capabilities = ["read"]
}
path "{{ vault_kv2_api_path }}/secret2" {
capabilities = ["read", "update"]
}
path "{{ vault_kv2_api_path }}/secret3" {
capabilities = ["deny"]
}
path "{{ vault_kv2_multi_api_path }}/secrets" {
capabilities = ["read"]
}
path "{{ vault_kv2_api_path }}/secret4" {
capabilities = ["read", "update"]
}
# module_vault_kv2_write tests
path "{{ vault_kv2_api_path }}/write1" {
capabilities = ["read", "create", "update"]
}
# module_vault_kv2_write tests
path "{{ vault_kv2_api_path }}/readonly" {
capabilities = ["read"]
}
# module_vault_kv2_write tests
path "{{ cas_required_vault_kv2_mount_point }}/data/write1" {
capabilities = ["read", "create", "update"]
}
# module_vault_kv2_write tests
path "{{ vault_kv2_api_path }}/deny" {
capabilities = ["deny"]
}
# module_vault_kv2_write tests
path "{{ vault_kv2_api_path }}/404" {
capabilities = ["read", "create", "update"]
}
# module_vault_kv2_write tests
path "{{ vault_kv2_api_path }}/writeonly" {
capabilities = ["create", "update"]
}
path "{{ vault_kv2_mount_point }}/metadata/{{ vault_kv2_path }}/write1" {
capabilities = ["delete"]
}
path "{{ vault_kv2_api_path }}/non_existent_secret" {
capabilities = ["read"]
}
path "{{ vault_kv2_versioned_api_path }}/*" {
capabilities = ["read"]
}
path "{{ vault_kv2_versioned_api_path }}/secret6" {
capabilities = ["delete"]
}
path "{{ vault_kv2_versioned_api_path }}/non_existent_secret" {
capabilities = ["delete"]
}
path "{{ vault_kv2_delete_api_path }}/secret6" {
capabilities = ["create", "update"]
}
path "{{ vault_kv2_delete_api_path }}/non_existent_secret" {
capabilities = ["create", "update"]
}
path "{{ vault_kv2_metadata_api_path }}/secret6" {
capabilities = ["read"]
}
path "{{ vault_kv2_api_list_mount_point }}/*" {
capabilities = ["list"]
}
path "{{ vault_kv2_api_list_path }}" {
capabilities = ["list"]
}
path "{{ vault_policy_api_list_path }}" {
capabilities = ["list"]
}
path "{{ vault_kv2_api_list_inexistent_unauthorized_path }}" {
capabilities = ["deny"]
}
path "{{ vault_kv2_api_list_unauthorized_path }}" {
capabilities = ["deny"]
}
vault_token_creator_policy: |
path "auth/token/create" {
capabilities = ["create", "update"]
}
path "auth/token/create/*" {
capabilities = ["create", "update"]
}
vault_orphan_creator_policy: |
path "auth/token/create" {
capabilities = ["create", "update"]
}
path "auth/token/create/*" {
capabilities = ["create", "update"]
}
path "auth/token/create-orphan" {
capabilities = ["create", "update", "sudo"]
}
vault_invalid_kv2_path_policy: |
path "{{ vault_kv2_mount_point }}/{{ vault_kv2_path }}/*" {
capabilities = ["read"]
}
# the purpose of these policies is to catch when the plugin accepts mount_point but does not pass
# it into hvac. we set the test policy to deny access to this secret and the alt policy to read it
# the test-policy is assigned to the default mount of the auth method, while the alt policy is
# assigned to the alternate (non-default) mount
vault_test_policy: |
{{ vault_base_policy }}
path "{{ vault_kv2_api_path }}/secret5" {
capabilities = ["deny"]
}
vault_alt_policy: |
{{ vault_base_policy }}
path "{{ vault_kv2_api_path }}/secret5" {
capabilities = ["read"]
}