Skip to content

Commit

Permalink
Merge pull request #202 from KennaSecurity/ishgaror-patch-3
Browse files Browse the repository at this point in the history
Update nvd_os_app_custom_field.py
  • Loading branch information
ishgaror authored Dec 5, 2023
2 parents 9ce0e4e + d9bc96e commit a701eb8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import json
import gzip
import io
import os
from collections import defaultdict
import sys

token_variable = 'API_KEY' # replace with your actual token

token_variable = os.environ.get('API_KEY')
base_url = "https://api.kennasecurity.com"

def request_data_export(token_variable):
Expand Down Expand Up @@ -70,6 +72,7 @@ def wait_for_data_export(search_id, token_variable, max_wait_time=1200, sleep_ti
time.sleep(sleep_time)

custom_field_id = 4 # replace with the custom field from your environmnet

def send_bulk_updates(ids, app_or_os, custom_field_id, token_variable):
url = f"{base_url}/vulnerabilities/bulk"
headers = {
Expand Down Expand Up @@ -255,4 +258,4 @@ def send_bulk_updates(ids, app_or_os, custom_field_id, token_variable):
send_bulk_updates(batch, custom_field_value, custom_field_id, token_variable)
time.sleep(0.2) # Add a delay of 0.2 seconds between each request
ids = ids[thresh_num:]


0 comments on commit a701eb8

Please sign in to comment.