Skip to content

Finding Vulnerable Libraries in Projects using Dependency-Track's API #3157

Answered by robdollard
robdollard asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the tips! Now everything works.
We enter the library and version, then check to see if it exists, check for duplication, and add everything to the Excel table, thank you!

import requests
import pandas as pd

dependency_track_url = "https://dependencytrack/api/v1"
api_key = "ig"

vulnerable_library_name = input("Enter the vulnerable library name: ")

vulnerable_library_version = input("Enter the vulnerable library version: ")

params = {
    "name": vulnerable_library_name,
    "version": vulnerable_library_version,
    "pageSize": 1000 
}

headers = {
    "X-Api-Key": api_key
}

seen_projects = set()

project_data = []

while True:
    response = requests.get(f"{dependency_trac…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@nscuro
Comment options

@robdollard
Comment options

Answer selected by robdollard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants