python4cpm 1.0.20__tar.gz → 1.0.21__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.
- {python4cpm-1.0.20/src/python4cpm.egg-info → python4cpm-1.0.21}/PKG-INFO +20 -8
- {python4cpm-1.0.20 → python4cpm-1.0.21}/README.md +19 -7
- {python4cpm-1.0.20 → python4cpm-1.0.21}/pyproject.toml +1 -1
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm/logger.py +3 -3
- {python4cpm-1.0.20 → python4cpm-1.0.21/src/python4cpm.egg-info}/PKG-INFO +20 -8
- {python4cpm-1.0.20 → python4cpm-1.0.21}/LICENSE +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/setup.cfg +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm/__init__.py +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm/args.py +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm/crypto.py +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm/nethelper.py +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm/python4cpm.py +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm/secrets.py +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm.egg-info/SOURCES.txt +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm.egg-info/dependency_links.txt +0 -0
- {python4cpm-1.0.20 → python4cpm-1.0.21}/src/python4cpm.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python4cpm
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.21
|
|
4
4
|
Summary: Python for CPM
|
|
5
5
|
Author-email: Gonzalo Atienza Rela <gonatienza@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -40,9 +40,10 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
40
40
|
|
|
41
41
|
### Preparing Python
|
|
42
42
|
|
|
43
|
-
1. Install Python in CPM.
|
|
44
|
-
|
|
45
|
-
3.
|
|
43
|
+
1. Install Python in CPM.
|
|
44
|
+
- **Python must be installed for all users**. Follow the custom install steps from the installation wizard to check the checkbox.
|
|
45
|
+
3. Create a venv in CPM, by running `py -m venv c:\venv`. If desired, use a custom location and adjust any future references.
|
|
46
|
+
4. Install `python4cpm` in your venv:
|
|
46
47
|
- If your CPM can connect to the internet, install with `c:\venv\Scripts\pip install python4cpm`.
|
|
47
48
|
- If your CPM cannot connect to the internet:
|
|
48
49
|
- Download the latest `python4cpm-*.whl` file from the [pypi project files](https://pypi.org/project/python4cpm/#files).
|
|
@@ -52,17 +53,28 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
52
53
|
|
|
53
54
|
### Importing the platform
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
#### If you are using CPM (SaaS or Self-Hosted):
|
|
57
|
+
1. Download the latest [Credential Management .NET SDK](https://community.cyberark.com/marketplace/s/#a3550000000EkA0AAK-a3950000000jjoOAAQ) and place its content in the bin folder of CPM (`C:\Program Files (x86)\CyberArk\Password Manager\bin`). The files for this may already be present.
|
|
56
58
|
2. Download the `python4cpm-platform-*.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
57
59
|
3. Import the platform zip file into Privilege Cloud/PVWA `(Administration -> Platform Management -> Import platform)`.
|
|
58
|
-
4. Craft your python script and place it within
|
|
60
|
+
4. Craft your python script and place it within a folder in CPM (e.g., `C:\python4cpm-scripts`).
|
|
59
61
|
5. Duplicate the imported platform in Privilege Cloud/PVWA `(Administration -> Platform Management -> Application -> Python for CPM)` and name it after your application (e.g., My App).
|
|
60
|
-
6. Edit the duplicated platform and specify the path of your
|
|
61
|
-
7.
|
|
62
|
+
6. Edit the duplicated platform and specify the path of your script, under `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonScriptPath -> Value` (e.g., `C:\python4cpm-scripts\myapp.py`).
|
|
63
|
+
7. Also update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonExePath -> Value` with the custom path for the venv's `python.exe` file (e.g., `c:\venv\Scripts\python.exe`).
|
|
62
64
|
8. If you want to disable logging, update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonLogging -> Value` to `no`.
|
|
63
65
|
9. If you want to change the logging level to `debug`, update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonLoggingLevel -> Value` to `debug`.
|
|
64
66
|
10. For new applications repeat steps from 4 to 9.
|
|
65
67
|
|
|
68
|
+
#### If you are using SRS (SaaS only):
|
|
69
|
+
1. Download the `python4cpm-platform-*.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
70
|
+
2. Import the platform zip file into Privilege Cloud `(Administration -> Platform Management -> Import platform)`.
|
|
71
|
+
3. Craft your python script and place it within a folder in the Cloud Connector (where the SRS Management Agent runs) (e.g., `C:\python4cpm-scripts`).
|
|
72
|
+
4. Duplicate the imported platform in Privilege Cloud/PVWA `(Administration -> Platform Management -> Application -> Python for CPM)` and name it after your application (e.g., My App).
|
|
73
|
+
5. Edit the duplicated platform and specify the path of your script, under `Plugin Settings -> Additional Parameters -> PythonScriptPath` (e.g., `C:\python4cpm-scripts\myapp.py`).
|
|
74
|
+
6. Also update `Plugin Settings -> Additional Parameters -> PythonExePath` with the custom path for the venv's `python.exe` file (e.g., `c:\venv\Scripts\python.exe`).
|
|
75
|
+
7. If you want to disable logging, update `Plugin Settings -> Additional Parameters -> PythonLogging` to `no`.
|
|
76
|
+
8. If you want to change the logging level to `debug`, update `Plugin Settings -> Additional Parameters -> PythonLoggingLevel -> Value` to `debug`.
|
|
77
|
+
9. For new applications repeat steps from 3 to 8.
|
|
66
78
|
|
|
67
79
|
## Python Script
|
|
68
80
|
|
|
@@ -8,9 +8,10 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
8
8
|
|
|
9
9
|
### Preparing Python
|
|
10
10
|
|
|
11
|
-
1. Install Python in CPM.
|
|
12
|
-
|
|
13
|
-
3.
|
|
11
|
+
1. Install Python in CPM.
|
|
12
|
+
- **Python must be installed for all users**. Follow the custom install steps from the installation wizard to check the checkbox.
|
|
13
|
+
3. Create a venv in CPM, by running `py -m venv c:\venv`. If desired, use a custom location and adjust any future references.
|
|
14
|
+
4. Install `python4cpm` in your venv:
|
|
14
15
|
- If your CPM can connect to the internet, install with `c:\venv\Scripts\pip install python4cpm`.
|
|
15
16
|
- If your CPM cannot connect to the internet:
|
|
16
17
|
- Download the latest `python4cpm-*.whl` file from the [pypi project files](https://pypi.org/project/python4cpm/#files).
|
|
@@ -20,17 +21,28 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
20
21
|
|
|
21
22
|
### Importing the platform
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
#### If you are using CPM (SaaS or Self-Hosted):
|
|
25
|
+
1. Download the latest [Credential Management .NET SDK](https://community.cyberark.com/marketplace/s/#a3550000000EkA0AAK-a3950000000jjoOAAQ) and place its content in the bin folder of CPM (`C:\Program Files (x86)\CyberArk\Password Manager\bin`). The files for this may already be present.
|
|
24
26
|
2. Download the `python4cpm-platform-*.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
25
27
|
3. Import the platform zip file into Privilege Cloud/PVWA `(Administration -> Platform Management -> Import platform)`.
|
|
26
|
-
4. Craft your python script and place it within
|
|
28
|
+
4. Craft your python script and place it within a folder in CPM (e.g., `C:\python4cpm-scripts`).
|
|
27
29
|
5. Duplicate the imported platform in Privilege Cloud/PVWA `(Administration -> Platform Management -> Application -> Python for CPM)` and name it after your application (e.g., My App).
|
|
28
|
-
6. Edit the duplicated platform and specify the path of your
|
|
29
|
-
7.
|
|
30
|
+
6. Edit the duplicated platform and specify the path of your script, under `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonScriptPath -> Value` (e.g., `C:\python4cpm-scripts\myapp.py`).
|
|
31
|
+
7. Also update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonExePath -> Value` with the custom path for the venv's `python.exe` file (e.g., `c:\venv\Scripts\python.exe`).
|
|
30
32
|
8. If you want to disable logging, update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonLogging -> Value` to `no`.
|
|
31
33
|
9. If you want to change the logging level to `debug`, update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonLoggingLevel -> Value` to `debug`.
|
|
32
34
|
10. For new applications repeat steps from 4 to 9.
|
|
33
35
|
|
|
36
|
+
#### If you are using SRS (SaaS only):
|
|
37
|
+
1. Download the `python4cpm-platform-*.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
38
|
+
2. Import the platform zip file into Privilege Cloud `(Administration -> Platform Management -> Import platform)`.
|
|
39
|
+
3. Craft your python script and place it within a folder in the Cloud Connector (where the SRS Management Agent runs) (e.g., `C:\python4cpm-scripts`).
|
|
40
|
+
4. Duplicate the imported platform in Privilege Cloud/PVWA `(Administration -> Platform Management -> Application -> Python for CPM)` and name it after your application (e.g., My App).
|
|
41
|
+
5. Edit the duplicated platform and specify the path of your script, under `Plugin Settings -> Additional Parameters -> PythonScriptPath` (e.g., `C:\python4cpm-scripts\myapp.py`).
|
|
42
|
+
6. Also update `Plugin Settings -> Additional Parameters -> PythonExePath` with the custom path for the venv's `python.exe` file (e.g., `c:\venv\Scripts\python.exe`).
|
|
43
|
+
7. If you want to disable logging, update `Plugin Settings -> Additional Parameters -> PythonLogging` to `no`.
|
|
44
|
+
8. If you want to change the logging level to `debug`, update `Plugin Settings -> Additional Parameters -> PythonLoggingLevel -> Value` to `debug`.
|
|
45
|
+
9. For new applications repeat steps from 3 to 8.
|
|
34
46
|
|
|
35
47
|
## Python Script
|
|
36
48
|
|
|
@@ -3,12 +3,12 @@ import logging
|
|
|
3
3
|
from logging.handlers import RotatingFileHandler
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
_LOGS_DIR = os.path.join("Logs", "ThirdParty"
|
|
6
|
+
_LOGS_DIR = os.path.join("Logs", "ThirdParty")
|
|
7
7
|
_LOGGING_ENABLED_VALUE = "yes"
|
|
8
8
|
_LOGGING_LEVELS = {
|
|
9
9
|
"info": logging.INFO,
|
|
10
10
|
"debug": logging.DEBUG
|
|
11
|
-
|
|
11
|
+
}
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def get_logger(
|
|
@@ -19,7 +19,7 @@ def get_logger(
|
|
|
19
19
|
if args_logging.lower() != _LOGGING_ENABLED_VALUE:
|
|
20
20
|
return None
|
|
21
21
|
os.makedirs(_LOGS_DIR, exist_ok=True)
|
|
22
|
-
logs_file = os.path.join(_LOGS_DIR, f"{name}.log")
|
|
22
|
+
logs_file = os.path.join(_LOGS_DIR, f"{__name__}-{name}.log")
|
|
23
23
|
_id = os.urandom(4).hex()
|
|
24
24
|
logger = logging.getLogger(_id)
|
|
25
25
|
if args_logging_level.lower() in _LOGGING_LEVELS:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python4cpm
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.21
|
|
4
4
|
Summary: Python for CPM
|
|
5
5
|
Author-email: Gonzalo Atienza Rela <gonatienza@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -40,9 +40,10 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
40
40
|
|
|
41
41
|
### Preparing Python
|
|
42
42
|
|
|
43
|
-
1. Install Python in CPM.
|
|
44
|
-
|
|
45
|
-
3.
|
|
43
|
+
1. Install Python in CPM.
|
|
44
|
+
- **Python must be installed for all users**. Follow the custom install steps from the installation wizard to check the checkbox.
|
|
45
|
+
3. Create a venv in CPM, by running `py -m venv c:\venv`. If desired, use a custom location and adjust any future references.
|
|
46
|
+
4. Install `python4cpm` in your venv:
|
|
46
47
|
- If your CPM can connect to the internet, install with `c:\venv\Scripts\pip install python4cpm`.
|
|
47
48
|
- If your CPM cannot connect to the internet:
|
|
48
49
|
- Download the latest `python4cpm-*.whl` file from the [pypi project files](https://pypi.org/project/python4cpm/#files).
|
|
@@ -52,17 +53,28 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
52
53
|
|
|
53
54
|
### Importing the platform
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
#### If you are using CPM (SaaS or Self-Hosted):
|
|
57
|
+
1. Download the latest [Credential Management .NET SDK](https://community.cyberark.com/marketplace/s/#a3550000000EkA0AAK-a3950000000jjoOAAQ) and place its content in the bin folder of CPM (`C:\Program Files (x86)\CyberArk\Password Manager\bin`). The files for this may already be present.
|
|
56
58
|
2. Download the `python4cpm-platform-*.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
57
59
|
3. Import the platform zip file into Privilege Cloud/PVWA `(Administration -> Platform Management -> Import platform)`.
|
|
58
|
-
4. Craft your python script and place it within
|
|
60
|
+
4. Craft your python script and place it within a folder in CPM (e.g., `C:\python4cpm-scripts`).
|
|
59
61
|
5. Duplicate the imported platform in Privilege Cloud/PVWA `(Administration -> Platform Management -> Application -> Python for CPM)` and name it after your application (e.g., My App).
|
|
60
|
-
6. Edit the duplicated platform and specify the path of your
|
|
61
|
-
7.
|
|
62
|
+
6. Edit the duplicated platform and specify the path of your script, under `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonScriptPath -> Value` (e.g., `C:\python4cpm-scripts\myapp.py`).
|
|
63
|
+
7. Also update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonExePath -> Value` with the custom path for the venv's `python.exe` file (e.g., `c:\venv\Scripts\python.exe`).
|
|
62
64
|
8. If you want to disable logging, update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonLogging -> Value` to `no`.
|
|
63
65
|
9. If you want to change the logging level to `debug`, update `Target Account Platform -> Automatic Platform Management -> Additional Policy Settings -> Parameters -> PythonLoggingLevel -> Value` to `debug`.
|
|
64
66
|
10. For new applications repeat steps from 4 to 9.
|
|
65
67
|
|
|
68
|
+
#### If you are using SRS (SaaS only):
|
|
69
|
+
1. Download the `python4cpm-platform-*.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
70
|
+
2. Import the platform zip file into Privilege Cloud `(Administration -> Platform Management -> Import platform)`.
|
|
71
|
+
3. Craft your python script and place it within a folder in the Cloud Connector (where the SRS Management Agent runs) (e.g., `C:\python4cpm-scripts`).
|
|
72
|
+
4. Duplicate the imported platform in Privilege Cloud/PVWA `(Administration -> Platform Management -> Application -> Python for CPM)` and name it after your application (e.g., My App).
|
|
73
|
+
5. Edit the duplicated platform and specify the path of your script, under `Plugin Settings -> Additional Parameters -> PythonScriptPath` (e.g., `C:\python4cpm-scripts\myapp.py`).
|
|
74
|
+
6. Also update `Plugin Settings -> Additional Parameters -> PythonExePath` with the custom path for the venv's `python.exe` file (e.g., `c:\venv\Scripts\python.exe`).
|
|
75
|
+
7. If you want to disable logging, update `Plugin Settings -> Additional Parameters -> PythonLogging` to `no`.
|
|
76
|
+
8. If you want to change the logging level to `debug`, update `Plugin Settings -> Additional Parameters -> PythonLoggingLevel -> Value` to `debug`.
|
|
77
|
+
9. For new applications repeat steps from 3 to 8.
|
|
66
78
|
|
|
67
79
|
## Python Script
|
|
68
80
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|