defectdojo

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package defectdojo handles exporting reports to Defect Dojo open source software

Index

Constants

This section is empty.

Variables

View Source
var ErrAPI = errors.New("defect dojo api request error")

ErrAPI an error in the request

Functions

This section is empty.

Types

type EngagementQuery

type EngagementQuery struct {
	ProductTypeName            string
	ProductName                string
	Name                       string
	Duration                   time.Duration
	BranchTag                  string
	SourceURL                  string
	CommitHash                 string
	Tags                       []string
	DeduplicationOnEngagement  bool
	EnableSimpleRiskAcceptance bool
}

EngagementQuery data model for request

type ScanType

type ScanType string

ScanType Defect Dojo specific scan type values Source for Scan Type Values https://demo.defectdojo.org/api/v2/doc/

const (
	Grype     ScanType = "Anchore Grype"
	CycloneDX ScanType = "CycloneDX Scan"
	Semgrep   ScanType = "Semgrep JSON Report"
	Gitleaks  ScanType = "Gitleaks Scan"
)
{
	"id": 54,
	"name": "CycloneDX Scan",
	"static_tool": false,
	"dynamic_tool": false,
	"active": true
  },

type Service

type Service struct {
	Retry               int       // How many times to retry on a failed export
	DescriptionTime     time.Time // The time zone used when auto generating the description
	DescriptionTimezone string
	BackoffDuration     time.Duration // The interval for the exponential back off retry

	CloseOldFindings                  bool
	CloseOldFindingsProductScope      bool
	CreateFindingGroupsForAllFindings bool
	ImportScanActive                  bool
	ImportScanVerified                bool
	GroupBy                           string
	// contains filtered or unexported fields
}

Service can be used to export scans to Defect Dojo

func NewService

func NewService(client *http.Client, key string, url string, closeOldFindings bool, closeOldFindingsProductScope bool, createFindingGroupsForAllFindings bool, importScanActive bool, importScanVerified bool, groupBy string) Service

NewService customize fields for each future query

func (Service) Export

func (s Service) Export(ctx context.Context, r io.Reader, e EngagementQuery, scanType ScanType) error

Export execute export request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL