SearchParams

class pytw.search_params.SearchParams(window_start=None, window_end=None, offset=None, limit=None)[source]

SearchParams object

Parameters:
  • window_start – Number of days in the past to start search. Default is 1 day ago.
  • window_end – Number of days in the past to end search. Default is 0 i.e. today.
  • offset – Offset in result set. Used for pagination. Default is to start from first record.
  • limit – Number of records to be returned. Used for pagination. Default is all records.
add_asset_id_filter(asset_id)[source]
Parameters:asset_id – The asset ID of the asset to retrieve
add_asset_ids_filter(asset_ids_list)[source]
Parameters:asset_ids_list – A list of asset IDs to filter on.
add_asset_locations_filter(locations_list)[source]
Parameters:locations_list – A list of locations to filter by.
add_asset_names_filter(names_list)[source]
Parameters:names_list – A list of asset names to filter by.
add_asset_patch_filter(patch)[source]
Parameters:patch – Filter assets containing specified patch
add_asset_product_filter(product)[source]
Parameters:product – Filter assets containing specified product
add_asset_types_filter(types_list)[source]
Parameters:types_list – A list of asset types to filter by.
add_asset_with_open_impacts_filter()[source]

Filter only assets with open impacts

add_exploitable_filter()[source]

Filter only results with exploits.

add_free_text_search_filter(search_text)[source]
Search_text:The text to be searched on.

For vulns, it applies to vuln IDs, title, summary or affected products. For impacts, it applies to asset IDs, asset names, vuln IDs or affected products.

add_impact_status_filter(status_list)[source]
Parameters:status_list – A list of impact_status.Status enum values to filter by.
add_my_asset_filter()[source]

Filter only my assets

add_patch_available_filter()[source]

Filter only results with patches available.

add_products_filter(products_list)[source]
Parameters:products_list – A list of products to filter on.
add_publishers_filter(publishers_list)[source]
Parameters:publishers_list – A list of publishers to filter on.
add_ratings_filter(ratings_list)[source]
Parameters:ratings_list – A list of rating.Rating enum values to filter on.
add_recent_impacts_filter()[source]

Filter only recent impacts i.e. not yet notified.

add_recent_vulns_filter()[source]

Filter only recent vulns i.e. not yet notified.

add_remediation_available_filter()[source]

Filter only results with remediations available.

add_threatfilter_filter()[source]

Filter by threatfilter of user.

add_threshold_filter(threshold)[source]
Parameters:threshold – Return only results which cross the threshold.

For Vulns, get vulnerabilities with relevance greater than or equal to threshold. For Impacts, get impact with confidence values greater than or equal to threshold.

add_tracked_vulns_filter()[source]

Filter only vulns tracked by user.

add_vuln_ids_filter(vuln_ids_list)[source]
Parameters:vuln_ids_list – A list of vuln IDs to filter on.
to_dict(include_window_params=True)[source]

Convert the SearchParams to a dict object