|
102 | 102 | userfilter: |
103 | 103 | description: |
104 | 104 | - LDAP filter that will determine if a user has permission to authenticate to Vault |
| 105 | + token_bound_cidrs: |
| 106 | + description: |
| 107 | + - List of CIDR blocks; if set, specifies blocks of IP addresses which can authenticate successfully, and |
| 108 | + ties the resulting token to these blocks as well. |
105 | 109 | extends_documentation_fragment: hashivault |
106 | 110 | ''' |
107 | 111 | EXAMPLES = ''' |
@@ -157,6 +161,7 @@ def main(): |
157 | 161 | argspec['use_token_groups'] = dict(required=False, type='bool', default=False) |
158 | 162 | argspec['token_ttl'] = dict(required=False, type='int', default=0) |
159 | 163 | argspec['token_max_ttl'] = dict(required=False, type='int', default=0) |
| 164 | + argspec['token_bound_cidrs'] = dict(required=False, type='list', default=[]) |
160 | 165 |
|
161 | 166 | module = hashivault_init(argspec, supports_check_mode=True) |
162 | 167 | result = hashivault_auth_ldap(module) |
@@ -194,6 +199,7 @@ def hashivault_auth_ldap(module): |
194 | 199 | desired_state['use_token_groups'] = params.get('use_token_groups') |
195 | 200 | desired_state['token_ttl'] = params.get('token_ttl') |
196 | 201 | desired_state['token_max_ttl'] = params.get('token_max_ttl') |
| 202 | + desired_state['token_bound_cidrs'] = params.get('token_bound_cidrs') |
197 | 203 |
|
198 | 204 | # if bind pass is None, remove it from desired state since we can't compare |
199 | 205 | if desired_state['bind_pass'] is None: |
@@ -225,6 +231,7 @@ def hashivault_auth_ldap(module): |
225 | 231 | current_state['starttls'] = result['starttls'] |
226 | 232 | current_state['token_ttl'] = result['token_ttl'] |
227 | 233 | current_state['token_max_ttl'] = result['token_max_ttl'] |
| 234 | + current_state['token_bound_cidrs'] = result['token_bound_cidrs'] |
228 | 235 | except InvalidPath: |
229 | 236 | pass |
230 | 237 |
|
|
0 commit comments