Package: pyaim
pyAIMCyberArk Application Access Manager Client Library for Python 3This 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.1:Added support for custom service path during initialization of the CCPPasswordREST() class.See documentation below for more details.Table of ContentsInstallCredential Provider (CLIPasswordSDK) MethodCentralized Credential Provider (CCPPasswordREST) MethodWindowsInstall Latest Python 3Install pyAIM via PipLinuxUbuntu/DebianInstall Latest Python 3Install pyAIM via PipRHEL/CentOSInstall Latest Python 3RHELCentOSInstall pyAIM via PipMacOSZ/OSInstall Latest Python 3Install pyAIM via PipUsageCheck AIMWebService Availability - check_service()Centralized Credential Provider (CCPPasswordREST) MethodRetrieve Account - GetPassword()Credential Provider (CLIPasswordSDK) MethodSupported ParametersQuery ParametersExampleCentralized Credential Provider (CCPPasswordREST) MethodSupported ParametersCCPPasswordREST()Query ParametersExampleExample with Client Certificate AuthenticationExample with Custom Service PathMaintainerContributingLicenseInstallCredential Provider (CLIPasswordSDK) MethodCyberArk Application Access Manager Credential Provider installed locally.Centralized Credential Provider (CCPPasswordREST) MethodCyberArk Application Access Manager Centralized Credential Provider and AIMWebServiceFor information on how to install either of these providers, please refer to CyberArk's Application Access Manager Installation Guide or reach out to your assigned Customer Success Technical Advisor.WindowsInstall Latest Python 3Install the Python 3 release for WindowsInstall pyAIM via Pip> pip3 install pyaimLinuxUbuntu/DebianInstall Latest Python 3$ sudo apt install -y python3 python3-pipInstall pyAIM via Pip$ pip3 install pyaimRHEL/CentOSInstall Latest Python 3RHELFollow theEPEL Documentationto ensure you have the EPEL Release repository available.$ sudo yum install -y https://rhel7.iuscommunity.org/ius-release.rpm$ sudo yum update$ sudo yum install -y python36u python36u-libs python36u-devel python36u-pipCentOS$ sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm$ sudo yum update$ sudo yum install -y python36u python36u-libs python36u-devel python36u-pipInstall pyAIM via Pip$ pip3 install pyaimMacOSNo support provided yet.Z/OSpyAIM is untested on Z/OS but should work in theory.Install Latest Python 3Rocket Software hasported Python 2 and 3for Z/OSInstall pyAIM via Pip$ pip3 install pyaimUsageCheck AIMWebService Availability - check_service()Centralized Credential Provider (CCPPasswordREST) MethodfrompyaimimportCCPPasswordRESTaimccp=CCPPasswordREST('https://ccp.cyberarkdemo.example',verify=True)# set verify=False to ignore SSLservice_status=aimccp.check_service()print(service_status)Retrieve Account - GetPassword()Credential Provider (CLIPasswordSDK) MethodSupported ParametersQuery Parametersappid(required)safe(required)folder(default: root)object(this orusernamerequired)username(this orobjectrequired)addressdatabasepolicyidreasonquery_format(default: 1)connportsendhash(default: False)output(default: Password)delimiter(default: ,)dual_accounts(default: False)For compatibility with Dual Accounts where you are referencing aVirtualUsername- use theusernameparameter and ensuredual_accounts=True.ExamplefrompyaimimportCLIPasswordSDKaimcp=CLIPasswordSDK('/opt/CARKaim/sdk/clipasswordsdk')response=aimcp.GetPassword(appid='appID',safe='safeName',object='objectName',output='PassProps.Username,Password',delimiter='|')print('Full Response:{}'.format(response))print('Username:{}'.format(response['PassProps.Username']))print('Password:{}'.format(response['Password']))Centralized Credential Provider (CCPPasswordREST) MethodSupported ParametersCCPPasswordREST()url(required)verify(default: True)cert(default: None)timeout(default: 30)Query Parametersappid(required)safe(required)folder(default: root)object(this orusernamerequired)username(this orobjectrequired)addressdatabasepolicyidreasonquery_format(default: exact)dual_accounts(default: False)For compatibility with Dual Accounts where you are referencing aVirtualUsername- use theusernameparameter and ensuredual_accounts=True.ExamplefrompyaimimportCCPPasswordREST# set verify=False to ignore SSLaimccp=CCPPasswordREST('https://ccp.cyberarkdemo.example','AIMWebService',verify=True,timeout=10)service_status=aimccp.check_service()ifservice_status=='SUCCESS: AIMWebService Found. Status Code: 200':response=aimccp.GetPassword(appid='appid',safe='safe',object='objectName',reason='Reason message')print('Full Python Object:{}'.format(response))print('Username:{}'.format(response['Username']))print('Password:{}'.format(response['Content']))else:raiseException(service_status)Example with Client Certificate AuthenticationfrompyaimimportCCPPasswordREST# set verify=False to ignore SSLaimccp=CCPPasswordREST('https://ccp.cyberarkdemo.example',verify=True,cert=('/path/to/cert.pem','/path/to/key.pem'))...Example with Custom Service PathfrompyaimimportCCPPasswordREST# set verify=False to ignore SSLaimccp=CCPPasswordREST('https://ccp.cyberarkdemo.example','AIMWebServiceDEV',verify=True)...Maintainer@infamousjoegContributingContributions are open!  Check outCONTRIBUTING.mdfor more details!LicenseMIT