illumio-pylo 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- illumio_pylo/API/APIConnector.py +12 -8
- illumio_pylo/API/CredentialsManager.py +9 -8
- illumio_pylo/Helpers/exports.py +77 -63
- illumio_pylo/IPMap.py +9 -0
- illumio_pylo/LabeledObject.py +1 -1
- illumio_pylo/Organization.py +4 -1
- illumio_pylo/Rule.py +27 -1
- illumio_pylo/Ruleset.py +15 -27
- illumio_pylo/Service.py +49 -52
- illumio_pylo/__init__.py +1 -1
- illumio_pylo/cli/__init__.py +19 -6
- illumio_pylo/cli/commands/credential_manager.py +91 -26
- illumio_pylo/cli/commands/ruleset_export.py +44 -37
- illumio_pylo/cli/commands/utils/misc.py +4 -0
- illumio_pylo/cli/commands/ven_compatibility_report_export.py +14 -8
- illumio_pylo/cli/commands/ven_duplicate_remover.py +18 -15
- illumio_pylo/cli/commands/ven_upgrader.py +10 -78
- illumio_pylo/cli/commands/workload_export.py +16 -12
- illumio_pylo/cli/commands/workload_import.py +50 -17
- illumio_pylo/cli/commands/workload_update.py +3 -2
- illumio_pylo/tmp.py +8 -4
- {illumio_pylo-0.3.0.dist-info → illumio_pylo-0.3.2.dist-info}/METADATA +1 -1
- {illumio_pylo-0.3.0.dist-info → illumio_pylo-0.3.2.dist-info}/RECORD +26 -30
- illumio_pylo/utilities/explorer_report_exporter.py +0 -86
- illumio_pylo/utilities/iplists_stats_duplicates_unused_finder.py +0 -75
- illumio_pylo/utilities/ven_idle_to_illumination.py +0 -344
- illumio_pylo/utilities/ven_reassign_pce.py +0 -183
- {illumio_pylo-0.3.0.dist-info → illumio_pylo-0.3.2.dist-info}/LICENSE +0 -0
- {illumio_pylo-0.3.0.dist-info → illumio_pylo-0.3.2.dist-info}/WHEEL +0 -0
- {illumio_pylo-0.3.0.dist-info → illumio_pylo-0.3.2.dist-info}/top_level.txt +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from typing import List, Dict
|
|
2
|
-
|
|
3
|
-
import illumio_pylo as pylo
|
|
4
2
|
import argparse
|
|
5
3
|
import sys
|
|
6
4
|
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
import illumio_pylo as pylo
|
|
7
|
+
from illumio_pylo import ArraysToExcel, ExcelHeader, ExcelHeaderSet
|
|
7
8
|
from .utils.misc import make_filename_with_timestamp
|
|
8
9
|
from . import Command
|
|
9
10
|
|
|
@@ -36,7 +37,7 @@ extra_columns: List[ExtraColumn] = []
|
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
def fill_parser(parser: argparse.ArgumentParser):
|
|
39
|
-
parser.add_argument('--output', required=False, default='
|
|
40
|
+
parser.add_argument('--output-dir', required=False, default='output')
|
|
40
41
|
|
|
41
42
|
parser.add_argument('--verbose', '-v', action='store_true',
|
|
42
43
|
help='')
|
|
@@ -65,23 +66,25 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
65
66
|
filter_file_delimiter = args['filter_file_delimiter']
|
|
66
67
|
filter_fields = args['filter_fields']
|
|
67
68
|
filter_keep_in_report = args['keep_filters_in_report']
|
|
68
|
-
|
|
69
|
+
settings_output_dir = args['output_dir']
|
|
69
70
|
verbose = args['verbose']
|
|
70
71
|
csv_output_only = args['csv_output_only']
|
|
71
72
|
excel_output_only = args['excel_output_only']
|
|
72
73
|
# print(args['filter_fields'])
|
|
73
74
|
|
|
74
|
-
output_file_prefix = make_filename_with_timestamp('workload_export_')
|
|
75
|
-
output_file_csv =
|
|
76
|
-
output_file_excel =
|
|
75
|
+
output_file_prefix = make_filename_with_timestamp('workload_export_', output_directory=settings_output_dir)
|
|
76
|
+
output_file_csv = output_file_prefix + '.csv'
|
|
77
|
+
output_file_excel = output_file_prefix + '.xlsx'
|
|
77
78
|
|
|
78
|
-
csv_report_headers = ['name', 'hostname']
|
|
79
|
+
csv_report_headers = ExcelHeaderSet(['name', 'hostname'])
|
|
79
80
|
for label_type in org.LabelStore.label_types:
|
|
80
81
|
csv_report_headers.append(f'label_{label_type}')
|
|
81
82
|
|
|
82
|
-
csv_report_headers.extend([
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
csv_report_headers.extend([
|
|
84
|
+
'online', 'managed', 'status', 'agent.last_heartbeat',
|
|
85
|
+
'agent.sec_policy_sync_state', 'agent.sec_policy_applied_at',
|
|
86
|
+
ExcelHeader(name='link_to_pce', wrap_text=False, url_text='See in PCE', is_url=True),
|
|
87
|
+
'href', 'agent.href'])
|
|
85
88
|
|
|
86
89
|
for extra_column in extra_columns:
|
|
87
90
|
csv_report_headers.append(extra_column.column_description().name)
|
|
@@ -109,7 +112,7 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
109
112
|
for field in filter_data._detected_headers:
|
|
110
113
|
csv_report_headers.append('_' + field)
|
|
111
114
|
|
|
112
|
-
csv_report =
|
|
115
|
+
csv_report = ArraysToExcel()
|
|
113
116
|
csv_sheet = csv_report.create_sheet('workloads', csv_report_headers, force_all_wrap_text=True)
|
|
114
117
|
|
|
115
118
|
all_workloads = org.WorkloadStore.itemsByHRef.copy()
|
|
@@ -131,6 +134,7 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
131
134
|
'online': wkl.online,
|
|
132
135
|
'managed': not wkl.unmanaged,
|
|
133
136
|
'status': wkl.get_status_string(),
|
|
137
|
+
'link_to_pce': wkl.href,
|
|
134
138
|
}
|
|
135
139
|
for label_type in org.LabelStore.label_types:
|
|
136
140
|
new_row[f'label_{label_type}'] = wkl.get_label_name(label_type)
|
|
@@ -3,7 +3,10 @@ from dataclasses import dataclass
|
|
|
3
3
|
import sys
|
|
4
4
|
import argparse
|
|
5
5
|
|
|
6
|
+
import click
|
|
7
|
+
|
|
6
8
|
import illumio_pylo as pylo
|
|
9
|
+
from illumio_pylo import ArraysToExcel, ExcelHeaderSet, ExcelHeader
|
|
7
10
|
from .utils.LabelCreation import generate_list_of_labels_to_create, create_labels
|
|
8
11
|
from .utils.misc import make_filename_with_timestamp
|
|
9
12
|
from . import Command
|
|
@@ -42,6 +45,12 @@ def fill_parser(parser: argparse.ArgumentParser):
|
|
|
42
45
|
parser.add_argument('--batch-size', type=int, required=False, default=500,
|
|
43
46
|
help='Number of Workloads to create per API call')
|
|
44
47
|
|
|
48
|
+
parser.add_argument('--proceed-with-creation', '-p', action='store_true',
|
|
49
|
+
help='If set, the script will proceed with the creation of the workloads')
|
|
50
|
+
|
|
51
|
+
parser.add_argument('--no-confirmation-required', '-n', action='store_true',
|
|
52
|
+
help='If set, the script will proceed with the creation of the workloads and labels without asking for confirmation')
|
|
53
|
+
|
|
45
54
|
|
|
46
55
|
|
|
47
56
|
def __main(args, org: pylo.Organization, **kwargs):
|
|
@@ -53,6 +62,8 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
53
62
|
settings_header_label_prefix: str = args['label_type_header_prefix']
|
|
54
63
|
settings_ignore_all_sorts_collisions: bool = args['ignore_all_sorts_collisions']
|
|
55
64
|
settings_ignore_empty_ip_entries: bool = args['ignore_empty_ip_entries']
|
|
65
|
+
settings_proceed_with_creation: bool = args['proceed_with_creation']
|
|
66
|
+
settings_no_confirmation_required: bool = args['no_confirmation_required']
|
|
56
67
|
settings_output_dir: str = args['output_dir']
|
|
57
68
|
|
|
58
69
|
batch_size = args['batch_size']
|
|
@@ -76,13 +87,14 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
76
87
|
csv_expected_fields.append({'name': f"{settings_header_label_prefix}{label_type}" , 'optional': True})
|
|
77
88
|
|
|
78
89
|
|
|
79
|
-
csv_report_headers = ['name', 'hostname', 'ip', 'description']
|
|
90
|
+
csv_report_headers = ExcelHeaderSet(['name', 'hostname', 'ip', 'description'])
|
|
80
91
|
for label_type in org.LabelStore.label_types:
|
|
81
92
|
csv_report_headers.append(f'label_{label_type}')
|
|
82
|
-
csv_report_headers.append({'name': '**not_created_reason**'})
|
|
83
|
-
csv_report_headers.append({'name': 'href', 'max_width': 15})
|
|
84
93
|
|
|
85
|
-
|
|
94
|
+
csv_report_headers.append(ExcelHeader(name='**not_created_reason**'))
|
|
95
|
+
csv_report_headers.append(ExcelHeader(name='href', max_width=15))
|
|
96
|
+
|
|
97
|
+
csv_report = ArraysToExcel()
|
|
86
98
|
csv_sheet = csv_report.create_sheet('Workloads', csv_report_headers)
|
|
87
99
|
|
|
88
100
|
|
|
@@ -111,6 +123,11 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
111
123
|
# <editor-fold desc="Missing Labels creation">
|
|
112
124
|
if len(labels_to_be_created) > 0:
|
|
113
125
|
print(" * {} Labels need to created before Workloads can be imported, listing:".format(len(labels_to_be_created)))
|
|
126
|
+
for label in labels_to_be_created:
|
|
127
|
+
print(" - Label: {} (type={})".format(label.name, label.type))
|
|
128
|
+
if not settings_no_confirmation_required:
|
|
129
|
+
click.confirm("Do you want to proceed with the creation of these labels?", abort=True)
|
|
130
|
+
|
|
114
131
|
create_labels(labels_to_be_created, org)
|
|
115
132
|
# </editor-fold>
|
|
116
133
|
|
|
@@ -132,21 +149,37 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
132
149
|
print(" * No Workloads to create, all were ignored due to collisions or missing data.")
|
|
133
150
|
# still want to save the CSV/Excel files in the end so don't exit
|
|
134
151
|
else:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
152
|
+
if not settings_proceed_with_creation is True:
|
|
153
|
+
print(" * No workload will be created because the --proceed-with-creation/-p flag was not set. Yet report will be generated")
|
|
154
|
+
for object_to_create in csv_objects_to_create:
|
|
155
|
+
if '**not_created_reason**' not in object_to_create:
|
|
156
|
+
object_to_create['**not_created_reason**'] = '--proceed-with-creation/-p flag was not set'
|
|
157
|
+
else:
|
|
158
|
+
confirmed = settings_no_confirmation_required
|
|
159
|
+
print(" * Creating {} Unmanaged Workloads in batches of {}".format(umw_creator_manager.count_drafts(), batch_size))
|
|
160
|
+
if not settings_no_confirmation_required:
|
|
161
|
+
confirmed = click.confirm("Do you want to proceed with the creation of these workloads?")
|
|
162
|
+
|
|
163
|
+
if not confirmed:
|
|
164
|
+
print(" * No Workloads will be created, user aborted the operation")
|
|
165
|
+
for object_to_create in csv_objects_to_create:
|
|
166
|
+
if '**not_created_reason**' not in object_to_create:
|
|
167
|
+
object_to_create['**not_created_reason**'] = 'user aborted the operation'
|
|
144
168
|
else:
|
|
145
|
-
|
|
146
|
-
|
|
169
|
+
total_created_count = 0
|
|
170
|
+
total_failed_count = 0
|
|
171
|
+
|
|
172
|
+
results = umw_creator_manager.create_all_in_pce(amount_created_per_batch=batch_size, retrieve_workloads_after_creation=False)
|
|
173
|
+
for result in results:
|
|
174
|
+
if result.success:
|
|
175
|
+
total_created_count += 1
|
|
176
|
+
result.external_tracker_id['href'] = result.workload_href
|
|
177
|
+
else:
|
|
178
|
+
total_failed_count += 1
|
|
179
|
+
result.external_tracker_id['**not_created_reason**'] = result.message
|
|
147
180
|
|
|
148
|
-
|
|
149
|
-
|
|
181
|
+
print(" * DONE - {} created with success, {} failures and {} ignored.".format(
|
|
182
|
+
total_created_count, total_failed_count, ignored_objects_count))
|
|
150
183
|
# </editor-fold>
|
|
151
184
|
|
|
152
185
|
print()
|
|
@@ -4,6 +4,7 @@ import argparse
|
|
|
4
4
|
import sys
|
|
5
5
|
|
|
6
6
|
import illumio_pylo as pylo
|
|
7
|
+
from illumio_pylo import ArraysToExcel, ExcelHeader, ExcelHeaderSet
|
|
7
8
|
from .utils.LabelCreation import generate_list_of_labels_to_create, create_labels
|
|
8
9
|
from .utils.misc import make_filename_with_timestamp
|
|
9
10
|
from . import Command
|
|
@@ -97,14 +98,14 @@ def __main(args, org: pylo.Organization, **kwargs):
|
|
|
97
98
|
context.ignored_workloads_count = 0
|
|
98
99
|
|
|
99
100
|
|
|
100
|
-
csv_report_headers
|
|
101
|
+
csv_report_headers = ExcelHeaderSet(['name', 'hostname'])
|
|
101
102
|
for label_type in org.LabelStore.label_types:
|
|
102
103
|
csv_report_headers.append(f'{context.settings_label_type_header_prefix}{label_type}')
|
|
103
104
|
for label_type in org.LabelStore.label_types:
|
|
104
105
|
csv_report_headers.append(f'new_{label_type}')
|
|
105
106
|
csv_report_headers.extend(['**updated**', '**reason**', 'href'])
|
|
106
107
|
|
|
107
|
-
context.csv_report = csv_report =
|
|
108
|
+
context.csv_report = csv_report = ArraysToExcel()
|
|
108
109
|
context.csv_report_sheet = context.csv_report.create_sheet('Workloads Update Report', csv_report_headers)
|
|
109
110
|
|
|
110
111
|
# <editor-fold desc="CSV input file data extraction">
|
illumio_pylo/tmp.py
CHANGED
|
@@ -3,12 +3,11 @@ from datetime import datetime
|
|
|
3
3
|
|
|
4
4
|
import illumio_pylo as pylo
|
|
5
5
|
|
|
6
|
-
log = logging.getLogger('
|
|
7
|
-
|
|
6
|
+
log = logging.getLogger('PYLO')
|
|
8
7
|
|
|
9
8
|
def init_logger():
|
|
10
9
|
console_logger = logging.StreamHandler()
|
|
11
|
-
formatter = logging.Formatter('%(asctime)s
|
|
10
|
+
formatter = logging.Formatter('%(asctime)s %(levelname)s %(name)s/%(filename)s:%(lineno)d - %(message)s')
|
|
12
11
|
console_logger.setFormatter(formatter)
|
|
13
12
|
log.addHandler(console_logger)
|
|
14
13
|
|
|
@@ -32,7 +31,12 @@ def get_logger():
|
|
|
32
31
|
return log
|
|
33
32
|
|
|
34
33
|
|
|
35
|
-
def find_connector_or_die(obj):
|
|
34
|
+
def find_connector_or_die(obj) -> 'pylo.APIConnector':
|
|
35
|
+
"""
|
|
36
|
+
Find the APIConnector object in the object or its owner recursively. Will raise an exception if not found
|
|
37
|
+
:param obj:
|
|
38
|
+
:return:
|
|
39
|
+
"""
|
|
36
40
|
connector = obj.__dict__.get('connector') # type: pylo.APIConnector
|
|
37
41
|
if connector is None:
|
|
38
42
|
owner = obj.__dict__.get('owner')
|
|
@@ -1,76 +1,72 @@
|
|
|
1
1
|
illumio_pylo/AgentStore.py,sha256=O4dz9m0KM0TQPZvvEMoD_5pCkMvQ70YVDaWqbqqhR4k,5091
|
|
2
2
|
illumio_pylo/Exception.py,sha256=3lxS-ANBaEvHAKhDb8UzNLj5IpQBmRHNs4YkHONmQjs,1033
|
|
3
3
|
illumio_pylo/IPList.py,sha256=XljZM4AHjM59PoR0bPLoJDVjLFJGVjewF91GwXV29UY,4501
|
|
4
|
-
illumio_pylo/IPMap.py,sha256=
|
|
4
|
+
illumio_pylo/IPMap.py,sha256=2xCU0BD6Zc5yWgemn6Q0jNgs0owzp7TCyh6sVRLMf5U,10232
|
|
5
5
|
illumio_pylo/Label.py,sha256=sn6qNFo8Etdl0lUYRoSp_VC0mJymuFJpQ99x9vAwKSY,835
|
|
6
6
|
illumio_pylo/LabelCommon.py,sha256=2HzljD2xJSBjf4Ywxk8JpBQQfbiZILCMV_Mj_EATIGk,1500
|
|
7
7
|
illumio_pylo/LabelGroup.py,sha256=bVXvONHwR44GkF-9S19Fs2cnc4g8IW42VjyKi7QXmvQ,2624
|
|
8
8
|
illumio_pylo/LabelStore.py,sha256=_feA5HdrfnOgcWStBToesu1S2ymHQKEKEG2Ygcadh9g,19809
|
|
9
|
-
illumio_pylo/LabeledObject.py,sha256=
|
|
10
|
-
illumio_pylo/Organization.py,sha256=
|
|
9
|
+
illumio_pylo/LabeledObject.py,sha256=zXIFcHtuvgxhu93htxiWtHoJ_mMWfSSdOBRNlEiXej0,1991
|
|
10
|
+
illumio_pylo/Organization.py,sha256=MeESA6HuU0HzzkIKbj1NW_wzkarq30ptsCiffD1lm2M,12379
|
|
11
11
|
illumio_pylo/Query.py,sha256=lgLjst41ma3HMVkngvTjL7zSLjh80RoXYL5vS3PWO7Q,13330
|
|
12
12
|
illumio_pylo/ReferenceTracker.py,sha256=HyY0NwZwOdAzSXJrs6i6dhB_kgn1tidZL5LFLLkPuSM,1070
|
|
13
|
-
illumio_pylo/Rule.py,sha256=
|
|
14
|
-
illumio_pylo/Ruleset.py,sha256=
|
|
13
|
+
illumio_pylo/Rule.py,sha256=jPU0hj8BDv2t-keL3NCK6NEd-kYSRkjwtzdo1xWiC5E,26352
|
|
14
|
+
illumio_pylo/Ruleset.py,sha256=G-YrxHRovECDV0TVOLOJyRbMtlgSNmqiq4jMwR3175A,11711
|
|
15
15
|
illumio_pylo/RulesetStore.py,sha256=wJLAKi32y-YiI8NLWWa_Ykrn54AQDcLz3rRlvTGUToI,3379
|
|
16
16
|
illumio_pylo/SecurityPrincipal.py,sha256=8c7VYirJvByjW4r8Vz4NYHXlGYawOVE6YHDpizSIIO4,2280
|
|
17
|
-
illumio_pylo/Service.py,sha256=
|
|
17
|
+
illumio_pylo/Service.py,sha256=CKj5VHjkvy7YL18afHqgJl-Qole7s1NWoah3rWHm6Zw,8280
|
|
18
18
|
illumio_pylo/SoftwareVersion.py,sha256=Wg8Mi7vcoL9JgFSRo3i5aiX_OkUIU3ahmgLUrzJ9JYw,4348
|
|
19
19
|
illumio_pylo/VirtualService.py,sha256=KAKE4iWuNmOumGradR2vwZxZ_3iiZg4pBST5ixCZSng,561
|
|
20
20
|
illumio_pylo/VirtualServiceStore.py,sha256=b6bcMixq0Vfv7WjQTQnFHGCv_Mld7sOfvGi4NtFAMQ4,3057
|
|
21
21
|
illumio_pylo/Workload.py,sha256=OIrP2TVFpCjQdjMYPdHkZHcKRszZ2hPnj4uRhI6d8EI,19677
|
|
22
22
|
illumio_pylo/WorkloadStore.py,sha256=08FKIk9fubsaHy_-m2a0Io5sO_V9jmTa40-L3vyemRc,10947
|
|
23
23
|
illumio_pylo/WorkloadStoreSubClasses.py,sha256=tK7s-7s5wRf9SHv3T00EOzgv4gX8gPIM77KBubCzBuo,6092
|
|
24
|
-
illumio_pylo/__init__.py,sha256=
|
|
25
|
-
illumio_pylo/tmp.py,sha256=
|
|
26
|
-
illumio_pylo/API/APIConnector.py,sha256=
|
|
24
|
+
illumio_pylo/__init__.py,sha256=0cUO16-EHeOd6bZL4Aap5BngagWLcGsCZAnvhoVSxdg,4192
|
|
25
|
+
illumio_pylo/tmp.py,sha256=7PIn11aYfoxed7tjG_I1iZmiacn4TxZPihs7qD7f4DI,3123
|
|
26
|
+
illumio_pylo/API/APIConnector.py,sha256=PM-7sNPmBaZ8fLM5KGcLd7nXBha4Il6fFGAHntToSdk,59433
|
|
27
27
|
illumio_pylo/API/AuditLog.py,sha256=p0mfjrE5S8qoJgA5LIP_XGFBP3iL86Nl6BQEmhMVrPA,1533
|
|
28
28
|
illumio_pylo/API/ClusterHealth.py,sha256=GdMpVQrHUW4zLM-409GcPHM8H8b3LAppO37ZcUZyT_Q,5122
|
|
29
|
-
illumio_pylo/API/CredentialsManager.py,sha256=
|
|
29
|
+
illumio_pylo/API/CredentialsManager.py,sha256=vPqekauA0twbcpbWx8GcGFX4DQlh0y0SWAE9M4HKBsE,11031
|
|
30
30
|
illumio_pylo/API/Explorer.py,sha256=fFAIF-67_uuKgJOP0eZPPJrOGuYmFl33GK75AyMjgJU,47590
|
|
31
31
|
illumio_pylo/API/JsonPayloadTypes.py,sha256=eUsK1ba8PLoV-VReRE6A3qar-N3xckXRZbY2ckSkmMk,7113
|
|
32
32
|
illumio_pylo/API/RuleSearchQuery.py,sha256=O0-MsUXhwmywoO0G-GXnLq6kkVC9LgmxMZwqVKc_oJE,5325
|
|
33
33
|
illumio_pylo/API/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
illumio_pylo/Helpers/__init__.py,sha256=6E2eTZe-4qfPKGjRRQNtYsPrBhJSAjbdvv_DpniV_rY,49
|
|
35
|
-
illumio_pylo/Helpers/exports.py,sha256=
|
|
35
|
+
illumio_pylo/Helpers/exports.py,sha256=mW8zGDqSyAsAC7WjC-WX1DDhDS-DCJ37cF3raZ_C6xg,21890
|
|
36
36
|
illumio_pylo/Helpers/functions.py,sha256=TjI_NmD3cm1Escp3h51SFEDgS1vT9dUa8PX9-e0siao,4680
|
|
37
37
|
illumio_pylo/cli/NativeParsers.py,sha256=nzDL54EV0J-Iz0P9EkeiPl6DWQBSbCu-MpEPRad3j6c,4055
|
|
38
|
-
illumio_pylo/cli/__init__.py,sha256=
|
|
38
|
+
illumio_pylo/cli/__init__.py,sha256=UuZ2KamgIpvfYE1FXilm_THHAvXimdUcvGb3Jrbjfhc,7737
|
|
39
39
|
illumio_pylo/cli/__main__.py,sha256=ll1gK8k1YL_kPsImI7WVlw2sCyNyhocnuCqko6mGaYI,223
|
|
40
40
|
illumio_pylo/cli/commands/__init__.py,sha256=yoVkXy-qBGiAAziWiayJdjcclx1WTayShXSPqHelcWA,1489
|
|
41
|
-
illumio_pylo/cli/commands/credential_manager.py,sha256=
|
|
41
|
+
illumio_pylo/cli/commands/credential_manager.py,sha256=nChEuE7jewCzVNH2dXn3VspsfPmplZO-TjXLt07h7MA,9613
|
|
42
42
|
illumio_pylo/cli/commands/iplist_analyzer.py,sha256=vOl6fNd0HrUKnKXtY1sj7jeyx2GtuDZENV7mF79O7yU,3714
|
|
43
43
|
illumio_pylo/cli/commands/iplist_import_from_file.py,sha256=XvC-GlJyjA4dDPzfvGoBFtwelI9g_rQqGzgKgqMYcsI,8284
|
|
44
|
-
illumio_pylo/cli/commands/ruleset_export.py,sha256=
|
|
44
|
+
illumio_pylo/cli/commands/ruleset_export.py,sha256=E64oYgGKI1Ry382DqV1gT4IlsLdd55QTqdInXlL9EPU,5896
|
|
45
45
|
illumio_pylo/cli/commands/update_pce_objects_cache.py,sha256=kNBAmPIbJyw97FRcNREy059A5FLOGm_poKJYGdTWqr4,1256
|
|
46
|
-
illumio_pylo/cli/commands/ven_compatibility_report_export.py,sha256=
|
|
47
|
-
illumio_pylo/cli/commands/ven_duplicate_remover.py,sha256=
|
|
46
|
+
illumio_pylo/cli/commands/ven_compatibility_report_export.py,sha256=8ZpgGQfn5zmOslgeE1imwx4-gDHfukdgoXJGZUh9q3o,8120
|
|
47
|
+
illumio_pylo/cli/commands/ven_duplicate_remover.py,sha256=sPq1E9LqJ0lku8c23zwfeJbCOblkG_3umve5-zV3DXU,19579
|
|
48
48
|
illumio_pylo/cli/commands/ven_idle_to_visibility.py,sha256=OMcQSB82Pn50TS7OL1_TPOvvN9XFR3jUxVYYizUQinI,13387
|
|
49
|
-
illumio_pylo/cli/commands/ven_upgrader.py,sha256=
|
|
50
|
-
illumio_pylo/cli/commands/workload_export.py,sha256
|
|
51
|
-
illumio_pylo/cli/commands/workload_import.py,sha256=
|
|
49
|
+
illumio_pylo/cli/commands/ven_upgrader.py,sha256=4cLUA7HSpskJpPOtEkQh41lE4gMGJJiQiKGCd0CKYJk,7222
|
|
50
|
+
illumio_pylo/cli/commands/workload_export.py,sha256=EcQR8AacJVe7rOqYH-HFxyTchwHHQ9ZTc-ALSMt9gDY,11421
|
|
51
|
+
illumio_pylo/cli/commands/workload_import.py,sha256=EJPjue9jnPR4UyLrh67LlXovvpmfa9Lb4DAfy6exAFA,18939
|
|
52
52
|
illumio_pylo/cli/commands/workload_reset_names_to_null.py,sha256=GaO2Th1rx8i7_7yqb9WkGpDz3sdbYNod5fABQnhogig,3383
|
|
53
|
-
illumio_pylo/cli/commands/workload_update.py,sha256=
|
|
53
|
+
illumio_pylo/cli/commands/workload_update.py,sha256=hDiYEeOwGaSUkoG4NK7EvKbMnChoYJAGDmqRWDtLD9A,28484
|
|
54
54
|
illumio_pylo/cli/commands/workload_used_in_rule_finder.py,sha256=2MO9jjYh-mkY6rkfvDyW0Ok6El_AqDWGXiFDYq5YgTk,3361
|
|
55
55
|
illumio_pylo/cli/commands/utils/LabelCreation.py,sha256=qaU7BeP4et2GJxHwgbDNRoQLCA-xWp_y1nJ-m8ANUwA,4883
|
|
56
56
|
illumio_pylo/cli/commands/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
|
-
illumio_pylo/cli/commands/utils/misc.py,sha256=
|
|
57
|
+
illumio_pylo/cli/commands/utils/misc.py,sha256=iV5CEEccfQ08eO0wSpTOxS9-32_GXSekShic6auuGPE,761
|
|
58
58
|
illumio_pylo/docs/Doxygen,sha256=AVvSIRYLHFWJ15YLGahhzhsW0ZUUFO5lVxd2-F3iWz8,74257
|
|
59
59
|
illumio_pylo/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
60
|
illumio_pylo/utilities/cli.py,sha256=7Wv7qhdc91-vsaxiu4j8k7LY7V9dcwWHnHV7PLpOBAI,320
|
|
61
61
|
illumio_pylo/utilities/credentials.example.json,sha256=CZcp3aAbdVljfyQzFbgxIZCU9Ln2eWZKfWcmN9VAeVc,439
|
|
62
|
-
illumio_pylo/utilities/explorer_report_exporter.py,sha256=23wUjqc20eHgvwxyVYuoFfNozah2491XFaTUFBYHw7w,2693
|
|
63
62
|
illumio_pylo/utilities/health_monitoring.py,sha256=sqe9gArMZm3s8y6Jg6F9SO_Rm2dj1aM99xpPi8WSFZc,3700
|
|
64
|
-
illumio_pylo/utilities/iplists_stats_duplicates_unused_finder.py,sha256=cmxf_PUG5h3apmLLzIeAhKujUfm9QDOEF-TNK0ZEu8I,2547
|
|
65
|
-
illumio_pylo/utilities/ven_idle_to_illumination.py,sha256=GKfpKHN4KdtYcmm-tepFaQhCtk-vLg5dH-NdnR2FJeU,14824
|
|
66
|
-
illumio_pylo/utilities/ven_reassign_pce.py,sha256=eKMfVMgkESBI-fXB-sBHMOsW24ooN-ng4mP9LOLpkW8,7700
|
|
67
63
|
illumio_pylo/utilities/resources/iplists-import-example.csv,sha256=beM9OBWJQNiYXlGh1KYiHxCN8LpZk4uPpoiO14-CgOE,200
|
|
68
64
|
illumio_pylo/utilities/resources/iplists-import-example.xlsx,sha256=VW-7CRr8NA2Vultv9jLGd8-_jzVp5ZtL3KgswjOUHeQ,16893
|
|
69
65
|
illumio_pylo/utilities/resources/workload-exporter-filter-example.csv,sha256=cn5IA8AGEPjvS-EsPXA_GJ-LFsdF9t_44rSzFTCmAzE,36
|
|
70
66
|
illumio_pylo/utilities/resources/workloads-import-example.csv,sha256=DEOGVikFjxQpMFFI0l0jb3hrxEEeZCpTGkmWkz6GUcY,91
|
|
71
67
|
illumio_pylo/utilities/resources/workloads-import-example.xlsx,sha256=U8Ac2BZidA6NlvBFAVPHqeY5zmg3rjmIAXp5b3b1P5w,17101
|
|
72
|
-
illumio_pylo-0.3.
|
|
73
|
-
illumio_pylo-0.3.
|
|
74
|
-
illumio_pylo-0.3.
|
|
75
|
-
illumio_pylo-0.3.
|
|
76
|
-
illumio_pylo-0.3.
|
|
68
|
+
illumio_pylo-0.3.2.dist-info/LICENSE,sha256=WYmcYJG1QFgu1hfo7qrEkZ3Jhcz8NUWe6XUraZvlIFs,10172
|
|
69
|
+
illumio_pylo-0.3.2.dist-info/METADATA,sha256=TQ6C78x4N8G9pvl48e9MKRErO1CIjV17ETRUM1tN824,12224
|
|
70
|
+
illumio_pylo-0.3.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
71
|
+
illumio_pylo-0.3.2.dist-info/top_level.txt,sha256=c5cu_ZMuSuxjq48ih58Kc0Tr8-JdQtV8GrKJicvWNFE,13
|
|
72
|
+
illumio_pylo-0.3.2.dist-info/RECORD,,
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
import argparse
|
|
4
|
-
import math
|
|
5
|
-
from datetime import datetime
|
|
6
|
-
|
|
7
|
-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
|
|
8
|
-
import illumio_pylo as pylo
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# <editor-fold desc="Argparse stuff">
|
|
12
|
-
parser = argparse.ArgumentParser(description='TODO LATER', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
|
13
|
-
parser.add_argument('--pce', type=str, required=True,
|
|
14
|
-
help='hostname of the PCE')
|
|
15
|
-
parser.add_argument('--debug', '-d', action='store_true',
|
|
16
|
-
help='extra debugging messages for developers')
|
|
17
|
-
|
|
18
|
-
parser.add_argument('--consumer-labels', '-cl', type=str, nargs='+', required=False, default=False,
|
|
19
|
-
help='extra debugging messages for developers')
|
|
20
|
-
# </editor-fold>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
args = vars(parser.parse_args())
|
|
24
|
-
|
|
25
|
-
if args['debug']:
|
|
26
|
-
pylo.log_set_debug()
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
hostname = args['pce']
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
now = datetime.now()
|
|
33
|
-
report_file = 'explorer-results_{}.csv'.format(now.strftime("%Y%m%d-%H%M%S"))
|
|
34
|
-
report_file_excel = 'explorer-results_{}.xlsx'.format(now.strftime("%Y%m%d-%H%M%S"))
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
csv_report_headers = ['name', 'hostname', 'role', 'app', 'env', 'loc', 'href']
|
|
38
|
-
csv_report = pylo.ArrayToExport(csv_report_headers)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# <editor-fold desc="PCE Configuration Download and Parsing">
|
|
42
|
-
org = pylo.Organization(1)
|
|
43
|
-
fake_config = pylo.Organization.create_fake_empty_config()
|
|
44
|
-
|
|
45
|
-
print(" * Looking for credentials for PCE '{}'... ".format(hostname), end="", flush=True)
|
|
46
|
-
connector = pylo.APIConnector.create_from_credentials_in_file(hostname, request_if_missing=True)
|
|
47
|
-
print("OK!")
|
|
48
|
-
|
|
49
|
-
print(" * Downloading Labels listing from the PCE... ", end="", flush=True)
|
|
50
|
-
fake_config['labels'] = connector.objects_label_get()
|
|
51
|
-
print("OK!")
|
|
52
|
-
|
|
53
|
-
print(" * Parsing PCE data ... ", end="", flush=True)
|
|
54
|
-
org.pce_version = connector.version
|
|
55
|
-
org.connector = connector
|
|
56
|
-
org.load_from_json(fake_config)
|
|
57
|
-
print("OK!")
|
|
58
|
-
|
|
59
|
-
# </editor-fold>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
print(" - Now building query parameters:")
|
|
63
|
-
if args['consumer_labels'] is not False:
|
|
64
|
-
print(" - Consumer labels were provided:")
|
|
65
|
-
else:
|
|
66
|
-
print(" - No Consumer label provided")
|
|
67
|
-
|
|
68
|
-
explorer_filters = connector.ExplorerFilterSetV1(max_results=2)
|
|
69
|
-
|
|
70
|
-
print(" - Querying PCE...", end='', flush=True)
|
|
71
|
-
search_results = connector.explorer_search(explorer_filters)
|
|
72
|
-
print(" OK!")
|
|
73
|
-
print(pylo.nice_json(search_results))
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
print()
|
|
77
|
-
print(" * Writing report file '{}' ... ".format(report_file), end='', flush=True)
|
|
78
|
-
csv_report.write_to_csv(report_file)
|
|
79
|
-
print("DONE")
|
|
80
|
-
print(" * Writing report file '{}' ... ".format(report_file_excel), end='', flush=True)
|
|
81
|
-
csv_report.write_to_excel(report_file_excel)
|
|
82
|
-
print("DONE")
|
|
83
|
-
|
|
84
|
-
if csv_report.lines_count() < 1:
|
|
85
|
-
print("\n** WARNING: no entry matched your filters so reports are empty !\n")
|
|
86
|
-
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
|
|
4
|
-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
|
|
5
|
-
import illumio_pylo as pylo
|
|
6
|
-
import argparse
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
parser = argparse.ArgumentParser(description='TODO LATER')
|
|
10
|
-
parser.add_argument('--pce', type=str, required=True,
|
|
11
|
-
help='hostname of the PCE')
|
|
12
|
-
|
|
13
|
-
args = vars(parser.parse_args())
|
|
14
|
-
|
|
15
|
-
hostname = args['pce']
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
org = pylo.Organization(1)
|
|
19
|
-
|
|
20
|
-
print("Loading PCE configuration from '{}' or cached file... ".format(hostname), end="", flush=True)
|
|
21
|
-
org.load_from_cache_or_saved_credentials(hostname, prompt_for_api_key_if_missing=True)
|
|
22
|
-
print("OK!\n")
|
|
23
|
-
|
|
24
|
-
unique_hashes = {}
|
|
25
|
-
unique_ipranges = {}
|
|
26
|
-
total_ipranges = 0
|
|
27
|
-
unused_iplists = []
|
|
28
|
-
|
|
29
|
-
for iplist in org.IPListStore.items_by_href.values():
|
|
30
|
-
#print("- handling of iplist '{}' with {} members".format(iplist.name, iplist.count_entries()))
|
|
31
|
-
entries_hash = ""
|
|
32
|
-
for entry in sorted(iplist.raw_entries):
|
|
33
|
-
total_ipranges += 1
|
|
34
|
-
|
|
35
|
-
entries_hash += entry + ' '
|
|
36
|
-
if entry not in unique_ipranges:
|
|
37
|
-
unique_ipranges[entry] = [iplist]
|
|
38
|
-
else:
|
|
39
|
-
unique_ipranges[entry].append(iplist)
|
|
40
|
-
|
|
41
|
-
#print(" - hash: {}".format(entries_hash))
|
|
42
|
-
|
|
43
|
-
if entries_hash in unique_hashes:
|
|
44
|
-
unique_hashes[entries_hash].append(iplist)
|
|
45
|
-
else:
|
|
46
|
-
unique_hashes[entries_hash] = [iplist]
|
|
47
|
-
|
|
48
|
-
if iplist.count_references() == 0:
|
|
49
|
-
unused_iplists.append(iplist)
|
|
50
|
-
|
|
51
|
-
#print(pylo.nice_json(iplist.raw_json))
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
print("*** Listing Unused IPLists ***")
|
|
55
|
-
for iplist in unused_iplists:
|
|
56
|
-
print(" - '{}' HREF:{}".format(iplist.name, iplist.href))
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
print("*** Listing Duplicate IPLists ***")
|
|
60
|
-
for hash in unique_hashes:
|
|
61
|
-
if len(unique_hashes[hash]) <= 1:
|
|
62
|
-
continue
|
|
63
|
-
print(" - hash {}'".format(hash))
|
|
64
|
-
for iplist in unique_hashes[hash]:
|
|
65
|
-
print(" - {} HREF:{}".format(iplist.name, iplist.href))
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
print("\nIPlist count: {}\nUnique iplists: {}\nIPRanges count: {}\nUnique IPRanges: {}".format(org.IPListStore.count(),
|
|
69
|
-
len(unique_hashes),
|
|
70
|
-
total_ipranges,
|
|
71
|
-
len(unique_ipranges)
|
|
72
|
-
))
|
|
73
|
-
print("Unused IPlists: {}".format(len(unused_iplists)))
|
|
74
|
-
|
|
75
|
-
print("\nGeneric Config statistics:\n{}".format(org.stats_to_str()))
|