Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError querying 'Address' key out of the CyberArk object using CyberArk Central Credential Provider Lookup #14606

Open
6 of 11 tasks
nielskroon opened this issue Oct 26, 2023 · 1 comment

Comments

@nielskroon
Copy link

nielskroon commented Oct 26, 2023

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to security@ansible.com instead.)

Bug Summary

Using AWX 23.3.0 and trying to fetch a credential (account) 'Address' from CyberARK PAM using Central Credential Provider version 12.6 we encounter a KeyError.

Fetching object property '' ('Content') or 'UserName' works flawlessly and using PowerShell the same query works and Address field in the JSON response is there and has the proper value.

related #13411
related #13402
related #5743

AWX version

23.3.0

Select the relevant components

  • UI
  • UI (tech preview)
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

kubernetes

Modifications

no

Ansible version

core 2.12.5.post0

Operating system

CentOS Stream release 8

Web browser

Chrome

Steps to reproduce

Reproduceable with a CyberARK PAM account that has the Address field populated and an AWX credential of Credential Type "VMware vCenter" passing through the lookup of the 'VCenter Host' details using AIM (External Secret Management System) to a self managed safe using this data:

{
  "reason": "no particular",
  "object_query": "Safe=XXXXXX_Self;Object=awx-vcenter-test",
  "object_property": "Address",
  "object_query_format": "Exact"
}

Expected results

env var VMWARE_HOST set with the value in the Address field of the CyberArk credential

Actual results

Test button in Credential Edit->External Secret Management System->Metadata page will show a KeyError pop up, and playbook in debug mode using this credential fails with these messages:

Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/jobs.py", line 528, in run
    credential.credential_type.inject_credential(credential, env, self.safe_cred_env, args, private_data_dir)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/models/credential/__init__.py", line 455, in inject_credential
    getattr(builtin_injectors, credential.credential_type.namespace)(credential, injected_env, private_data_dir)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/models/credential/injectors.py", line 71, in vmware
    env['VMWARE_HOST'] = cred.get_input('host', default='')
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/models/credential/__init__.py", line 279, in get_input
    return self._get_dynamic_input(field_name)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/models/credential/__init__.py", line 313, in _get_dynamic_input
    return input_source.get_input_value()
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/models/credential/__init__.py", line 1258, in get_input_value
    return backend(**backend_kwargs)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/credential_plugins/aim.py", line 115, in aim_backend
    raise KeyError('Property {} not found in object'.format(object_property))
KeyError: 'Property Address not found in object'

Additional information

Using another instance (same versions AWX and CCP) we can reproduce this error.

@Nenodema
Copy link
Contributor

I am encountering the same issue (CCP v13.x, AWX 23.1.0). When I retrieve the object from the CCP using PowerShell, I can confirm the existence of the 'Address' property. However, I am unable to utilize it within AWX, and I am also receiving the same error message.

@infamousjoeg could you assist with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants