cyberark / ansible-security-automation-collection

CyberArk Ansible Security Automation Collection
MIT License
60 stars 37 forks source link

RFE: Make the error more obvious while retrieving credential from cyberark while using cyberark_credential #18

Open SWADESNA opened 3 years ago

SWADESNA commented 3 years ago

SUMMARY

While trying to retrieve credential from Cyberark using cyberark_credential module the error thrown is misleading.

"msg": "Unknown error while retrieving credential.\n*** end_point=https://x.y.z/AIMWebService/api/Accounts?AppId=Ansible&Query=Safe%ABC-Ansible%3BObject%3A-B-C-D.a.b.c&ConnectionTimeout=30&QueryFormat=Mytestformat&reason=Test%20Ansible%20Playbook\n<urlopen error [Errno 104] Connection reset by peer>", 
    "status_code": -1

We can enhance the error thrown, to something which makes it clear or obvious that the issue lies with incorrect proxy configuration & not with Cyberark side.

ADDITIONAL INFORMATION This would be helpful for Customers using cyberark.pas.cyberark_credential plugin from cyberark.pas collection

MantvydasD commented 6 months ago

We were using 1.0.23 -- didn't have this unknown error, but now we have 1.0.25, and it's randomly happening. Sometimes automation retrieves the password successfully, and sometimes that same automation not. Only time is different.

UPD: Not true. Error happens with any of these cyberark.pas versions. All depends on ansible --version. Please see my another message below.

szh commented 6 months ago

@cyberark-bizdev @infamousjoeg

MantvydasD commented 6 months ago

No, please disregard my previous message, no matter which cyberark.pas we use 1.0.23 or 1.0.25 -- the error still randomly happens. We currently found out, that the error sometimes happens if we try to retrieve password with ansible version later than 2.15.2. If we're trying to retrieve password with ansible core 2.15.3 -- 2.15.10 -- it fails with error above. But with 2.14.0 - 2.15.2 it always works.