See clients and api wrappers in the docs for alternatives
A Python API wrapper for DefectDojo, an AppSec and Security Vulnerability Management tool.
This package implements API functionality available within Dojo.
Several quick start options are available:
- Clone the repository:
git clone https://github.com/DefectDojo/defectdojo_api - Install with pip (not recommended):
pip install git+https://github.com/DefectDojo/defectdojo_api#master - If you are testing the api locally make sure to set the PYTHONPATH. export PYTHONPATH=/path/totheapi/defectdojo_api:$PYTHONPATH
# import the packagefromdefectdojo_apiimportdefectdojo# setup DefectDojo connection informationhost='http://localhost:8000/'api_key='your_api_key_from_DefectDojo'user='admin'# instantiate the DefectDojo api wrapperdd=defectdojo.DefectDojoAPI(host, api_key, user, debug=False)
# If you need to disable certificate verification, set verify_ssl to False.# dd = defectdojo.DefectDojoAPI(host, api_key, user, verify_ssl=False)# Create a productprod_type=1#1 - Research and Development, product typeproduct=dd.create_product("API Product Test", "This is a detailed product description.", prod_type)
ifproduct.success:
# Get the product idproduct_id=product.id()
print"Product successfully created with an id: "+str(product_id)
#List Productsproducts=dd.list_products()
ifproducts.success:
print(products.data_json(pretty=True)) # Decoded JSON objectforproductinproducts.data["objects"]:
print(product['name']) # Print the name of each productelse:
printproducts.messageMore examples available on Github.
Supporting information for each method available can be found in the documentation.
Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.