### Install pyTenable Library using pip Source: https://developer.tenable.com/docs/ot-get-started-with-pytenable-for-tenableot This command installs the pyTenable Python library and its dependencies using pip. Ensure you have Python 3.6 or later installed. This is the recommended method for installation. ```shell pip3 install pytenable ``` -------------------------------- ### Get Started with pyTenable for Tenable OT Source: https://context7_llms This example shows how to initialize the pyTenable client for Tenable OT. It requires the Tenable OT instance URL, username, and password for authentication. The output is a connected pyTenable client object. ```python from tenable.ot import TenableOT # Replace with your Tenable OT instance details tenable_ot_url = "https://your-tenable-ot-instance.com" tenable_ot_username = "your_username" tenable_ot_password = "your_password" tenable_ot = TenableOT(host=tenable_ot_url, username=tenable_ot_username, password=tenable_ot_password) print("Successfully connected to Tenable OT.") ``` -------------------------------- ### Get About Singleton Source: https://context7_llms Retrieves information about the API. ```APIDOC ## GET /llmstxt/developer_tenable_llms_txt/reference/get_api-about.md ### Description Gets information about the API. ### Method GET ### Endpoint /llmstxt/developer_tenable_llms_txt/reference/get_api-about.md ### Parameters None ### Request Example None ### Response #### Success Response (200) - **version** (string) - The API version. - **environment** (string) - The API environment. #### Response Example { "version": "1.0.0", "environment": "production" } ### License Required license type: none ``` -------------------------------- ### Get Connector Details - Go Example Source: https://developer.tenable.com/reference/io-connectors-details A Go program to retrieve cloud connector details from the Tenable API. This example makes a GET request to the '/settings/connectors/{connector_id}' endpoint, passing the API key in the 'X-ApiKeys' header for authentication. Ensure to replace '{connector_id}', 'ACCESS_KEY', and 'SECRET_KEY' with your valid credentials. ```go package main import ( "fmt" "io/ioutil" "net/http" ) func main() { connectorID := "{connector_id}" apiKey := "accessKey=ACCESS_KEY;secretKey=SECRET_KEY" url := fmt.Sprintf("https://cloud.tenable.com/settings/connectors/%s", connectorID) client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Printf("Error creating request: %s\n", err) return } req.Header.Set("X-ApiKeys", apiKey) res, err := client.Do(req) if err != nil { fmt.Printf("Error sending request: %s\n", err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Printf("Error reading response body: %s\n", err) return } fmt.Println(string(body)) } ``` -------------------------------- ### Get Plugin Details Source: https://context7_llms Returns details for a specified plugin. ```APIDOC ## GET /io/plugins/{pluginId}/details ### Description Returns details for a specified plugin. ### Method GET ### Endpoint /io/plugins/{pluginId}/details ### Parameters #### Path Parameters - **pluginId** (integer) - Required - The ID of the plugin to retrieve details for. ### Response #### Success Response (200) - **id** (integer) - The plugin ID. - **name** (string) - The name of the plugin. - **description** (string) - A description of the plugin. - **severity** (string) - The severity of the plugin (e.g., 'Critical', 'High', 'Medium', 'Low', 'Informational'). - **platform** (string) - The platform the plugin targets. - **solution** (string) - The solution to mitigate the vulnerability. - **synopsis** (string) - A brief summary of the plugin. - **see_also** (string) - Related links or references. - **stig_stigasec** (string) - STIG/SECAT information. - **cvss_base_score** (number) - The base CVSS score. - **cvss_temporal_score** (number) - The temporal CVSS score. - **cvss_vector** (string) - The CVSS vector string. - **exploit_available** (boolean) - Indicates if an exploit is available. - **exploit_frameworks** (array) - List of exploit frameworks. - **metasploit_name** (string) - Name in Metasploit. - **plugin_modification_date** (string) - The date the plugin was last modified. - **plugin_published_date** (string) - The date the plugin was published. - **plugin_type** (string) - The type of plugin. - **risk_factor** (string) - The risk factor of the vulnerability. - **script_version** (string) - The version of the script. - **supplementary_view** (string) - Supplementary view information. - **synopsis** (string) - Synopsis of the plugin. - **vpr_score** (number) - The VPR score. - **vpr_vector** (string) - The VPR vector string. - **vulnerability_type** (string) - The type of vulnerability. - **wasa_score** (number) - The WASA score. - **wasa_vector** (string) - The WASA vector string. #### Response Example ```json { "id": 100001, "name": "Test Plugin", "description": "This is a test plugin.", "severity": "High", "platform": "Linux", "solution": "Update your system.", "synopsis": "A test vulnerability.", "see_also": "http://example.com", "stig_stigasec": "N/A", "cvss_base_score": 7.5, "cvss_temporal_score": 7.0, "cvss_vector": "(AV:N/AC:L/Au:N/C:P/I:P/A:P)", "exploit_available": false, "exploit_frameworks": [], "metasploit_name": null, "plugin_modification_date": "2023-10-26T10:00:00Z", "plugin_published_date": "2023-01-01T09:00:00Z", "plugin_type": "local", "risk_factor": "Medium", "script_version": "1.0", "supplementary_view": null, "vpr_score": 8.2, "vpr_vector": "(AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)", "vulnerability_type": "Remote", "wasa_score": 6.0, "wasa_vector": "(CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)" } ``` ``` -------------------------------- ### Go Request Client Example Source: https://developer.tenable.com/reference/read-the-docs A basic Go client code sample for interacting with Tenable APIs. This snippet demonstrates making an HTTP GET request using Go's standard `net/http` package. ```Go package main import ( "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.tenable.com/v1/some_resource" apiKey := "accessKey=;secretKey=" req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Printf("Error creating request: %s\n", err) return } req.Header.Set("Accept", "application/json") req.Header.Set("X-ApiKeys", apiKey) client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Printf("Error making request: %s\n", err) return } defer resp.Body.Close() if resp.StatusCode >= 200 && resp.StatusCode < 300 { body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Printf("Error reading response body: %s\n", err) return } fmt.Println("Success!") fmt.Println(string(body)) } else { body, _ := ioutil.ReadAll(resp.Body) fmt.Printf("Error: HTTP Status Code %d\n%s\n", resp.StatusCode, string(body)) } } ``` -------------------------------- ### GET /workbenches/assets (Filter by Installed Software) Source: https://developer.tenable.com/docs/workbench-filters This example demonstrates how to filter assets to retrieve only those with a specific version of Apple Quicktime installed. ```APIDOC ## GET /workbenches/assets ### Description Filters assets based on installed software. This is useful for managing remediation responsibilities, such as patching specific software vulnerabilities. ### Method GET ### Endpoint `/workbenches/assets` ### Query Parameters - **filter.0.filter** (string) - Required - Specifies the filter type. Use `installed_software` to filter by software. - **filter.0.quality** (string) - Required - Specifies the quality operator. Use `eq` for equality. - **filter.0.value** (string) - Required - Specifies the value to filter by. For installed software, this should be in CPE format (e.g., `cpe:/a:apple:quicktime:7.7.1`). ### Request Example ```http GET https://cloud.tenable.com/workbenches/assets?filter.0.filter=installed_software&filter.0.quality=eq&filter.0.value=cpe:/a:apple:quicktime:7.7.1 ``` ### Response #### Success Response (200) Returns a list of assets that match the specified filter criteria. #### Response Example (Response body will contain a JSON object representing the matching assets) ``` -------------------------------- ### Relay API Source: https://context7_llms Endpoint for getting the current linking key for relay setup. ```APIDOC ## GET /api/relays/linking-key ### Description Gets the current linking key for relay setup. ### Method GET ### Endpoint /api/relays/linking-key ### Parameters None ### Response #### Success Response (200) - **linking_key** (string) - The linking key for relay setup. #### Response Example ```json { "linking_key": "a1b2c3d4e5f6" } ``` ``` -------------------------------- ### Launch Scan Source: https://context7_llms Launches a scan. ```APIDOC ## POST /scans/{scan_id}/launch ### Description Launches a scan. There is a limit of 25 active scans per container. ### Method POST ### Endpoint /scans/{scan_id}/launch ### Parameters #### Path Parameters - **scan_id** (integer) - Required - The ID of the scan to launch. ### Request Example (No request body needed) ### Response #### Success Response (204) No content returned on successful launch. #### Response Example (No response body) ``` -------------------------------- ### Delete shared collection Source: https://context7_llms Removes a shared collection. This operation starts an asynchronous job that can be monitored using the 'Get job status' endpoint. ```APIDOC ## DELETE /shared-collections/{collection_id} ### Description Deletes a shared collection. This request creates an asynchronous job in Tenable Vulnerability Management. You can query the status of the job with the [Get job status](ref:shared-collections-job-status) endpoint. ### Method DELETE ### Endpoint /shared-collections/{collection_id} ### Parameters #### Path Parameters - **collection_id** (string) - Required - The unique identifier of the shared collection to delete. ### Response #### Success Response (200) - **job_id** (string) - The ID of the asynchronous job created for the deletion. #### Response Example ```json { "job_id": "job-rst123" } ``` ``` -------------------------------- ### List Downloadable Files for a Product Source: https://context7_llms Retrieves a JSON hash of all download files for a given product page. ```APIDOC ## GET /llmstxt/developer_tenable_llms_txt/reference/get_pages-slug.md ### Description Returns a JSON hash of all download files for a given product page. ### Method GET ### Endpoint /llmstxt/developer_tenable_llms_txt/reference/get_pages-slug.md ### Parameters #### Path Parameters - **slug** (string) - The unique identifier for the product page. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **files** (object) - A hash where keys are filenames and values are file details. #### Response Example { "files": { "example_file.zip": { "size": 12345, "url": "string" } } } ``` -------------------------------- ### List Product Pages Source: https://context7_llms Retrieves a list of available product pages. ```APIDOC ## GET /llmstxt/developer_tenable_llms_txt/reference/get_pages.md ### Description Returns a list of product pages. ### Method GET ### Endpoint /llmstxt/developer_tenable_llms_txt/reference/get_pages.md ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **pages** (array) - A list of product page objects. #### Response Example { "pages": [ { "slug": "string", "name": "string" } ] } ``` -------------------------------- ### Recurring Agent Scan with pyTenable Source: https://context7_llms This example shows how to set up recurring agent scans using pyTenable. Agent scans leverage Tenable agents installed on endpoints for continuous monitoring. Requires an authenticated TenableIO client and scheduling details. The output confirms the recurring agent scan setup. ```python from tenable.io import TenableIO # Assuming you have authenticated and have a TenableIO client object tio = TenableIO(access_key='YOUR_ACCESS_KEY', secret_key='YOUR_SECRET_KEY') # Define recurring agent scan parameters scan_name = "Recurring Agent Scan" policy_id = 8 # Replace with your actual policy ID for agent scans target_groups = ["Default Group"] # Specify target agent groups first_run = "2023-10-28T02:00:00Z" interval = "weekly" # Create the recurring agent scan scan_job = tio.scans.create_recurring( name=scan_name, policy_id=policy_id, target_groups=target_groups, schedule_type='weekly', start_time=first_run ) print(f"Recurring agent scan '{scan_name}' created with ID: {scan_job['id']}") ``` -------------------------------- ### Scan Scheduling Example Source: https://developer.tenable.com/reference/scans-schedule Provides an example of how to configure scan scheduling parameters. This includes setting the start time for one-time or recurring scans and specifying the timezone. The start time format is YYYYMMDDTHHMMSS. ```json { "control": true, "enabled": false, "rrules": "FREQ=DAILY;INTERVAL=1", "timezone": "US/Central", "starttime": "20181206T230000" } ``` -------------------------------- ### C# Request Client Example Source: https://developer.tenable.com/reference/read-the-docs A basic C# client code sample for interacting with Tenable APIs. This snippet demonstrates making an HTTP request using `HttpClient` class. ```C# using System; using System.Net.Http; using System.Threading.Tasks; public class TenableApiClient { public static async Task MakeRequestAsync() { using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://api.tenable.com/v1/"); client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("X-ApiKeys", "accessKey=;secretKey="); try { HttpResponseMessage response = await client.GetAsync("some_resource"); response.EnsureSuccessStatusCode(); // Throws an exception if status code is not 2xx string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine("Success!"); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine($"Request error: {e.Message}"); } } } } ``` -------------------------------- ### Get Linking Key for Relay Setup (OpenAPI Definition) Source: https://developer.tenable.com/reference/get_api-relays-linking-key This is the OpenAPI 3.0.0 definition for the GET /api/relays/linking-key endpoint. It specifies the request parameters (API key header), security scheme, required license types, and the expected JSON response structure containing the linkingKey. The API is used to retrieve the current linking key for relay setup. ```json { "openapi": "3.0.0", "info": { "title": "Identity Exposure", "description": "API to interact with Identity Exposure.", "version": "production" }, "servers": [ { "url": "{protocol}://customer.tenable.ad", "variables": { "protocol": { "default": "https" } } } ], "components": { "securitySchemes": { "ApiKey": { "name": "x-api-key", "description": "The user's API key", "in": "header", "type": "apiKey" } } }, "tags": [ { "name": "Relay", "description": "Configure relays that make AD queries for Ceti" } ], "paths": { "/api/relays/linking-key": { "get": { "summary": "Get current linking key for relay setup", "description": "Required license type: ioe, ioaPreview, ioa", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "description": "Linking Key", "type": "object", "additionalProperties": false, "required": [ "linkingKey" ], "properties": { "linkingKey": { "type": "string" } } } } } }, "401": { "description": "Unauthorized" }, "500": { "description": "Internal server error" } }, "tags": [ "Relay" ], "x-tenablead-required-product-license-type": [ "ioe", "ioaPreview", "ioa" ], "parameters": [ { "name": "x-api-key", "description": "The user's API key", "in": "header", "schema": { "type": "string", "default": "put-your-api-key-here" }, "required": true, "deprecated": false } ], "security": [ { "ApiKey": [] } ] } } }, "x-readme": { "explorer-enabled": true, "proxy-enabled": true }, "_id": "64ca81e602648b0079a1f640" } ``` -------------------------------- ### Swift Request Client Example Source: https://developer.tenable.com/reference/read-the-docs A basic Swift client code sample for interacting with Tenable APIs. This snippet shows how to make an API request using `URLSession`. ```Swift import Foundation let url = URL(string: "https://api.tenable.com/v1/some_resource")! var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue("application/json", forHTTPHeaderField: "Accept") request.setValue("accessKey=;secretKey=", forHTTPHeaderField: "X-ApiKeys") let session = URLSession.shared let task = session.dataTask(with: request) { data, response, error in guard let data = data, error == nil else { print("Error: \(error?.localizedDescription ?? "Unknown error")") return } if let httpResponse = response as? HTTPURLResponse { if (200...299).contains(httpResponse.statusCode) { if let responseString = String(data: data, encoding: .utf8) { print("Success!\n\(responseString)") } } else { print("Error: HTTP status code \(httpResponse.statusCode)\n\(String(data: data, encoding: .utf8) ?? "")") } } } task.resume() ``` -------------------------------- ### Get Connector Details - Python Example Source: https://developer.tenable.com/reference/io-connectors-details Retrieves the details for a specified cloud connector using the Tenable API. This example demonstrates how to make a GET request to the '/settings/connectors/{connector_id}' endpoint. It requires the 'connector_id' as a path parameter and uses the 'cloud' security scheme for authentication. ```python import requests url = "https://cloud.tenable.com/settings/connectors/{connector_id}" headers = { "X-ApiKeys": "accessKey=ACCESS_KEY;secretKey=SECRET_KEY" } response = requests.get(url, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}") ``` -------------------------------- ### Tenable Profile Configuration Example Source: https://developer.tenable.com/reference/agent-profiles-details An example of a Tenable profile configuration, including version, plugin set, update status, and container public key. This showcases a comprehensive profile setup with various parameters like strings, booleans, and multi-line strings for keys. ```json { "version": "10.8.0", "pluginset": "202407172302", "update_disabled": true, "container_public_key": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEArvPm3nYSduF7eHNcAp5i\nEgL0f1Pp2Kp304vAQRjaURlNN1jKUCBV8IgCVLM9IJZ5u153pEFgyk9sNVZgVq9m\nUt3yfJ4HtWQwYYo1v5Cv4Ir7hRh18J2uDQAHhAJZXfc8rTTVZqaCh5iEh+shdPc6\nYP4Qmb0Z1d1b0CaMBHyNm3ATUfZDMb8v3tVcj6BYG7Oovx45XdF4xnW19tOFUeXH\npGkNRvalNeWphke+GgLeAqItSKfH6sctTB8dUG6ENqXmp20ZiXE4mzTDS7MTQs/Y\nyiZYvjcLSO6isQPh9ndoCSfB2tEvbW/48MdJJ0vrHS0HWb0Ninu6MUSU6ijvA5AF\n9MMo/Rd/h2dQ71AnzKN43IxFx53PUshHyMTbTXDYCoRKTRHb4P+k9jwc3YsHjdVE\nyCQI0AyNmTY5x6qxqS45tIQO3GbFINv9GjEW3eGtFerJEXdySwiFwVoWz5A98TVO\nhcJupa4jV2Qglp2gDMoRC+zakncVTHusxo8e3aYHeVH8Rcv0aMKClc0gx0F6BgcV\nyljgQWZER6dIWfS5utbJbQhpPPdoWZ5O+4TJYhenD77Bg3wQC/HC2whDKp4nSnpb\n1r9QPlS1frdl5fLclbxHwjCHYmRMI5EHwjtzx0rTeOqYmqwL3/PzNDz6A3gLB0CB\n8hFQtVB3tUl1uQD5xQdyiwkCAwEAAQ==\n-----END PUBLIC KEY-----\n ``` -------------------------------- ### Get Connector Details - Node.js Example Source: https://developer.tenable.com/reference/io-connectors-details Provides a Node.js example for retrieving cloud connector details from the Tenable API. This code snippet makes a GET request to the '/settings/connectors/{connector_id}' endpoint, including the necessary 'X-ApiKeys' header for authentication. Ensure to replace placeholders with actual values. ```javascript const axios = require('axios'); const url = `https://cloud.tenable.com/settings/connectors/${connector_id}`; const headers = { 'X-ApiKeys': 'accessKey=ACCESS_KEY;secretKey=SECRET_KEY' }; axios.get(url, { headers: headers }) .then(response => { console.log(response.data); }) .catch(error => { console.error(`Error: ${error.response.status}`); }); // Replace 'connector_id', 'ACCESS_KEY', and 'SECRET_KEY' with actual values. ``` -------------------------------- ### JavaScript Request Client Example Source: https://developer.tenable.com/reference/read-the-docs A basic JavaScript client code sample for interacting with Tenable APIs, suitable for browser-based or Node.js environments. This demonstrates making a request using the Fetch API or XMLHttpRequest. ```JavaScript const url = 'https://api.tenable.com/v1/some_resource'; const headers = { 'X-ApiKeys': 'accessKey=;secretKey=' }; fetch(url, { method: 'GET', headers: { 'Accept': 'application/json', ...headers } }) .then(response => { if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.json(); }) .then(data => { console.log('Success!'); console.log(data); }) .catch(error => { console.error('Error:', error); }); ``` -------------------------------- ### Create Inventory Source: https://context7_llms Creates a new inventory. ```APIDOC ## POST /inventories ### Description Creates a new inventory. ### Method POST ### Endpoint /inventories ### Parameters This endpoint does not require path or query parameters. ### Request Body - **name** (string) - Required - The name of the new inventory. - **description** (string) - Optional - The description for the new inventory. ### Request Example ```json { "name": "New Inventory", "description": "Inventory for new project." } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the newly created inventory. - **name** (string) - The name of the newly created inventory. #### Response Example { "id": "inventory-abc", "name": "New Inventory" } ``` -------------------------------- ### List Cloud Connectors (Go) Source: https://developer.tenable.com/reference/io-connectors-list This Go snippet demonstrates how to list cloud connectors using the standard `net/http` package. It constructs the request with the `X-ApiKeys` header for authentication and sends a GET request to the `/settings/connectors` endpoint. The response body is printed to standard output. ```go package main import ( "fmt" "io/ioutil" "net/http" "os" "stringsלת " ) func main() { accessKey := "YOUR_ACCESS_KEY" secretKey := "YOUR_SECRET_KEY" url := "https://cloud.tenable.com/settings/connectors" req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Fprintf(os.Stderr, "Error creating request: %v\n", err) return } req.Header.Set("accept", "application/json") req.Header.Set("X-ApiKeys", fmt.Sprintf("accessKey=%s;secretKey=%s", accessKey, secretKey)) client := &http.Client{} res, err := client.Do(req) if err != nil { fmt.Fprintf(os.Stderr, "Error making request: %v\n", err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Fprintf(os.Stderr, "Error reading response body: %v\n", err) return } if res.StatusCode != http.StatusOK { fmt.Fprintf(os.Stderr, "HTTP Error: %d\nResponse: %s\n", res.StatusCode, string(body)) return } fmt.Println(string(body)) } ``` -------------------------------- ### Get Application Settings Source: https://context7_llms Retrieves the current application settings. ```APIDOC ## GET /llmstxt/developer_tenable_llms_txt/reference/get_api-application-settings.md ### Description Get the application settings. ### Method GET ### Endpoint /llmstxt/developer_tenable_llms_txt/reference/get_api-application-settings.md ### Parameters None ### Request Example None ### Response #### Success Response (200) - **settings** (object) - The application settings. #### Response Example { "settings": { "theme": "dark", "notifications": true } } ### License Required license type: ioa, ioaPreview, ioe ``` -------------------------------- ### Users API Source: https://context7_llms Endpoints for retrieving and creating user instances. ```APIDOC ## GET /api/users ### Description Gets all user instances. ### Method GET ### Endpoint /api/users ### Parameters None ### Response #### Success Response (200) - **users** (array) - An array of user objects. #### Response Example ```json [ { "id": 1, "username": "user1" }, { "id": 2, "username": "user2" } ] ``` ## POST /api/users ### Description Creates a new user instance. ### Method POST ### Endpoint /api/users ### Parameters #### Request Body - **username** (string) - Required - The username for the new user. - **password** (string) - Required - The password for the new user. - **roles** (array) - Optional - An array of role IDs for the user. ### Request Example ```json { "username": "newuser", "password": "securepassword123", "roles": [1, 3] } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the newly created user. - **username** (string) - The username of the new user. #### Response Example ```json { "id": 3, "username": "newuser" } ``` ## GET /api/users/whoami ### Description Gets the current user's information. ### Method GET ### Endpoint /api/users/whoami ### Parameters None ### Response #### Success Response (200) - **user_info** (object) - An object containing the current user's information. #### Response Example ```json { "user_info": { "id": 1, "username": "currentuser", "roles": ["admin", "viewer"] } } ``` ``` -------------------------------- ### Tenable Asset Information Response Example Source: https://developer.tenable.com/reference/workbenches-asset-info An example JSON response illustrating the structure of asset information, including timestamps, unique identifiers, operating system, FQDN, MAC address, and a breakdown of vulnerability counts by severity. ```json { "info": { "time_end": "2018-12-31T15:00:25Z", "time_start": "2018-12-31T15:00:25Z", "id": "aae31e9f-1f6f-4b59-b36b-12e51035584d", "uuid": "aae31e9f-1f6f-4b59-b36b-12e51035584d", "operating_system": [ "Microsoft Windows Server 2008 R2 Standard Service Pack 1" ], "fqdn": [ "example.com" ], "mac_address": [ "00:50:56:bd:4b:d8" ], "counts": { "vulnerabilities": { "total": 573, "severities": [ { "count": 392, "level": 0, "name": "Info" }, { "count": 11, "level": 1, "name": "Low" }, { "count": 122, "level": 2, "name": "Medium" }, { "count": 316, "level": 3, "name": "High" } ] } } } } ``` -------------------------------- ### Get Asset Limit Source: https://context7_llms Retrieves the asset limit for the current inventory. ```APIDOC ## GET /inventory/asset_limit ### Description Gets the asset limit of the current inventory. ### Method GET ### Endpoint /inventory/asset_limit ### Parameters This endpoint does not require any parameters. ### Request Body This endpoint does not require a request body. ### Response #### Success Response (200) - **limit** (integer) - The asset limit of the current inventory. #### Response Example { "limit": 1000000 } ``` -------------------------------- ### Objective-C Request Client Example Source: https://developer.tenable.com/reference/read-the-docs A basic Objective-C client code sample for interacting with Tenable APIs. This snippet shows how to make an API request using `NSURLSession` or `NSURLConnection`. ```Objective-C #import NSURL *url = [NSURL URLWithString:@"https://api.tenable.com/v1/some_resource"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; [request setHTTPMethod:@"GET"]; [request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; [request setValue:@"accessKey=;secretKey=" forHTTPHeaderField:@"X-ApiKeys"]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error) { NSLog(@"Error: %@\n", error); return; } NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; if (httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) { NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"Success!\n%@\n", responseString); } else { NSLog(@"Error: %ld\n%@\n", (long)httpResponse.statusCode, [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); } }]; [task resume]; ``` -------------------------------- ### Get Attack Types Source: https://context7_llms Retrieves a list of available attack types. ```APIDOC ## GET /llmstxt/developer_tenable_llms_txt/reference/get_api-attack-types.md ### Description Get attack types. ### Method GET ### Endpoint /llmstxt/developer_tenable_llms_txt/reference/get_api-attack-types.md ### Parameters None ### Request Example None ### Response #### Success Response (200) - **attack_types** (array) - A list of attack types. #### Response Example { "attack_types": [ { "id": "string", "name": "string" } ] } ### License Required license type: ioa, ioaPreview ``` -------------------------------- ### Get API Key Source: https://context7_llms Retrieves the API key of the current user. ```APIDOC ## GET /llmstxt/developer_tenable_llms_txt/reference/get_api-api-key.md ### Description Get the API key of the current user. ### Method GET ### Endpoint /llmstxt/developer_tenable_llms_txt/reference/get_api-api-key.md ### Parameters None ### Request Example None ### Response #### Success Response (200) - **api_key** (string) - The user's API key. #### Response Example { "api_key": "your_api_key_here" } ### License Required license type: ioa, ioaPreview, ioe ``` -------------------------------- ### Execute Python Script Source: https://developer.tenable.com/docs/ot-get-started-with-pytenable-for-tenableot This command shows how to execute the Python script saved as `pytenable-tot-assets-BasicPull.py` using the python3 interpreter. ```text # python3 pytenable-tot-assets-BasicPull.py ``` -------------------------------- ### Get Asset Information API Source: https://context7_llms Returns information about the specified asset. ```APIDOC ## GET /llmstxt/developer_tenable_llms_txt/workbenches-asset-info/{asset_id} ### Description Returns information about the specified asset. ### Method GET ### Endpoint /llmstxt/developer_tenable_llms_txt/workbenches-asset-info/{asset_id} ### Parameters #### Path Parameters - **asset_id** (string) - Required - The unique identifier of the asset. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **asset_information** (object) - Detailed information about the asset. - **id** (string) - The unique identifier for the asset. - **ip_address** (string) - The IP address of the asset. - **hostname** (string) - The hostname of the asset. - **operating_system** (string) - The operating system of the asset. - **last_seen** (string) - The last time the asset was seen. #### Response Example ```json { "asset_information": { "id": "asset-789", "ip_address": "192.168.1.3", "hostname": "server.local", "operating_system": "Linux", "last_seen": "2023-10-27T10:00:00Z" } } ``` ``` -------------------------------- ### Install pyTenable Package Source: https://developer.tenable.com/docs/introduction-to-pytenable This command installs the pyTenable Python package using pip. Pip handles the installation of the package and its dependencies. It is the recommended method for installing pyTenable. ```shell pip install pytenable ``` -------------------------------- ### Get Asset Details Source: https://context7_llms Retrieves detailed information for a specific asset. ```APIDOC ## GET /assets/{asset_id} ### Description Returns details of the specified asset. ### Method GET ### Endpoint /assets/{asset_id} ### Parameters #### Path Parameters - **asset_id** (string) - Required - The unique identifier of the asset. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the asset. - **ip_address** (string) - The IP address of the asset. - **hostname** (string) - The hostname of the asset. - **operating_system** (string) - The operating system of the asset. - **first_seen** (string) - The date and time the asset was first seen. - **last_seen** (string) - The date and time the asset was last seen. - **tags** (array of objects) - Tags associated with the asset. #### Response Example { "id": "asset-123", "ip_address": "192.168.1.1", "hostname": "example.com", "operating_system": "Linux", "first_seen": "2023-01-01T10:00:00Z", "last_seen": "2023-10-27T15:30:00Z", "tags": [ { "id": "tag-abc", "name": "Production" } ] } ``` -------------------------------- ### Example Profile Configuration Response Source: https://developer.tenable.com/reference/agent-profiles-list An example JSON response illustrating a configured profile. This includes profile metadata like name, description, UUID, creation/update timestamps, and configuration details such as version, plugin set, and update status. ```json { "profiles": [ { "name": "US-1A Sensors", "description": "This profile targets sensors for US-1A.", "profile_uuid": "52cddf58-f10f-49f6-969f-d17f623171f5", "created": "2024-07-19T00:11:47.227483Z", "updated": "2024-07-19T00:11:47.227483Z", "config": { "version": "10.8.0", "pluginset": "202407172302", "update_disabled": true } } ] } ``` -------------------------------- ### Ruby Request Client Example Source: https://developer.tenable.com/reference/read-the-docs A basic Ruby client code sample for interacting with Tenable APIs. This snippet illustrates how to make an API request using Ruby's built-in Net::HTTP library or a popular gem like 'httparty'. ```Ruby require 'net/http' require 'uri' require 'json' uri = URI.parse('https://api.tenable.com/v1/some_resource') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri.request_uri) request['X-ApiKeys'] = 'accessKey=;secretKey=' request['Accept'] = 'application/json' response = http.request(request) if response.code == '200' puts "Success!" puts JSON.parse(response.body) else puts "Error: #{response.code}" puts response.body end ``` -------------------------------- ### Get User Inventories Source: https://context7_llms Retrieves a list of inventories accessible to the current user. ```APIDOC ## GET /inventories ### Description Gets a list of inventories for the current user. ### Method GET ### Endpoint /inventories ### Parameters This endpoint does not require any parameters. ### Request Body This endpoint does not require a request body. ### Response #### Success Response (200) - **inventories** (array of objects) - A list of inventories. - **id** (string) - The unique identifier of the inventory. - **name** (string) - The name of the inventory. #### Response Example { "inventories": [ { "id": "inventory-abc", "name": "Project Alpha Inventory" }, { "id": "inventory-xyz", "name": "Beta Testing Inventory" } ] } ```