Skip to content

PyTenable using v1 tag filter API - missing filter operators like Begins and wc #1013

Description

@Mooey28

Describe the bug
I am trying to bulk upload tags, from a list of server names passed in by CSV with server name and the name of the service that server belongs to, for service tags to be created. Tenable sometimes records assets under servername, other times servername.domain and it is seemingly inconsistent/random what approach is taken. However in the current PyTenable tags.create() and tags.edit() the only filter operators available are eq, neq, match, nmatch, despite the main Tenable API supporting Begins and wc. Tenable support have advised to raise this issue on PyTenable as currently they present only these options:

Option 1 — Stay with PyTenable (V1 API)
Unfortunately, there's no native "begins with" operator in V1. The closest option is match, but be aware it converts to a double-sided wildcard (*value*) internally, which was the root cause of the performance/timeout issues with large hostname lists. For now, this remains a known limitation.

Option 2 — Use the V2 API directly (bypass PyTenable)
If the customer is comfortable making raw API calls, they can use the wc operator with a trailing wildcard value directly in the V2 format

You may want to check whether a newer version of PyTenable supports V2 filters natively — if so, upgrading could resolve this cleanly.

To Reproduce
tio.tags.edit(tag_value_uuid=tag_uuids[tag_value], filters=([('fqdn', 'eq', server_names)]), filter_type='and')

Expected behavior
Other filter operators to be supported like Begins or wc

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