-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzpa_lss_config_controller.yml
95 lines (89 loc) · 3.05 KB
/
zpa_lss_config_controller.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
---
# zpa_lss_config_controller.yml - Create/Update/Delete a LSS Config Controller.
#
# Description
# ===========
#
# Quick example of how to use the 'zpa_lss_config_controller' module to create an LSS Config Controller in the ZPA Cloud.
#
# This playbook requires proper API credentials to be passed statically or via environment variables connection
# to the ZPA Cloud 'client_id', 'client_secret', customer_id and 'cloud'. These may be defined as host variables
# (see `host_vars/zpa_cloud.yml` for an example) or extra vars.
#
# LSS Config Requires One of the following Log Type Format.
# The paramenter `log_type` take one of the following parameters:
# * zpn_trans_log
# * zpn_ast_auth_log
# * zpn_auth_log
# * zpn_ast_comprehensive_stats
# * zpn_http_trans_log
#
# Modules Used
# ============
#
# zpa_lss_config_controller - https://zscaler.github.io/zpacloud-ansible/modules/zpa_lss_config_controller_module.html
#
# Usage
# =====
#
# $ ansible-playbook zpa_lss_config_controller.yml
- name: Create LSS Config Controller
hosts: localhost
connection: local
vars:
zpa_cloud:
client_id: "{{ client_id }}"
client_secret: "{{ client_secret | default(omit) }}"
customer_id: "{{ customer_id | default(omit) }}"
cloud: "{{ cloud | default(omit) }}"
tasks:
# Retrieve App Connector Group ID
- name: LSS App Connector Group
zscaler.zpacloud.zpa_app_connector_group_info:
provider: "{{ zpa_cloud }}"
name: LSS App Connector Group
register: lss_app_connector
# Retrieve LSS Log Types Format
- name: Gather LSS Log types formats
zscaler.zpacloud.zpa_lss_config_log_types_formats_info:
provider: "{{ zpa_cloud }}"
log_type: zpn_ast_auth_log
register: zpn_ast_auth_log
# Create LSS Configuration
- name: LSS Audit Logs
zscaler.zpacloud.zpa_lss_config_controller:
provider: "{{ zpa_cloud }}"
config:
name: LSS Audit Logs
description: LSS Audit Logs
enabled: true
lss_host: 192.168.1.1
lss_port: "11000"
format: "{{ zpn_ast_auth_log.data.json }}"
source_log_type: zpn_ast_auth_log
connector_groups:
- id: "{{ lss_app_connector.data[0].id }}"
# Retrieve LSS Log Types Format
- name: Gather LSS Log types formats
zscaler.zpacloud.zpa_lss_config_log_types_formats_info:
provider: "{{ zpa_cloud }}"
log_type: zpn_trans_log
register: zpn_trans_log
# Create LSS Configuration
- name: LSS User Activity
zscaler.zpacloud.zpa_lss_config_controller:
provider: "{{ zpa_cloud }}"
config:
name: LSS User Activity
description: LSS User Activity
enabled: true
lss_host: 192.168.1.1
lss_port: "11001"
format: "{{ zpn_trans_log.data.json }}"
source_log_type: zpn_trans_log
filter:
- ZPN_STATUS_AUTH_FAILED
- ZPN_STATUS_DISCONNECTED
- ZPN_STATUS_AUTHENTICATED
connector_groups:
- id: "{{ lss_app_connector.data[0].id }}"