illumio-pylo 0.2.5__tar.gz

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.
Files changed (108) hide show
  1. illumio_pylo-0.2.5/.devcontainer/Dockerfile +4 -0
  2. illumio_pylo-0.2.5/.devcontainer/devcontainer.json +52 -0
  3. illumio_pylo-0.2.5/.gitattributes +2 -0
  4. illumio_pylo-0.2.5/.github/workflows/doxygen-publish.yml +31 -0
  5. illumio_pylo-0.2.5/.github/workflows/make-binaries.yml +38 -0
  6. illumio_pylo-0.2.5/.github/workflows/python-publish.yml +35 -0
  7. illumio_pylo-0.2.5/.gitignore +19 -0
  8. illumio_pylo-0.2.5/LICENSE +176 -0
  9. illumio_pylo-0.2.5/PKG-INFO +197 -0
  10. illumio_pylo-0.2.5/README.md +80 -0
  11. illumio_pylo-0.2.5/dev_playground/c2_workload_export.py +52 -0
  12. illumio_pylo-0.2.5/dev_playground/check_unique_hostnames.py +97 -0
  13. illumio_pylo-0.2.5/dev_playground/check_unique_services.py +106 -0
  14. illumio_pylo-0.2.5/dev_playground/delete_all_workloads.py +53 -0
  15. illumio_pylo-0.2.5/dev_playground/delete_unused_services.py +31 -0
  16. illumio_pylo-0.2.5/dev_playground/export_rules_to_firewall.py +727 -0
  17. illumio_pylo-0.2.5/dev_playground/generate-random-workloads.py +72 -0
  18. illumio_pylo-0.2.5/dev_playground/healthcheck_log.py +52 -0
  19. illumio_pylo-0.2.5/dev_playground/import-labels.py +87 -0
  20. illumio_pylo-0.2.5/dev_playground/import_workloads_placeholders.py +99 -0
  21. illumio_pylo-0.2.5/dev_playground/recalculate_explorer_logs.py +204 -0
  22. illumio_pylo-0.2.5/dev_playground/recalculate_explorer_logs_multithreaded.py +259 -0
  23. illumio_pylo-0.2.5/dev_playground/rules_exporter.py +245 -0
  24. illumio_pylo-0.2.5/dev_playground/rules_exporter_special.py +256 -0
  25. illumio_pylo-0.2.5/dev_playground/test.py +26 -0
  26. illumio_pylo-0.2.5/dev_playground/test_change_workload_desc.py +32 -0
  27. illumio_pylo-0.2.5/dev_playground/test_query.py +43 -0
  28. illumio_pylo-0.2.5/dev_playground/test_query2.py +72 -0
  29. illumio_pylo-0.2.5/dev_playground/test_securityprincipals.py +36 -0
  30. illumio_pylo-0.2.5/examples/explorer_query.py +84 -0
  31. illumio_pylo-0.2.5/examples/extend_cli.py +61 -0
  32. illumio_pylo-0.2.5/illumio_pylo/API/APIConnector.py +1308 -0
  33. illumio_pylo-0.2.5/illumio_pylo/API/AuditLog.py +42 -0
  34. illumio_pylo-0.2.5/illumio_pylo/API/ClusterHealth.py +136 -0
  35. illumio_pylo-0.2.5/illumio_pylo/API/CredentialsManager.py +286 -0
  36. illumio_pylo-0.2.5/illumio_pylo/API/Explorer.py +1077 -0
  37. illumio_pylo-0.2.5/illumio_pylo/API/JsonPayloadTypes.py +240 -0
  38. illumio_pylo-0.2.5/illumio_pylo/API/RuleSearchQuery.py +128 -0
  39. illumio_pylo-0.2.5/illumio_pylo/API/__init__.py +0 -0
  40. illumio_pylo-0.2.5/illumio_pylo/AgentStore.py +139 -0
  41. illumio_pylo-0.2.5/illumio_pylo/Exception.py +44 -0
  42. illumio_pylo-0.2.5/illumio_pylo/Helpers/__init__.py +3 -0
  43. illumio_pylo-0.2.5/illumio_pylo/Helpers/exports.py +508 -0
  44. illumio_pylo-0.2.5/illumio_pylo/Helpers/functions.py +166 -0
  45. illumio_pylo-0.2.5/illumio_pylo/IPList.py +135 -0
  46. illumio_pylo-0.2.5/illumio_pylo/IPMap.py +285 -0
  47. illumio_pylo-0.2.5/illumio_pylo/Label.py +25 -0
  48. illumio_pylo-0.2.5/illumio_pylo/LabelCommon.py +48 -0
  49. illumio_pylo-0.2.5/illumio_pylo/LabelGroup.py +68 -0
  50. illumio_pylo-0.2.5/illumio_pylo/LabelStore.py +403 -0
  51. illumio_pylo-0.2.5/illumio_pylo/LabeledObject.py +25 -0
  52. illumio_pylo-0.2.5/illumio_pylo/Organization.py +258 -0
  53. illumio_pylo-0.2.5/illumio_pylo/Query.py +331 -0
  54. illumio_pylo-0.2.5/illumio_pylo/ReferenceTracker.py +41 -0
  55. illumio_pylo-0.2.5/illumio_pylo/Rule.py +671 -0
  56. illumio_pylo-0.2.5/illumio_pylo/Ruleset.py +306 -0
  57. illumio_pylo-0.2.5/illumio_pylo/RulesetStore.py +101 -0
  58. illumio_pylo-0.2.5/illumio_pylo/SecurityPrincipal.py +62 -0
  59. illumio_pylo-0.2.5/illumio_pylo/Service.py +256 -0
  60. illumio_pylo-0.2.5/illumio_pylo/SoftwareVersion.py +125 -0
  61. illumio_pylo-0.2.5/illumio_pylo/VirtualService.py +17 -0
  62. illumio_pylo-0.2.5/illumio_pylo/VirtualServiceStore.py +75 -0
  63. illumio_pylo-0.2.5/illumio_pylo/Workload.py +506 -0
  64. illumio_pylo-0.2.5/illumio_pylo/WorkloadStore.py +289 -0
  65. illumio_pylo-0.2.5/illumio_pylo/__init__.py +82 -0
  66. illumio_pylo-0.2.5/illumio_pylo/cli/NativeParsers.py +96 -0
  67. illumio_pylo-0.2.5/illumio_pylo/cli/__init__.py +134 -0
  68. illumio_pylo-0.2.5/illumio_pylo/cli/__main__.py +10 -0
  69. illumio_pylo-0.2.5/illumio_pylo/cli/commands/__init__.py +32 -0
  70. illumio_pylo-0.2.5/illumio_pylo/cli/commands/credential_manager.py +168 -0
  71. illumio_pylo-0.2.5/illumio_pylo/cli/commands/iplist_import_from_file.py +185 -0
  72. illumio_pylo-0.2.5/illumio_pylo/cli/commands/misc.py +7 -0
  73. illumio_pylo-0.2.5/illumio_pylo/cli/commands/ruleset_export.py +129 -0
  74. illumio_pylo-0.2.5/illumio_pylo/cli/commands/update_pce_objects_cache.py +44 -0
  75. illumio_pylo-0.2.5/illumio_pylo/cli/commands/ven_duplicate_remover.py +366 -0
  76. illumio_pylo-0.2.5/illumio_pylo/cli/commands/ven_idle_to_visibility.py +287 -0
  77. illumio_pylo-0.2.5/illumio_pylo/cli/commands/ven_upgrader.py +226 -0
  78. illumio_pylo-0.2.5/illumio_pylo/cli/commands/workload_export.py +251 -0
  79. illumio_pylo-0.2.5/illumio_pylo/cli/commands/workload_import.py +423 -0
  80. illumio_pylo-0.2.5/illumio_pylo/cli/commands/workload_relabeler.py +510 -0
  81. illumio_pylo-0.2.5/illumio_pylo/cli/commands/workload_reset_names_to_null.py +83 -0
  82. illumio_pylo-0.2.5/illumio_pylo/cli/commands/workload_used_in_rule_finder.py +80 -0
  83. illumio_pylo-0.2.5/illumio_pylo/docs/Doxygen +1757 -0
  84. illumio_pylo-0.2.5/illumio_pylo/tmp.py +104 -0
  85. illumio_pylo-0.2.5/illumio_pylo/utilities/__init__.py +0 -0
  86. illumio_pylo-0.2.5/illumio_pylo/utilities/cli.py +10 -0
  87. illumio_pylo-0.2.5/illumio_pylo/utilities/credentials.example.json +20 -0
  88. illumio_pylo-0.2.5/illumio_pylo/utilities/explorer_report_exporter.py +86 -0
  89. illumio_pylo-0.2.5/illumio_pylo/utilities/health_monitoring.py +102 -0
  90. illumio_pylo-0.2.5/illumio_pylo/utilities/iplist_analyzer.py +148 -0
  91. illumio_pylo-0.2.5/illumio_pylo/utilities/iplists_stats_duplicates_unused_finder.py +75 -0
  92. illumio_pylo-0.2.5/illumio_pylo/utilities/resources/iplists-import-example.csv +3 -0
  93. illumio_pylo-0.2.5/illumio_pylo/utilities/resources/iplists-import-example.xlsx +0 -0
  94. illumio_pylo-0.2.5/illumio_pylo/utilities/resources/workload-exporter-filter-example.csv +3 -0
  95. illumio_pylo-0.2.5/illumio_pylo/utilities/resources/workloads-import-example.csv +2 -0
  96. illumio_pylo-0.2.5/illumio_pylo/utilities/resources/workloads-import-example.xlsx +0 -0
  97. illumio_pylo-0.2.5/illumio_pylo/utilities/ven_compatibility_report_export.py +240 -0
  98. illumio_pylo-0.2.5/illumio_pylo/utilities/ven_idle_to_illumination.py +344 -0
  99. illumio_pylo-0.2.5/illumio_pylo/utilities/ven_reassign_pce.py +183 -0
  100. illumio_pylo-0.2.5/illumio_pylo.egg-info/PKG-INFO +197 -0
  101. illumio_pylo-0.2.5/illumio_pylo.egg-info/SOURCES.txt +106 -0
  102. illumio_pylo-0.2.5/illumio_pylo.egg-info/dependency_links.txt +1 -0
  103. illumio_pylo-0.2.5/illumio_pylo.egg-info/requires.txt +8 -0
  104. illumio_pylo-0.2.5/illumio_pylo.egg-info/top_level.txt +1 -0
  105. illumio_pylo-0.2.5/pyproject.toml +18 -0
  106. illumio_pylo-0.2.5/requirements.txt +8 -0
  107. illumio_pylo-0.2.5/setup.cfg +4 -0
  108. illumio_pylo-0.2.5/setup.py +32 -0
