Hi Joe,
Thank You for your input.
Just a thought, If my credentials are incorrect- in this scenario, I should see 401 error message when triggering below CURL command, but getting the required secret value.
curl -H “$(conjur authn authenticate -H)”
http://172.18.0.5:80/secrets/myConjurAccount/variable/db%2Fdbpass
Also, when I am using the {{ lookup(‘cyberark.conjur_collection.conjur_variable’, ‘/path/to/secret’) }}, i see below exception:
“msg”: “lookup plugin (cyberark.conjur_collection.conjur_variable) not found”
did ansible-galaxy collection install cyberark.conjur_collection and required variables are already set.
Moreover, authn token from ansible playbook output i.e. when getting an error (refer below error), when using this token via command:
curl -H “Authorization: Token token=“eyJwcm90ZWN0ZWQiOiJleUpoYkdjaU9pSmpiMjVxZFhJdWIzSm5MM05zYjNOcGJHOHZkaklpTENKcmFXUWlPaUkzTTJVeE5URTRORFl5TnpoaU1qazNaakV3TkRWbU1UWmxOMkk1TmpVeVl5SjkiLCJwYXlsb2FkIjoiZXlKemRXSWlPaUpoWkcxcGJpSXNJbWxoZENJNk1UVTROalEyTVRrMU1IMD0iLCJzaWduYXR1cmUiOiJMcUxQY2xQUFNjdGVXNlNfVzFkb2pZbVZlYnVldld1LXRQV3kzcnNNMWh1enVENUVTcXFnSlk4ZkE5NFJOMTVSYmZCS3hyX2NodUhrVkY0bEpubnRfUDRyZHM4c1RXQks0VVY1cUVmR2hwMU05dnhXUy01Y2IyV054bVZDdkZ3Sk04S1VYQWVOUnlkX0l1OFVlU0J3U1NWYXd0cjl1X0NhVHJRUkw2RkNUOWVGS2pQWWZoaHQta2ZjeVNFSDMwb0o3Q0pQSjhVWTgyZzdQZnltZXlkVjNxUmUzdnZMSmF1dWRSVlRzVkszWXVhbHhmRjJkOEpDbGJaWnhURHJtT2NLc3ZzbElPTkFMMExQc0hiOHFmMlVna3otZnpCWUE3NFU3UW9yRkN2aElwYU1sdTNSVGUxVVhrN2xzcUR4LWZxRGFOUjVUb1lnS05IUkRYa2lqMU1FU25ZU1JMMzAzcktmY19wWVpmUUhfY1ZLMVgtd2dwR1Yzc3NBaWtZTUF2MDIifQ==””
http://172.18.0.5:80/secrets/myConjurAccount/variable/db%2Fdbpass
This works!!! but via ansible it doesn’t. I am not sure why in token in error log below, I see token starting from"\b"
TASK [debug] ******************************************************************************************************************************
task path: /home/fedora/ansible/conjur-quickstart/ansible_project/playbook.yml:14
conf file: /etc/conjur.conf
Loading configuration from: /etc/conjur.conf
identity file: /etc/conjur.identity
Loading identity from: /etc/conjur.identity for http://172.18.0.5:80
Authentication request to Conjur at: http://172.18.0.5:80/authn/myConjurAccount/admin/authenticate, with user: admin
Header: {‘Authorization’: ‘Token token="b’eyJwcm90ZWN0ZWQiOiJleUpoYkdjaU9pSmpiMjVxZFhJdWIzSm5MM05zYjNOcGJHOHZkaklpTENKcmFXUWlPaUkzTTJVeE5URTRORFl5TnpoaU1qazNaakV3TkRWbU1UWmxOMkk1TmpVeVl5SjkiLCJwYXlsb2FkIjoiZXlKemRXSWlPaUpoWkcxcGJpSXNJbWxoZENJNk1UVTROalEyTXpJeU9IMD0iLCJzaWduYXR1cmUiOiJxaHpmMlE0OU8xN0dEcV9haUNfdENtbGYyc1ZycndqZDM2RWNYOXB2SlRpbUFlN3RySVlrR05uTmdqUWZlc2x1V2NiYzhkR04yVHdfalNMV3NmYnM1QXFxY3BVR1ZSZVNIVnk2Q2RZLUVQRE16VDJETndwRXRPdEhPTU5NNHpDS01tSXY2dTdzODJPSmZuMl8yU1pySEJfT1IzTVBNTHpUbjVaMTBSMGxGRHgyODUzZVo4WTZtZEdQMVl6ZWFUNVNrMzcyLTRMSnhOdlBoMjNoUDZBeWhTTERwbWs2S0RxX0tKVGh3VWREU29YbUVCb1hic0xqcllyNFljWEs0ZFlkQjRZZzYzLU4yaVU3WXBMQkRhUDRjRl9nUTdQNHVqVXozTmYwcjlDY0F6UnowQXdxSUJ6cDhuNndhTFN2M1U2d19WQ3NDY2J2SmpYNWFGSDE2SzJfU0ZnUGFLS0hHNzBqSTZLY2xWak1USktrTmI2cm9LLW91SVdSNWU0cXZxbnMifQ==’"’}
Conjur Variable URL: http://172.18.0.5:80/secrets/myConjurAccount/variable/db%2Fdbpass
fatal: [localhost]: FAILED! => {
“msg”: “An unhandled exception occurred while running the lookup plugin ‘conjur_variable’. Error was a <class ‘urllib.error.HTTPError’>, original message: HTTP Error 401: Unauthorized”
}
Thank You.