python4cpm 1.0.15__tar.gz → 1.0.16__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.15/src/python4cpm.egg-info → python4cpm-1.0.16}/PKG-INFO +4 -4
- {python4cpm-1.0.15 → python4cpm-1.0.16}/README.md +3 -3
- {python4cpm-1.0.15 → python4cpm-1.0.16}/pyproject.toml +1 -1
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm/__init__.py +2 -2
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm/crypto.py +2 -2
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm/secrets.py +6 -11
- {python4cpm-1.0.15 → python4cpm-1.0.16/src/python4cpm.egg-info}/PKG-INFO +4 -4
- {python4cpm-1.0.15 → python4cpm-1.0.16}/LICENSE +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/setup.cfg +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm/args.py +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm/logger.py +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm/nethelper.py +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm/python4cpm.py +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm.egg-info/SOURCES.txt +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/src/python4cpm.egg-info/dependency_links.txt +0 -0
- {python4cpm-1.0.15 → python4cpm-1.0.16}/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.16
|
|
4
4
|
Summary: Python for CPM
|
|
5
5
|
Author-email: Gonzalo Atienza Rela <gonatienza@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -45,7 +45,7 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
45
45
|
3. Install `python4cpm` in your venv:
|
|
46
46
|
- If your CPM can connect to the internet, install with `c:\venv\Scripts\pip install python4cpm`.
|
|
47
47
|
- If your CPM cannot connect to the internet:
|
|
48
|
-
- Download the
|
|
48
|
+
- Download the `python4cpm-wheel.zip` asset from the latest [release](https://github.com/gonatienza/python4cpm/releases).
|
|
49
49
|
- Copy the file to CPM and extract to a temporary location.
|
|
50
50
|
- From the temporary location run `c:\venv\Scripts\pip install --no-index --find-links=.\python4cpm-wheel python4cpm`.
|
|
51
51
|
|
|
@@ -53,7 +53,7 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
53
53
|
### Importing the platform
|
|
54
54
|
|
|
55
55
|
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`).
|
|
56
|
-
2. Download the
|
|
56
|
+
2. Download the `python4cpm-platform.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
57
57
|
3. Import the platform zip file into Privilege Cloud/PVWA `(Administration -> Platform Management -> Import platform)`.
|
|
58
58
|
4. Craft your python script and place it within the bin folder of CPM (`C:\Program Files (x86)\CyberArk\Password Manager\bin`).
|
|
59
59
|
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).
|
|
@@ -197,7 +197,7 @@ Install this module (in a dev workstation) with:
|
|
|
197
197
|
pip install python4cpm
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
**Note**: As CPM runs in Windows, the plugin was built to pass secrets securely to the `Python4CPM.crypto` module using the Data Protection API (DPAPI). For dev purposes in Linux/Mac dev workstations, those secrets will appear as plaintext in the process
|
|
200
|
+
**Note**: As CPM runs in Windows, the plugin was built to pass secrets securely to the `Python4CPM.crypto` module using the Data Protection API (DPAPI). For dev purposes in Linux/Mac dev workstations, those secrets will appear as plaintext in the environment of the process. This is informational only, the module will use its encryption/decryption capabilities automatically in Windows and you do not have to do anything specific to enable it.
|
|
201
201
|
|
|
202
202
|
### Example:
|
|
203
203
|
|
|
@@ -13,7 +13,7 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
13
13
|
3. Install `python4cpm` in your venv:
|
|
14
14
|
- If your CPM can connect to the internet, install with `c:\venv\Scripts\pip install python4cpm`.
|
|
15
15
|
- If your CPM cannot connect to the internet:
|
|
16
|
-
- Download the
|
|
16
|
+
- Download the `python4cpm-wheel.zip` asset from the latest [release](https://github.com/gonatienza/python4cpm/releases).
|
|
17
17
|
- Copy the file to CPM and extract to a temporary location.
|
|
18
18
|
- From the temporary location run `c:\venv\Scripts\pip install --no-index --find-links=.\python4cpm-wheel python4cpm`.
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
21
21
|
### Importing the platform
|
|
22
22
|
|
|
23
23
|
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`).
|
|
24
|
-
2. Download the
|
|
24
|
+
2. Download the `python4cpm-platform.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
25
25
|
3. Import the platform zip file into Privilege Cloud/PVWA `(Administration -> Platform Management -> Import platform)`.
|
|
26
26
|
4. Craft your python script and place it within the bin folder of CPM (`C:\Program Files (x86)\CyberArk\Password Manager\bin`).
|
|
27
27
|
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).
|
|
@@ -165,7 +165,7 @@ Install this module (in a dev workstation) with:
|
|
|
165
165
|
pip install python4cpm
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
**Note**: As CPM runs in Windows, the plugin was built to pass secrets securely to the `Python4CPM.crypto` module using the Data Protection API (DPAPI). For dev purposes in Linux/Mac dev workstations, those secrets will appear as plaintext in the process
|
|
168
|
+
**Note**: As CPM runs in Windows, the plugin was built to pass secrets securely to the `Python4CPM.crypto` module using the Data Protection API (DPAPI). For dev purposes in Linux/Mac dev workstations, those secrets will appear as plaintext in the environment of the process. This is informational only, the module will use its encryption/decryption capabilities automatically in Windows and you do not have to do anything specific to enable it.
|
|
169
169
|
|
|
170
170
|
### Example:
|
|
171
171
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from python4cpm.python4cpm import Python4CPM
|
|
2
2
|
from python4cpm.args import Args
|
|
3
|
-
from python4cpm.secrets import
|
|
3
|
+
from python4cpm.secrets import Secret, Secrets
|
|
4
4
|
from python4cpm.crypto import Crypto
|
|
5
5
|
from python4cpm.nethelper import NETHelper
|
|
6
6
|
from importlib.metadata import version as __version
|
|
@@ -9,7 +9,7 @@ __version__ = __version(__name__)
|
|
|
9
9
|
|
|
10
10
|
__all__ = [
|
|
11
11
|
Args,
|
|
12
|
-
|
|
12
|
+
Secret,
|
|
13
13
|
Secrets,
|
|
14
14
|
Python4CPM,
|
|
15
15
|
Crypto,
|
|
@@ -43,14 +43,14 @@ class Crypto:
|
|
|
43
43
|
if crypt_res:
|
|
44
44
|
plaintext = ctypes.string_at(output_blob.pbData, output_blob.cbData)
|
|
45
45
|
ctypes.windll.kernel32.LocalFree(output_blob.pbData)
|
|
46
|
-
return plaintext.decode()
|
|
46
|
+
return plaintext.decode("utf-16-le")
|
|
47
47
|
else:
|
|
48
48
|
raise ctypes.WinError()
|
|
49
49
|
|
|
50
50
|
@classmethod
|
|
51
51
|
def encrypt(cls, plaintext: str) -> str:
|
|
52
52
|
cls._verify_enabled()
|
|
53
|
-
plain_bytes = plaintext.encode()
|
|
53
|
+
plain_bytes = plaintext.encode("utf-16-le")
|
|
54
54
|
buffer = ctypes.create_string_buffer(plain_bytes)
|
|
55
55
|
input_blob = cls.DataBlob(
|
|
56
56
|
len(plain_bytes),
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
from python4cpm.crypto import Crypto
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class Secret:
|
|
5
5
|
def __init__(self, secret: str) -> None:
|
|
6
6
|
self._secret = secret
|
|
7
|
-
self._is_encrypted = Crypto.ENABLED
|
|
8
|
-
|
|
9
|
-
@property
|
|
10
|
-
def is_encrypted(self):
|
|
11
|
-
return self._is_encrypted
|
|
12
7
|
|
|
13
8
|
def get(self) -> str:
|
|
14
|
-
if
|
|
9
|
+
if Crypto.ENABLED and self._secret:
|
|
15
10
|
return Crypto.decrypt(self._secret)
|
|
16
11
|
else:
|
|
17
12
|
return self._secret
|
|
@@ -32,10 +27,10 @@ class Secrets:
|
|
|
32
27
|
reconcile_password: str,
|
|
33
28
|
new_password: str
|
|
34
29
|
) -> None:
|
|
35
|
-
self._password =
|
|
36
|
-
self._logon_password =
|
|
37
|
-
self._reconcile_password =
|
|
38
|
-
self._new_password =
|
|
30
|
+
self._password = Secret(password)
|
|
31
|
+
self._logon_password = Secret(logon_password)
|
|
32
|
+
self._reconcile_password = Secret(reconcile_password)
|
|
33
|
+
self._new_password = Secret(new_password)
|
|
39
34
|
|
|
40
35
|
@property
|
|
41
36
|
def password(self) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python4cpm
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.16
|
|
4
4
|
Summary: Python for CPM
|
|
5
5
|
Author-email: Gonzalo Atienza Rela <gonatienza@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -45,7 +45,7 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
45
45
|
3. Install `python4cpm` in your venv:
|
|
46
46
|
- If your CPM can connect to the internet, install with `c:\venv\Scripts\pip install python4cpm`.
|
|
47
47
|
- If your CPM cannot connect to the internet:
|
|
48
|
-
- Download the
|
|
48
|
+
- Download the `python4cpm-wheel.zip` asset from the latest [release](https://github.com/gonatienza/python4cpm/releases).
|
|
49
49
|
- Copy the file to CPM and extract to a temporary location.
|
|
50
50
|
- From the temporary location run `c:\venv\Scripts\pip install --no-index --find-links=.\python4cpm-wheel python4cpm`.
|
|
51
51
|
|
|
@@ -53,7 +53,7 @@ This platform allows you to duplicate it multiple times, simply changing its set
|
|
|
53
53
|
### Importing the platform
|
|
54
54
|
|
|
55
55
|
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`).
|
|
56
|
-
2. Download the
|
|
56
|
+
2. Download the `python4cpm-platform.zip` asset from the [release](https://github.com/gonatienza/python4cpm/releases).
|
|
57
57
|
3. Import the platform zip file into Privilege Cloud/PVWA `(Administration -> Platform Management -> Import platform)`.
|
|
58
58
|
4. Craft your python script and place it within the bin folder of CPM (`C:\Program Files (x86)\CyberArk\Password Manager\bin`).
|
|
59
59
|
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).
|
|
@@ -197,7 +197,7 @@ Install this module (in a dev workstation) with:
|
|
|
197
197
|
pip install python4cpm
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
**Note**: As CPM runs in Windows, the plugin was built to pass secrets securely to the `Python4CPM.crypto` module using the Data Protection API (DPAPI). For dev purposes in Linux/Mac dev workstations, those secrets will appear as plaintext in the process
|
|
200
|
+
**Note**: As CPM runs in Windows, the plugin was built to pass secrets securely to the `Python4CPM.crypto` module using the Data Protection API (DPAPI). For dev purposes in Linux/Mac dev workstations, those secrets will appear as plaintext in the environment of the process. This is informational only, the module will use its encryption/decryption capabilities automatically in Windows and you do not have to do anything specific to enable it.
|
|
201
201
|
|
|
202
202
|
### Example:
|
|
203
203
|
|
|
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
|