dodjo

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

README

DISCLAIMER

This is a very basic implementation of DefectDodjo OAuth API client for our internal needs.

This library will be updated if the need arises.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

type Engagement

type Engagement struct {
	*Client
	Id                         int       `json:"id,omitempty"`
	Tags                       []string  `json:"tags,omitempty"`
	Name                       string    `json:"name"`
	Description                string    `json:"description,omitempty"`
	Version                    string    `json:"version,omitempty"`
	FirstContacted             string    `json:"first_contacted,omitempty"`
	TargetStart                string    `json:"target_start"`
	TargetEnd                  string    `json:"target_end"`
	Reason                     string    `json:"reason,omitempty"`
	Updated                    time.Time `json:"updated,omitempty"`
	Created                    time.Time `json:"created"`
	Active                     bool      `json:"active,omitempty"`
	Tracker                    string    `json:"tracker,omitempty"`
	TestStrategy               string    `json:"test_strategy,omitempty"`
	ThreatModel                bool      `json:"threat_model,omitempty"`
	ApiTest                    bool      `json:"api_test,omitempty"`
	PenTest                    bool      `json:"pen_test,omitempty"`
	CheckList                  bool      `json:"check_list,omitempty"`
	Status                     string    `json:"status,omitempty"`
	Progress                   string    `json:"progress,omitempty"`
	TmodelPath                 string    `json:"tmodel_path,omitempty"`
	DoneTesting                bool      `json:"done_testing,omitempty"`
	EngagementType             string    `json:"engagement_type,omitempty"`
	BuildId                    string    `json:"build_id,omitempty"`
	CommitHash                 string    `json:"commit_hash,omitempty"`
	BranchTag                  string    `json:"branch_tag,omitempty"`
	SourceCodeManagementUri    string    `json:"source_code_management_uri,omitempty"`
	DeduplicationOnEngagement  bool      `json:"deduplication_on_engagement"`
	Lead                       int       `json:"lead,omitempty"`
	Requester                  string    `json:"requester,omitempty"`
	Preset                     string    `json:"preset,omitempty"`
	ReportType                 string    `json:"report_type,omitempty"`
	Product                    int       `json:"product"`
	BuildServer                string    `json:"build_server,omitempty"`
	SourceCodeManagementServer string    `json:"source_code_management_server,omitempty"`
	OrchestrationEngine        string    `json:"orchestration_engine,omitempty"`
	Notes                      []string  `json:"notes,omitempty"`
	Files                      []string  `json:"files,omitempty"`
	RiskAcceptance             []string  `json:"risk_acceptance,omitempty"`
}

func (*Engagement) ImportSecretDetectionReport

func (engagement *Engagement) ImportSecretDetectionReport(filename string) error

type Engagements

type Engagements struct {
	Count    int          `json:"count"`
	Next     interface{}  `json:"next,omitempty"`
	Previous interface{}  `json:"previous,omitempty"`
	Results  []Engagement `json:"results"`
}

type FileImport

type FileImport struct {
	ScanDate         string      `json:"scan_date"`
	MinimumSeverity  string      `json:"minimum_severity"`
	Active           bool        `json:"active"`
	Verified         bool        `json:"verified"`
	ScanType         string      `json:"scan_type"`
	EndpointToAdd    interface{} `json:"endpoint_to_add,omitempty"`
	File             interface{} `json:"file,omitempty"`
	Engagement       int         `json:"engagement"`
	Lead             interface{} `json:"lead,omitempty"`
	CloseOldFindings bool        `json:"close_old_findings"`
	PushToJira       bool        `json:"push_to_jira"`
	SonarqubeConfig  interface{} `json:"sonarqube_config,omitempty"`
	Test             int         `json:"test"`
}

type Product

type Product struct {
	*Client
	Id            int      `json:"id,omitempty"`
	FindingsCount int      `json:"findings_count,omitempty"`
	FindingsList  []int    `json:"findings_list,omitempty"`
	Tags          []string `json:"tags"`
	ProductMeta   []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"product_meta,omitempty"`
	Name                       string    `json:"name"`
	Description                string    `json:"description"`
	Created                    time.Time `json:"created"`
	ProdNumericGrade           int       `json:"prod_numeric_grade"`
	BusinessCriticality        string    `json:"business_criticality"`
	Platform                   string    `json:"platform"`
	Lifecycle                  string    `json:"lifecycle"`
	Origin                     string    `json:"origin"`
	UserRecords                int64     `json:"user_records"`
	Revenue                    string    `json:"revenue"`
	ExternalAudience           bool      `json:"external_audience"`
	InternetAccessible         bool      `json:"internet_accessible"`
	EnableSimpleRiskAcceptance bool      `json:"enable_simple_risk_acceptance"`
	EnableFullRiskAcceptance   bool      `json:"enable_full_risk_acceptance"`
	ProductManager             int       `json:"product_manager,omitempty"`
	TechnicalContact           int       `json:"technical_contact,omitempty"`
	TeamManager                int       `json:"team_manager,omitempty"`
	ProdType                   int       `json:"prod_type"`
	Members                    []int     `json:"members,omitempty"`
	AuthorizationGroups        []int     `json:"authorization_groups,omitempty"`
	Regulations                []int     `json:"regulations,omitempty"`
}

func (*Product) AddEngagement

func (product *Product) AddEngagement(name, description string, startTime, endTime *time.Time) (*Engagement, error)

func (*Product) GetEngagements

func (product *Product) GetEngagements() []*Engagement

type Products

type Products struct {
	Count    int       `json:"count"`
	Next     string    `json:"next"`
	Previous string    `json:"previous"`
	Results  []Product `json:"results"`
}

type Service

type Service struct {
	Client
}

func New

func New(apiUrl, apiToken string) *Service

func (*Service) AddProduct

func (service *Service) AddProduct(name, description string, productType int) *Product

func (*Service) GetProduct

func (service *Service) GetProduct(pid int) *Product

func (*Service) GetProductByName

func (service *Service) GetProductByName(prodName string) []*Product

func (*Service) GetProductByNameOne

func (service *Service) GetProductByNameOne(prodName string) *Product

func (*Service) GetProducts

func (service *Service) GetProducts() []*Product

Jump to

Keyboard shortcuts

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