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

ValueError : StoragePasswords cannot have wildcards in namespace. #458

Closed
lmnogues opened this issue May 25, 2022 · 2 comments
Closed

ValueError : StoragePasswords cannot have wildcards in namespace. #458

lmnogues opened this issue May 25, 2022 · 2 comments

Comments

@lmnogues
Copy link

lmnogues commented May 25, 2022

Hi,

I know it's more likely a feature and not a bug. But I was wondering why is StoragePasswords is protected from access with wildcard apps or namespace, when the same action using rest is not protected ?

The first snippet will generate an error because app & owner are set to be wildcards

s = client.connect(username="<user>", password="<redacted>",host="<ip>",port="<port>",app="-",owner="-")

try:
    for pw in s.storage_passwords:
        print(pw.username)
except ValueError as ve:
    print(ve)

The following snippet will not generate an error with the wildcards :

req = requests.get(f"https://<host>:<port>/servicesNS/-/-/storage/passwords/", verify=False, headers={'Authorization': s.token},data={'output_mode':"json"})
req.raise_for_status()
for pw in req.json().get("entry"):
    print(pw.get("content").get("username"))

In our workflow with Splunk, we might not know where is stored the password so we need to be able to use wildcard on the app level of the namespace.

Is there any solution with splunklib or should we stick with our basic requests ?

@ashah-splunk
Copy link
Contributor

Hi @Jalkar , thanks from bringing this to our knowledge. We are analysing on this and will be sharing an update soon.

@ashah-splunk
Copy link
Contributor

@Jalkar we would request you to use the latest SDK release with the changes and let us know if it resolves the issue.

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

No branches or pull requests

2 participants