@@ -0,0 +1,4 @@
1
+ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3/.devcontainer/base.Dockerfile
2
+
3
+ # [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
4
+ FROM python:${VARIANT}
@@ -0,0 +1,52 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2
+ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3
3
+ {
4
+ "name": "Python 3",
5
+ "forwardPorts": [8000],
6
+ "build": {
7
+ "dockerfile": "Dockerfile",
8
+ "context": "..",
9
+ "args": {
10
+ // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
11
+ // Append -bullseye or -buster to pin to an OS version.
12
+ // Use -bullseye variants on local on arm64/Apple Silicon.
13
+ "VARIANT": "3.10-slim-bullseye"
14
+ }
15
+ },
16
+ "features": {
17
+ "ghcr.io/devcontainers/features/sshd:1": {
18
+ "version": "latest"
19
+ }
20
+ },
21
+ // Configure tool-specific properties.
22
+ "customizations": {
23
+ // Configure properties specific to VS Code.
24
+ "vscode": {
25
+ // Set *default* container specific settings.json values on container create.
26
+ "settings": {
27
+ "python.defaultInterpreterPath": "/usr/local/bin/python",
28
+ "python.linting.enabled": true,
29
+ "python.linting.pylintEnabled": true,
30
+ "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
31
+ "python.formatting.blackPath": "/usr/local/py-utils/bin/black",
32
+ "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
33
+ "python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
34
+ "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
35
+ "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
36
+ "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
37
+ "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
38
+ "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
39
+ "python.testing.unittestEnabled": false,
40
+ "python.testing.pytestEnabled": true,
41
+ "workbench.startupEditor": "newUntitledFile"
42
+ },
43
+
44
+ // Add the IDs of extensions you want installed when the container is created.
45
+ "extensions": [
46
+ "ms-python.python",
47
+ "ms-python.vscode-pylance"
48
+ ]
49
+ }
50
+ },
51
+ "postAttachCommand": "python3"
52
+ }
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,31 @@
1
+
2
+ name: github pages
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - master # Set a branch name to trigger deployment
8
+
9
+
10
+ jobs:
11
+ deploy:
12
+ runs-on: ubuntu-20.04
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ with:
16
+ submodules: true # Fetch Hugo themes (true OR recursive)
17
+ fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
18
+
19
+ - name: Build
20
+ uses: mattnotmitt/doxygen-action@v1.9.5
21
+ with:
22
+ working-directory: 'illumio_pylo/'
23
+ doxyfile-path: 'docs/Doxygen'
24
+
25
+ - name: Deploy
26
+ uses: peaceiris/actions-gh-pages@v3
27
+ if: github.ref == 'refs/heads/master'
28
+ with:
29
+ github_token: ${{ secrets.GITHUB_TOKEN }}
30
+ publish_dir: ./illumio_pylo/html
31
+
@@ -0,0 +1,38 @@
1
+ name: Package exe with PyInstaller - Windows
2
+
3
+ on:
4
+ push:
5
+ branches: [ master, mt4l ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+
17
+ - name: Make executables
18
+ uses: cpainchaud/pyinstaller-action-windows@main
19
+ with:
20
+ path: ./
21
+ spec: illumio_pylo/utilities/
22
+ extra_python_paths: Z:\\github\\workspace\\;Z:\\github\\workspace\\pylo;C:\\Windows\\System32\\downlevel
23
+
24
+ - name: rename executables
25
+ run: |
26
+ mv dist/windows/cli.exe dist/windows/pylo-cli.exe
27
+
28
+ - name: Publish executables for Master branch
29
+ if: github.ref == 'refs/heads/master' && github.event_name == 'push'
30
+ uses: "marvinpinto/action-automatic-releases@latest"
31
+ with:
32
+ repo_token: "${{ secrets.GITHUB_TOKEN }}"
33
+ automatic_release_tag: "latest"
34
+ prerelease: true
35
+ title: "Latest Binaries"
36
+ files: |
37
+ dist/windows/*
38
+
@@ -0,0 +1,35 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ jobs:
16
+ deploy:
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ id-token: write
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v2
25
+ with:
26
+ python-version: '3.11'
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ pip install build
31
+ - name: Build package
32
+ run: python -m build
33
+ - name: Publish package
34
+ uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
35
+
@@ -0,0 +1,19 @@
1
+ # Compiled python modules.
2
+ *.pyc
3
+
4
+ # Setuptools distribution folder.
5
+ /dist/
6
+ /build/
7
+
8
+ # Python egg metadata, regenerated from source files by setuptools.
9
+ /*.egg-info
10
+
11
+ __pycache__/
12
+ *.iml
13
+
14
+ # IntelliJ project files
15
+ .idea
16
+
17
+ # VSCode project files
18
+ .vscode
19
+
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.1
2
+ Name: illumio_pylo
3
+ Version: 0.2.5
4
+ Summary: A set of tools and library for working with Illumio PCE
5
+ Home-page: https://github.com/cpainchaud/pylo
6
+ Author: Christophe Painchaud
7
+ Author-email: shellescape@gmail.com
8
+ License: Apache License
9
+ Version 2.0, January 2004
10
+ http://www.apache.org/licenses/
11
+
12
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
13
+
14
+ 1. Definitions.
15
+
16
+ "License" shall mean the terms and conditions for use, reproduction,
17
+ and distribution as defined by Sections 1 through 9 of this document.
18
+
19
+ "Licensor" shall mean the copyright owner or entity authorized by
20
+ the copyright owner that is granting the License.
21
+
22
+ "Legal Entity" shall mean the union of the acting entity and all
23
+ other entities that control, are controlled by, or are under common
24
+ control with that entity. For the purposes of this definition,
25
+ "control" means (i) the power, direct or indirect, to cause the
26
+ direction or management of such entity, whether by contract or
27
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
28
+ outstanding shares, or (iii) beneficial ownership of such entity.
29
+
30
+ "You" (or "Your") shall mean an individual or Legal Entity
31
+ exercising permissions granted by this License.
32
+
33
+ "Source" form shall mean the preferred form for making modifications,
34
+ including but not limited to software source code, documentation
35
+ source, and configuration files.
36
+
37
+ "Object" form shall mean any form resulting from mechanical
38
+ transformation or translation of a Source form, including but
39
+ not limited to compiled object code, generated documentation,
40
+ and conversions to other media types.
41
+
42
+ "Work" shall mean the work of authorship, whether in Source or
43
+ Object form, made available under the License, as indicated by a
44
+ copyright notice that is included in or attached to the work
45
+ (an example is provided in the Appendix below).
46
+
47
+ "Derivative Works" shall mean any work, whether in Source or Object
48
+ form, that is based on (or derived from) the Work and for which the
49
+ editorial revisions, annotations, elaborations, or other modifications
50
+ represent, as a whole, an original work of authorship. For the purposes
51
+ of this License, Derivative Works shall not include works that remain
52
+ separable from, or merely link (or bind by name) to the interfaces of,
53
+ the Work and Derivative Works thereof.
54
+
55
+ "Contribution" shall mean any work of authorship, including
56
+ the original version of the Work and any modifications or additions
57
+ to that Work or Derivative Works thereof, that is intentionally
58
+ submitted to Licensor for inclusion in the Work by the copyright owner
59
+ or by an individual or Legal Entity authorized to submit on behalf of
60
+ the copyright owner. For the purposes of this definition, "submitted"
61
+ means any form of electronic, verbal, or written communication sent
62
+ to the Licensor or its representatives, including but not limited to
63
+ communication on electronic mailing lists, source code control systems,
64
+ and issue tracking systems that are managed by, or on behalf of, the
65
+ Licensor for the purpose of discussing and improving the Work, but
66
+ excluding communication that is conspicuously marked or otherwise
67
+ designated in writing by the copyright owner as "Not a Contribution."
68
+
69
+ "Contributor" shall mean Licensor and any individual or Legal Entity
70
+ on behalf of whom a Contribution has been received by Licensor and
71
+ subsequently incorporated within the Work.
72
+
73
+ 2. Grant of Copyright License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ copyright license to reproduce, prepare Derivative Works of,
77
+ publicly display, publicly perform, sublicense, and distribute the
78
+ Work and such Derivative Works in Source or Object form.
79
+
80
+ 3. Grant of Patent License. Subject to the terms and conditions of
81
+ this License, each Contributor hereby grants to You a perpetual,
82
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
83
+ (except as stated in this section) patent license to make, have made,
84
+ use, offer to sell, sell, import, and otherwise transfer the Work,
85
+ where such license applies only to those patent claims licensable
86
+ by such Contributor that are necessarily infringed by their
87
+ Contribution(s) alone or by combination of their Contribution(s)
88
+ with the Work to which such Contribution(s) was submitted. If You
89
+ institute patent litigation against any entity (including a
90
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
91
+ or a Contribution incorporated within the Work constitutes direct
92
+ or contributory patent infringement, then any patent licenses
93
+ granted to You under this License for that Work shall terminate
94
+ as of the date such litigation is filed.
95
+
96
+ 4. Redistribution. You may reproduce and distribute copies of the
97
+ Work or Derivative Works thereof in any medium, with or without
98
+ modifications, and in Source or Object form, provided that You
99
+ meet the following conditions:
100
+
101
+ (a) You must give any other recipients of the Work or
102
+ Derivative Works a copy of this License; and
103
+
104
+ (b) You must cause any modified files to carry prominent notices
105
+ stating that You changed the files; and
106
+
107
+ (c) You must retain, in the Source form of any Derivative Works
108
+ that You distribute, all copyright, patent, trademark, and
109
+ attribution notices from the Source form of the Work,
110
+ excluding those notices that do not pertain to any part of
111
+ the Derivative Works; and
112
+
113
+ (d) If the Work includes a "NOTICE" text file as part of its
114
+ distribution, then any Derivative Works that You distribute must
115
+ include a readable copy of the attribution notices contained
116
+ within such NOTICE file, excluding those notices that do not
117
+ pertain to any part of the Derivative Works, in at least one
118
+ of the following places: within a NOTICE text file distributed
119
+ as part of the Derivative Works; within the Source form or
120
+ documentation, if provided along with the Derivative Works; or,
121
+ within a display generated by the Derivative Works, if and
122
+ wherever such third-party notices normally appear. The contents
123
+ of the NOTICE file are for informational purposes only and
124
+ do not modify the License. You may add Your own attribution
125
+ notices within Derivative Works that You distribute, alongside
126
+ or as an addendum to the NOTICE text from the Work, provided
127
+ that such additional attribution notices cannot be construed
128
+ as modifying the License.
129
+
130
+ You may add Your own copyright statement to Your modifications and
131
+ may provide additional or different license terms and conditions
132
+ for use, reproduction, or distribution of Your modifications, or
133
+ for any such Derivative Works as a whole, provided Your use,
134
+ reproduction, and distribution of the Work otherwise complies with
135
+ the conditions stated in this License.
136
+
137
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
138
+ any Contribution intentionally submitted for inclusion in the Work
139
+ by You to the Licensor shall be under the terms and conditions of
140
+ this License, without any additional terms or conditions.
141
+ Notwithstanding the above, nothing herein shall supersede or modify
142
+ the terms of any separate license agreement you may have executed
143
+ with Licensor regarding such Contributions.
144
+
145
+ 6. Trademarks. This License does not grant permission to use the trade
146
+ names, trademarks, service marks, or product names of the Licensor,
147
+ except as required for reasonable and customary use in describing the
148
+ origin of the Work and reproducing the content of the NOTICE file.
149
+
150
+ 7. Disclaimer of Warranty. Unless required by applicable law or
151
+ agreed to in writing, Licensor provides the Work (and each
152
+ Contributor provides its Contributions) on an "AS IS" BASIS,
153
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
154
+ implied, including, without limitation, any warranties or conditions
155
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
156
+ PARTICULAR PURPOSE. You are solely responsible for determining the
157
+ appropriateness of using or redistributing the Work and assume any
158
+ risks associated with Your exercise of permissions under this License.
159
+
160
+ 8. Limitation of Liability. In no event and under no legal theory,
161
+ whether in tort (including negligence), contract, or otherwise,
162
+ unless required by applicable law (such as deliberate and grossly
163
+ negligent acts) or agreed to in writing, shall any Contributor be
164
+ liable to You for damages, including any direct, indirect, special,
165
+ incidental, or consequential damages of any character arising as a
166
+ result of this License or out of the use or inability to use the
167
+ Work (including but not limited to damages for loss of goodwill,
168
+ work stoppage, computer failure or malfunction, or any and all
169
+ other commercial damages or losses), even if such Contributor
170
+ has been advised of the possibility of such damages.
171
+
172
+ 9. Accepting Warranty or Additional Liability. While redistributing
173
+ the Work or Derivative Works thereof, You may choose to offer,
174
+ and charge a fee for, acceptance of support, warranty, indemnity,
175
+ or other liability obligations and/or rights consistent with this
176
+ License. However, in accepting such obligations, You may act only
177
+ on Your own behalf and on Your sole responsibility, not on behalf
178
+ of any other Contributor, and only if You agree to indemnify,
179
+ defend, and hold each Contributor harmless for any liability
180
+ incurred by, or claims asserted against, such Contributor by reason
181
+ of your accepting any such warranty or additional liability.
182
+
183
+ END OF TERMS AND CONDITIONS
184
+ Project-URL: Homepage, https://github.com/cpainchaud/pylo
185
+ Project-URL: Issues, https://github.com/cpainchaud/pylo/issues
186
+ Requires-Python: >=3.11
187
+ License-File: LICENSE
188
+ Requires-Dist: click==8.1.7
189
+ Requires-Dist: colorama~=0.4.4
190
+ Requires-Dist: cryptography~=42.0.5
191
+ Requires-Dist: openpyxl~=3.1.2
192
+ Requires-Dist: paramiko~=3.4.0
193
+ Requires-Dist: prettytable~=3.10.0
194
+ Requires-Dist: requests~=2.31.0
195
+ Requires-Dist: xlsxwriter~=3.2.0
196
+
197
+ README.md
@@ -0,0 +1,80 @@
1
+ # Pylo
2
+
3
+ ## Introduction
4
+ A framework and set of utilities to interact with Illumio's PCE (Policy Compute Engine)
5
+
6
+
7
+ ## Example
8
+
9
+ ### Remove TCP/3389 from all rules using fully object oriented framework
10
+ ```python
11
+ import illumio_pylo as pylo
12
+
13
+ pce_hostname = 'pce212-beauty-contest.illumio.microsegment.io'
14
+
15
+ pylo.log_set_debug()
16
+ org = pylo.Organization(1)
17
+
18
+ print("* Loading PCE objects from API: ", end='', flush=True)
19
+ org.load_from_saved_credentials(pce_hostname, prompt_for_api_key=True)
20
+ print("OK!")
21
+
22
+ print("* PCE statistics: ", end='', flush=True)
23
+ print(org.stats_to_str())
24
+
25
+ print()
26
+
27
+ for ruleset in org.RulesetStore.itemsByHRef.values():
28
+ for rule in ruleset.rules_byHref.values():
29
+ for service in rule.services.get_direct_services():
30
+ if service.is_tcp() and service.to_port is None and service.port == 3389:
31
+ print("Rule {} is concerned".format(rule.href))
32
+ rule.services.remove_direct_service(service)
33
+ rule.services.api_sync()
34
+
35
+
36
+ ```
37
+
38
+ ### Creating an IPList using raw API calls and json payloads
39
+
40
+ ```python
41
+ import illumio_pylo as pylo
42
+
43
+ pce_hostname = 'pce212-beauty-contest.illumio.microsegment.io'
44
+
45
+ connector = pylo.APIConnector.create_from_credentials_in_file(pce_hostname, request_if_missing=True)
46
+
47
+ if connector is None:
48
+ print("****ERROR**** No cached credentials found for PCE {}".format())
49
+ exit(1)
50
+
51
+ print("PCE Software version is {}".format(connector.get_software_version_string()))
52
+
53
+ print("* Now downloading Workload JSON...", end='', flush=True)
54
+ all_workloads_json = connector.objects_workload_get(max_results=999999, async_mode=False)
55
+ print("OK")
56
+
57
+ print()
58
+
59
+ print("* Now listing workloads names from JSON data:", end='', flush=True)
60
+ for workload_json in all_workloads_json:
61
+ print(" - {} / href:{}".format(workload_json['name'], workload_json['href']))
62
+
63
+ print()
64
+
65
+ print("* attempting to create an IP¨List", end='', flush=True)
66
+ data = {'name': 'an IPList 2', "ip_ranges": [
67
+ {"from_ip": "192.168.0.0/24"},
68
+ {"from_ip": "172.16.0.0/24"},
69
+ ]}
70
+ result = connector.objects_iplist_create(data)
71
+
72
+ if 'href' not in result:
73
+ print("****ERROR**** Object was not created, PCE response was: ".format(result))
74
+ exit(1)
75
+
76
+ print("OK! created with HREF={}".format(result['href']))
77
+
78
+ print()
79
+
80
+ ```