Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ValueError : StoragePasswords cannot have wildcards in namespace. #458

Closed
@lmnogues

Description

@lmnogues

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions