diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..f1447e0 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: infamousjoeg \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock index ba4a773..4bd7e1e 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -18,21 +18,22 @@ "default": { "urllib3": { "hashes": [ - "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3", - "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54" + "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20", + "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224" ], "index": "pypi", - "version": "==2.1.0" + "markers": "python_version >= '3.8'", + "version": "==2.2.0" } }, "develop": { "certifi": { "hashes": [ - "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1", - "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474" + "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f", + "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1" ], "markers": "python_version >= '3.6'", - "version": "==2023.11.17" + "version": "==2024.2.2" }, "charset-normalizer": { "hashes": [ @@ -148,11 +149,11 @@ }, "importlib-metadata": { "hashes": [ - "sha256:7fc841f8b8332803464e5dc1c63a2e59121f46ca186c0e2e182e80bf8c1319f7", - "sha256:d97503976bb81f40a193d41ee6570868479c69d5068651eb039c40d850c59d67" + "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e", + "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc" ], "markers": "python_version >= '3.8'", - "version": "==7.0.0" + "version": "==7.0.1" }, "importlib-resources": { "hashes": [ @@ -164,11 +165,11 @@ }, "jaraco.classes": { "hashes": [ - "sha256:10afa92b6743f25c0cf5f37c6bb6e18e2c5bb84a16527ccfc0040ea377e7aaeb", - "sha256:c063dd08e89217cee02c8d5e5ec560f2c8ce6cdc2fcdc2e68f7b2e5547ed3621" + "sha256:86b534de565381f6b3c1c830d13f931d7be1a75f0081c57dff615578676e2206", + "sha256:cb28a5ebda8bc47d8c8015307d93163464f9f2b91ab4006e09ff0ce07e8bfb30" ], "markers": "python_version >= '3.8'", - "version": "==3.3.0" + "version": "==3.3.1" }, "keyring": { "hashes": [ @@ -196,11 +197,11 @@ }, "more-itertools": { "hashes": [ - "sha256:626c369fa0eb37bac0291bce8259b332fd59ac792fa5497b59837309cd5b114a", - "sha256:64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6" + "sha256:686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684", + "sha256:8fccb480c43d3e99a00087634c06dd02b0d50fbf088b380de5a41a015ec239e1" ], "markers": "python_version >= '3.8'", - "version": "==10.1.0" + "version": "==10.2.0" }, "nh3": { "hashes": [ @@ -281,27 +282,29 @@ }, "twine": { "hashes": [ - "sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8", - "sha256:9e102ef5fdd5a20661eb88fad46338806c3bd32cf1db729603fe3697b1bc83c8" + "sha256:89b0cc7d370a4b66421cc6102f269aa910fe0f1861c124f573cf2ddedbc10cf4", + "sha256:a262933de0b484c53408f9edae2e7821c1c45a3314ff2df9bdd343aa7ab8edc0" ], "index": "pypi", - "version": "==4.0.2" + "markers": "python_version >= '3.8'", + "version": "==5.0.0" }, "typing-extensions": { "hashes": [ - "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", - "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef" + "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783", + "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd" ], "markers": "python_version < '3.9'", - "version": "==4.8.0" + "version": "==4.9.0" }, "urllib3": { "hashes": [ - "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3", - "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54" + "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20", + "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224" ], "index": "pypi", - "version": "==2.1.0" + "markers": "python_version >= '3.8'", + "version": "==2.2.0" }, "zipp": { "hashes": [ diff --git a/README.md b/README.md index 56acff2..6bb080c 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,9 @@ This project simplifies the interaction between a Python 3 application or script and CyberArk's Application Access Manager's Credential Provider using the appropriate CLIPasswordSDK executable for the Operating System being used. By simplifying this process, developers are only required to change four (4) lines of code in their Python 3 applications and scripts to securely retrieve privileged secrets from CyberArk's Privileged Access Security (PAS) Core Solution as opposed to thirty or more (30+) without the use of this provided Client Library. -### New in Version 1.5.0: +### New in Version 1.5.1: -- Added support for `timeout` when intializing the CCPPasswordREST() class. -- Added support for `delimiter` parameter in `GetPassword()` method for Credential Provider (CLIPasswordSDK) method. -- Added support for Client Certificate Authentication in `GetPassword()` method for Centralized Credential Provider (CCPPasswordREST) method. +- Added support for custom service path during initialization of the CCPPasswordREST() class. [See documentation below for more details.](#example-with-custom-service-path) ## Table of Contents @@ -49,6 +47,7 @@ This project simplifies the interaction between a Python 3 application or script - [Query Parameters](#query-parameters-1) - [Example](#example-1) - [Example with Client Certificate Authentication](#example-with-client-certificate-authentication) + - [Example with Custom Service Path](#example-with-custom-service-path) - [Maintainer](#maintainer) - [Contributing](#contributing) - [License](#license) @@ -214,7 +213,8 @@ For compatibility with Dual Accounts where you are referencing a `VirtualUsernam ```python from pyaim import CCPPasswordREST -aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, timeout=10) # set verify=False to ignore SSL +# set verify=False to ignore SSL +aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', 'AIMWebService', verify=True, timeout=10) service_status = aimccp.check_service() @@ -232,7 +232,19 @@ else: ```python from pyaim import CCPPasswordREST -aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, cert=('/path/to/cert.pem', '/path/to/key.pem')) # set verify=False to ignore SSL +# set verify=False to ignore SSL +aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, cert=('/path/to/cert.pem', '/path/to/key.pem')) + +... +``` + +##### Example with Custom Service Path + +```python +from pyaim import CCPPasswordREST + +# set verify=False to ignore SSL +aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', 'AIMWebServiceDEV', verify=True) ... ``` @@ -241,8 +253,6 @@ aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, cert=( [@infamousjoeg](https://github.com/infamousjoeg) -[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee] - [buymeacoffee]: https://www.buymeacoffee.com/infamousjoeg [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png diff --git a/docs/README.md b/docs/README.md index 56acff2..6bb080c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,11 +8,9 @@ This project simplifies the interaction between a Python 3 application or script and CyberArk's Application Access Manager's Credential Provider using the appropriate CLIPasswordSDK executable for the Operating System being used. By simplifying this process, developers are only required to change four (4) lines of code in their Python 3 applications and scripts to securely retrieve privileged secrets from CyberArk's Privileged Access Security (PAS) Core Solution as opposed to thirty or more (30+) without the use of this provided Client Library. -### New in Version 1.5.0: +### New in Version 1.5.1: -- Added support for `timeout` when intializing the CCPPasswordREST() class. -- Added support for `delimiter` parameter in `GetPassword()` method for Credential Provider (CLIPasswordSDK) method. -- Added support for Client Certificate Authentication in `GetPassword()` method for Centralized Credential Provider (CCPPasswordREST) method. +- Added support for custom service path during initialization of the CCPPasswordREST() class. [See documentation below for more details.](#example-with-custom-service-path) ## Table of Contents @@ -49,6 +47,7 @@ This project simplifies the interaction between a Python 3 application or script - [Query Parameters](#query-parameters-1) - [Example](#example-1) - [Example with Client Certificate Authentication](#example-with-client-certificate-authentication) + - [Example with Custom Service Path](#example-with-custom-service-path) - [Maintainer](#maintainer) - [Contributing](#contributing) - [License](#license) @@ -214,7 +213,8 @@ For compatibility with Dual Accounts where you are referencing a `VirtualUsernam ```python from pyaim import CCPPasswordREST -aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, timeout=10) # set verify=False to ignore SSL +# set verify=False to ignore SSL +aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', 'AIMWebService', verify=True, timeout=10) service_status = aimccp.check_service() @@ -232,7 +232,19 @@ else: ```python from pyaim import CCPPasswordREST -aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, cert=('/path/to/cert.pem', '/path/to/key.pem')) # set verify=False to ignore SSL +# set verify=False to ignore SSL +aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, cert=('/path/to/cert.pem', '/path/to/key.pem')) + +... +``` + +##### Example with Custom Service Path + +```python +from pyaim import CCPPasswordREST + +# set verify=False to ignore SSL +aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', 'AIMWebServiceDEV', verify=True) ... ``` @@ -241,8 +253,6 @@ aimccp = CCPPasswordREST('https://ccp.cyberarkdemo.example', verify=True, cert=( [@infamousjoeg](https://github.com/infamousjoeg) -[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee] - [buymeacoffee]: https://www.buymeacoffee.com/infamousjoeg [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png diff --git a/pyaim/aimccp.py b/pyaim/aimccp.py index 65ee7cd..8911c61 100644 --- a/pyaim/aimccp.py +++ b/pyaim/aimccp.py @@ -7,10 +7,11 @@ class CCPPasswordREST: """Class for interacting with CyberArk's CCP REST API.""" - def __init__(self, base_uri, verify=True, cert=None, timeout=30): + def __init__(self, base_uri, service_path="AIMWebService", verify=True, cert=None, timeout=30): # pylint: disable=too-many-arguments # Declare Init Variables self._base_uri = base_uri.rstrip('/').replace('https://','') + self._service_path = service_path self._headers = {'Content-Type': 'application/json'} self._timeout = timeout @@ -28,7 +29,7 @@ def __init__(self, base_uri, verify=True, cert=None, timeout=30): def check_service(self): """Checks that the AIM Web Service is available.""" try: - url = '/AIMWebService/v1.1/aim.asmx' + url = f'/{self._service_path}/v1.1/aim.asmx' conn = http.client.HTTPSConnection( self._base_uri, context=self._context, timeout=self._timeout) conn.request("GET", url, headers=self._headers) @@ -37,12 +38,12 @@ def check_service(self): conn.close() if status_code != 200: - raise ConnectionError('ERROR: AIMWebService Not Found.') + raise ConnectionError(f'ERROR: {self._service_path} Not Found.') except Exception as e: raise Exception(e) # pylint: disable=raise-missing-from,broad-exception-raised - return f"SUCCESS: AIMWebService Found. Status Code: {status_code}" + return f"SUCCESS: {self._service_path} Found. Status Code: {status_code}" def GetPassword(self, appid=None, safe=None, folder=None, object=None, # pylint: disable=redefined-builtin,invalid-name,disable=too-many-arguments,too-many-locals username=None, address=None, database=None, policyid=None, @@ -83,7 +84,7 @@ def GetPassword(self, appid=None, safe=None, folder=None, object=None, # pylint: # Urlify parameters for GET Request params = urllib.parse.urlencode(var_filtered) # Build URL for GET Request - url = f"/AIMWebService/api/Accounts?{params}" + url = f"/{self._service_path}/api/Accounts?{params}" try: conn = http.client.HTTPSConnection( diff --git a/pyaim/version.py b/pyaim/version.py index 9d871f3..b7f3dcd 100644 --- a/pyaim/version.py +++ b/pyaim/version.py @@ -6,4 +6,4 @@ is intended to be reused in multiple places. """ -__version__ = '1.5.0' +__version__ = '1.5.1' diff --git a/setup.py b/setup.py index 4af2a56..a8e9ac0 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3 :: Only", - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", @@ -52,7 +52,11 @@ "identity", "pam", "pim", - "pas" + "pas", + "ccp", + "cp", + "credential provider", + "identity security" ], project_urls={ 'Bug Reports': 'https://github.com/infamousjoeg/pyaim/issues/new?assignees=&labels=&template=bug_report.md&title=',