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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: active_directory
short_description: Resource module for Active Directory
description:
- Manage operations create and delete of the resource Active Directory.
- This API creates an AD join point in Cisco ISE.
- This API deletes an AD join point from Cisco ISE.
version_added: '1.0.0'
extends_documentation_fragment:
- cisco.ise.module
author: Rafael Campos (@racampos)
options:
adAttributes:
description: Holds list of AD Attributes.
suboptions:
attributes:
description: List of Attributes.
elements: dict
suboptions:
defaultValue:
description: Required for each attribute in the attribute list. Can contain
an empty string. All characters are allowed except <%".
type: str
internalName:
description: Required for each attribute in the attribute list. All characters
are allowed except <%".
type: str
name:
description: Required for each attribute in the attribute list with no duplication
between attributes. All characters are allowed except <%".
type: str
type:
description: Required for each group in the group list. Allowed values STRING,
IP, BOOLEAN, INT, OCTET_STRING.
type: str
type: list
type: dict
adScopesNames:
description: String that contains the names of the scopes that the active directory
belongs to. Names are separated by comma. Alphanumeric, underscore (_) characters
are allowed.
type: str
adgroups:
description: Holds list of AD Groups.
suboptions:
groups:
description: List of Groups.
elements: dict
suboptions:
name:
description: Required for each group in the group list with no duplication
between groups. All characters are allowed except %.
type: str
sid:
description: Cisco ISE uses security identifiers (SIDs) for optimization
of group membership evaluation. SIDs are useful for efficiency (speed)
when the groups are evaluated. All characters are allowed except %.
type: str
type:
description: No character restriction.
type: str
type: list
type: dict
advancedSettings:
description: Active Directory's advancedSettings.
suboptions:
agingTime:
description: Range 1-8760 hours.
type: int
authProtectionType:
description: Enable prevent AD account lockout. Allowed values - WIRELESS, -
WIRED, - BOTH.
type: str
country:
description: User info attribute. All characters are allowed except %.
type: str
department:
description: User info attribute. All characters are allowed except %.
type: str
email:
description: User info attribute. All characters are allowed except %.
type: str
enableCallbackForDialinClient:
description: EnableCallbackForDialinClient flag.
type: bool
enableDialinPermissionCheck:
description: EnableDialinPermissionCheck flag.
type: bool
enableFailedAuthProtection:
description: Enable prevent AD account lockout due to too many bad password
attempts.
type: bool
enableMachineAccess:
description: EnableMachineAccess flag.
type: bool
enableMachineAuth:
description: EnableMachineAuth flag.
type: bool
enablePassChange:
description: EnablePassChange flag.
type: bool
enableRewrites:
description: EnableRewrites flag.
type: bool
failedAuthThreshold:
description: Number of bad password attempts.
type: int
firstName:
description: User info attribute. All characters are allowed except %.
type: str
identityNotInAdBehaviour:
description: Allowed values REJECT, SEARCH_JOINED_FOREST, SEARCH_ALL.
type: str
jobTitle:
description: User info attribute. All characters are allowed except %.
type: str
lastName:
description: User info attribute. All characters are allowed except %.
type: str
locality:
description: User info attribute. All characters are allowed except %.
type: str
organizationalUnit:
description: User info attribute. All characters are allowed except %.
type: str
plaintextAuth:
description: PlaintextAuth flag.
type: bool
rewriteRules:
description: Identity rewrite is an advanced feature that directs Cisco ISE
to manipulate the identity before it is passed to the external Active Directory
system. You can create rules to change the identity to a desired format that
includes or excludes a domain prefix and/or suffix or other additional markup
of your choice.
elements: dict
suboptions:
rewriteMatch:
description: Required for each rule in the list with no duplication between
rules. All characters are allowed except %".
type: str
rewriteResult:
description: Required for each rule in the list. All characters are allowed
except %".
type: str
rowId:
description: Required for each rule in the list in serial order.
type: int
type: list
schema:
description: Allowed values ACTIVE_DIRECTORY, CUSTOM. Choose ACTIVE_DIRECTORY
schema when the AD attributes defined in AD can be copied to relevant attributes
in Cisco ISE. If customization is needed, choose CUSTOM schema. All User info
attributes are always set to default value if schema is ACTIVE_DIRECTORY.
Values can be changed only for CUSTOM schema.
type: str
stateOrProvince:
description: User info attribute. All characters are allowed except %.
type: str
streetAddress:
description: User info attribute. All characters are allowed except %.
type: str
telephone:
description: User info attribute. All characters are allowed except %.
type: str
unreachableDomainsBehaviour:
description: Allowed values PROCEED, DROP.
type: str
type: dict
description:
description: No character restriction.
type: str
domain:
description: The AD domain. Alphanumeric, hyphen (-) and dot (.) characters are
allowed.
type: str
enableDomainWhiteList:
description: EnableDomainWhiteList flag.
type: bool
id:
description: Id path parameter.
type: str
name:
description: Resource Name. Maximum 32 characters allowed. Allowed characters are
alphanumeric and .-_/\\ characters.
type: str
requirements:
- ciscoisesdk >= 2.2.1
- python >= 3.5
notes:
- SDK Method used are
active_directory.ActiveDirectory.create_active_directory,
active_directory.ActiveDirectory.delete_active_directory_by_id,
- Paths used are
post /ers/config/activedirectory,
delete /ers/config/activedirectory/{id},
"""
EXAMPLES = r"""
- name: Delete by id
cisco.ise.active_directory:
ise_hostname: "{{ise_hostname}}"
ise_username: "{{ise_username}}"
ise_password: "{{ise_password}}"
ise_verify: "{{ise_verify}}"
state: absent
id: string
- name: Create
cisco.ise.active_directory:
ise_hostname: "{{ise_hostname}}"
ise_username: "{{ise_username}}"
ise_password: "{{ise_password}}"
ise_verify: "{{ise_verify}}"
state: present
adAttributes:
attributes:
- defaultValue: string
internalName: string
name: string
type: string
adScopesNames: string
adgroups:
groups:
- name: string
sid: string
type: string
advancedSettings:
agingTime: 0
authProtectionType: string
country: string
department: string
email: string
enableCallbackForDialinClient: true
enableDialinPermissionCheck: true
enableFailedAuthProtection: true
enableMachineAccess: true
enableMachineAuth: true
enablePassChange: true
enableRewrites: true
failedAuthThreshold: 0
firstName: string
identityNotInAdBehaviour: string
jobTitle: string
lastName: string
locality: string
organizationalUnit: string
plaintextAuth: true
rewriteRules:
- rewriteMatch: string
rewriteResult: string
rowId: 0
schema: string
stateOrProvince: string
streetAddress: string
telephone: string
unreachableDomainsBehaviour: string
description: string
domain: string
enableDomainWhiteList: true
id: string
name: string
"""
RETURN = r"""
ise_response:
description: A dictionary or list with the response returned by the Cisco ISE Python SDK
returned: always
type: dict
sample: >
{
"id": "string",
"name": "string",
"description": "string",
"domain": "string",
"enableDomainWhiteList": true,
"enableDomainAllowedList": true,
"adgroups": {
"groups": [
{
"name": "string",
"sid": "string",
"type": "string"
}
]
},
"advancedSettings": {
"enablePassChange": true,
"enableMachineAuth": true,
"enableMachineAccess": true,
"agingTime": 0,
"enableDialinPermissionCheck": true,
"enableCallbackForDialinClient": true,
"plaintextAuth": true,
"enableFailedAuthProtection": true,
"authProtectionType": "string",
"failedAuthThreshold": 0,
"identityNotInAdBehaviour": "string",
"unreachableDomainsBehaviour": "string",
"enableRewrites": true,
"rewriteRules": [
{
"rowId": 0,
"rewriteMatch": "string",
"rewriteResult": "string"
}
],
"firstName": "string",
"department": "string",
"lastName": "string",
"organizationalUnit": "string",
"jobTitle": "string",
"locality": "string",
"email": "string",
"stateOrProvince": "string",
"telephone": "string",
"country": "string",
"streetAddress": "string",
"schema": "string"
},
"adAttributes": {
"attributes": [
{
"name": "string",
"type": "string",
"internalName": "string",
"defaultValue": "string"
}
]
},
"adScopesNames": "string",
"link": {
"rel": "string",
"href": "string",
"type": "string"
}
}
"""
|