-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathappflowparam.py
466 lines (447 loc) · 12.1 KB
/
appflowparam.py
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2023 Cloud Software Group, Inc.
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = r"""
---
module: appflowparam
short_description: Configuration for AppFlow parameter resource.
description: Configuration for AppFlow parameter resource.
version_added: 2.0.0
author:
- Sumanth Lingappa (@sumanth-lingappa)
- Shiva Shankar Vaddepally (@shivashankar-vaddepally)
options:
state:
choices:
- present
- unset
default: present
description:
- The state of the resource being configured by the module on the NetScaler
ADC node.
- When C(present), the resource will be added/updated configured according to
the module's parameters.
- When C(unset), the resource will be unset on the NetScaler ADC node.
type: str
aaausername:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable AppFlow AAA Username logging.
analyticsauthtoken:
type: str
description:
- Authentication token to be set by the agent.
appnamerefresh:
type: float
description:
- Interval, in seconds, at which to send Appnames to the configured collectors.
Appname refers to the name of an entity (virtual server, service, or service
group) in the Citrix ADC.
auditlogs:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable Auditlogs to be sent to the Telemetry Agent
cacheinsight:
type: str
choices:
- ENABLED
- DISABLED
description:
- Flag to determine whether cache records need to be exported or not. If this
flag is true and IC is enabled, cache records are exported instead of L7 HTTP
records
clienttrafficonly:
type: str
choices:
- 'YES'
- 'NO'
description:
- Generate AppFlow records for only the traffic from the client.
connectionchaining:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable connection chaining so that the client server flows of a connection
are linked. Also the connection chain ID is propagated across Citrix ADCs,
so that in a multi-hop environment the flows belonging to the same logical
connection are linked. This id is also logged as part of appflow record
cqareporting:
type: str
choices:
- ENABLED
- DISABLED
description:
- TCP CQA reporting enable/disable knob.
distributedtracing:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable generation of the distributed tracing templates in the Appflow records
disttracingsamplingrate:
type: float
description:
- Sampling rate for Distributed Tracing
emailaddress:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable AppFlow user email-id logging.
events:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable Events to be sent to the Telemetry Agent
flowrecordinterval:
type: float
description:
- Interval, in seconds, at which to send flow records to the configured collectors.
gxsessionreporting:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable this option for Gx session reporting
httpauthorization:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the HTTP Authorization header information.
httpcontenttype:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the HTTP Content-Type header sent from the server to the client to
determine the type of the content sent.
httpcookie:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the cookie that was in the HTTP request the appliance received from
the client.
httpdomain:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the http domain request to be exported.
httphost:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the host identified in the HTTP request that the appliance received
from the client.
httplocation:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the HTTP location headers returned from the HTTP responses.
httpmethod:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the method that was specified in the HTTP request that the appliance
received from the client.
httpquerywithurl:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the HTTP query segment along with the URL that the Citrix ADC received
from the client.
httpreferer:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the web page that was last visited by the client.
httpsetcookie:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the Set-cookie header sent from the server to the client in response
to a HTTP request.
httpsetcookie2:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the Set-cookie header sent from the server to the client in response
to a HTTP request.
httpurl:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the http URL that the Citrix ADC received from the client.
httpuseragent:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the client application through which the HTTP request was received
by the Citrix ADC.
httpvia:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the httpVia header which contains the IP address of proxy server through
which the client accessed the server.
httpxforwardedfor:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the httpXForwardedFor header, which contains the original IP Address
of the client using a proxy server to access the server.
identifiername:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the stream identifier name to be exported.
identifiersessionname:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the stream identifier session name to be exported.
logstreamovernsip:
type: str
choices:
- ENABLED
- DISABLED
description:
- To use the Citrix ADC IP to send Logstream records instead of the SNIP
lsnlogging:
type: str
choices:
- ENABLED
- DISABLED
description:
- On enabling this option, the Citrix ADC will send the Large Scale Nat(LSN)
records to the configured collectors.
metrics:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable Citrix ADC Stats to be sent to the Telemetry Agent
observationdomainid:
type: float
description:
- 'An observation domain groups a set of Citrix ADCs based on deployment: cluster,
HA etc. A unique Observation Domain ID is required to be assigned to each
such group.'
observationdomainname:
type: str
description:
- Name of the Observation Domain defined by the observation domain ID.
observationpointid:
type: float
description:
- An observation point ID is identifier for the NetScaler from which appflow
records are being exported. By default, the NetScaler IP is the observation
point ID.
securityinsightrecordinterval:
type: float
description:
- Interval, in seconds, at which to send security insight flow records to the
configured collectors.
securityinsighttraffic:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable/disable the feature individually on appflow action.
skipcacheredirectionhttptransaction:
type: str
choices:
- ENABLED
- DISABLED
description:
- Skip Cache http transaction. This HTTP transaction is specific to Cache Redirection
module. In Case of Cache Miss there will be another HTTP transaction initiated
by the cache server.
subscriberawareness:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable this option for logging end user MSISDN in L4/L7 appflow records
subscriberidobfuscation:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable this option for obfuscating MSISDN in L4/L7 appflow records
subscriberidobfuscationalgo:
type: str
choices:
- MD5
- SHA256
description:
- Algorithm(C(MD5) or C(SHA256)) to be used for obfuscating MSISDN
tcpattackcounterinterval:
type: float
description:
- Interval, in seconds, at which to send tcp attack counters to the configured
collectors. If 0 is configured, the record is not sent.
templaterefresh:
type: float
description:
- Refresh interval, in seconds, at which to export the template data. Because
data transmission is in UDP, the templates must be resent at regular intervals.
timeseriesovernsip:
type: str
choices:
- ENABLED
- DISABLED
description:
- To use the Citrix ADC IP to send Time series data such as metrics and events,
instead of the SNIP
udppmtu:
type: float
description:
- MTU, in bytes, for IPFIX UDP packets.
urlcategory:
type: str
choices:
- ENABLED
- DISABLED
description:
- Include the URL category record.
usagerecordinterval:
type: float
description:
- On enabling this option, the NGS will send bandwidth usage record to configured
collectors.
videoinsight:
type: str
choices:
- ENABLED
- DISABLED
description:
- Enable/disable the feature individually on appflow action.
websaasappusagereporting:
type: str
choices:
- ENABLED
- DISABLED
description:
- On enabling this option, NGS will send data used by Web/saas app at the end
of every HTTP transaction to configured collectors.
extends_documentation_fragment: netscaler.adc.netscaler_adc
"""
EXAMPLES = r"""
---
- name: Sample appflowparam playbook
hosts: demo_netscalers
gather_facts: false
tasks:
- name: Configure appflowparam
delegate_to: localhost
netscaler.adc.appflowparam:
state: present
templaterefresh: 3600
httpurl: ENABLED
httpmethod: ENABLED
httphost: ENABLED
httpuseragent: ENABLED
httpcontenttype: ENABLED
cacheinsight: ENABLED
httpquerywithurl: ENABLED
metrics: ENABLED
events: ENABLED
observationpointid: '843103498'
"""
RETURN = r"""
---
changed:
description: Indicates if any change is made by the module
returned: always
type: bool
sample: true
diff:
description: Dictionary of before and after changes
returned: always
type: dict
sample: {'before': {'key1': 'xyz'}, 'after': {'key2': 'pqr'}, 'prepared': 'changes
done'}
diff_list:
description: List of differences between the actual configured object and the configuration
specified in the module
returned: when changed
type: list
sample: ["Attribute `key1` differs. Desired: (<class 'str'>) XYZ. Existing: (<class
'str'>) PQR"]
failed:
description: Indicates if the module failed or not
returned: always
type: bool
sample: false
loglines:
description: list of logged messages by the module
returned: always
type: list
sample: ['message 1', 'message 2']
"""
import os
from ..module_utils.module_executor import ModuleExecutor
RESOURCE_NAME = os.path.basename(__file__).replace(".py", "")
def main():
executor = ModuleExecutor(RESOURCE_NAME)
executor.main()
if __name__ == "__main__":
main()