Keeper-Security / secrets-manager

Keeper Secrets Manager is a cloud-based, zero-knowledge platform for securing infrastructure secrets. Provides automatic password rotation and integration into popular DevOps CI/CD tools.
https://www.keepersecurity.com/secrets-manager.html
MIT License
87 stars 48 forks source link

Cannot consume keeper_config as an inline encrypted variable #674

Open ZarrenSpryXplor opened 1 week ago

ZarrenSpryXplor commented 1 week ago

When trying to consume the Keeper configuration via an inline encrypted variable, the following error is received.

exception during Jinja2 execution: Traceback (most recent call last):
  File "/Users/uk-gr9yjx0l0y/Projects/payments-ansible-awx/collections/ansible_collections/keepersecurity/keeper_secrets_manager/plugins/common/keeper_secrets_manager_ansible/__init__.py", line 253, in __init__
    config_instance = InMemoryKeyValueStorage(config=config_option)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/uk-gr9yjx0l0y/Library/Caches/pypoetry/virtualenvs/payments-ansible-awx-yKeAqXPR-py3.11/lib/python3.11/site-packages/keeper_secrets_manager_core/storage.py", line 193, in __init__
    self.config[ConfigKeys.get_enum(key)] = config[key]
                                            ~~~~~~^^^^^
  File "/Users/uk-gr9yjx0l0y/Library/Caches/pypoetry/virtualenvs/payments-ansible-awx-yKeAqXPR-py3.11/lib/python3.11/site-packages/ansible/parsing/yaml/objects.py", line 189, in __getitem__
    return self.data[index]
           ~~~~~~~~~^^^^^^^
TypeError: string indices must be integers, not 'str'
ZarrenSpryXplor commented 1 week ago

This can be resolved by converting the object to string although I'm not sure if this the correct way to approach the issue.

config_instance = InMemoryKeyValueStorage(config=str(config_option))