checkmarx

package
v1.11.1-0...-d84bc69 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	TokenType   string `json:"token_type"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

AuthToken - Structure to store OAuth2 token

type DetailedResult

type DetailedResult struct {
	XMLName                  xml.Name `xml:"CxXMLResults"`
	InitiatorName            string   `xml:"InitiatorName,attr"`
	ScanID                   string   `xml:"ScanId,attr"`
	Owner                    string   `xml:"Owner,attr"`
	ProjectID                string   `xml:"ProjectId,attr"`
	ProjectName              string   `xml:"ProjectName,attr"`
	TeamFullPathOnReportDate string   `xml:"TeamFullPathOnReportDate,attr"`
	DeepLink                 string   `xml:"DeepLink,attr"`
	ScanStart                string   `xml:"ScanStart,attr"`
	Preset                   string   `xml:"Preset,attr"`
	ScanTime                 string   `xml:"ScanTime,attr"`
	LinesOfCodeScanned       string   `xml:"LinesOfCodeScanned,attr"`
	FilesScanned             string   `xml:"FilesScanned,attr"`
	ReportCreationTime       string   `xml:"ReportCreationTime,attr"`
	Team                     string   `xml:"Team,attr"`
	CheckmarxVersion         string   `xml:"CheckmarxVersion,attr"`
	ScanType                 string   `xml:"ScanType,attr"`
	SourceOrigin             string   `xml:"SourceOrigin,attr"`
	Visibility               string   `xml:"Visibility,attr"`
	Queries                  []Query  `xml:"Query"`
}

DetailedResult - DetailedResult Structure

type Link struct {
	Rel string `json:"rel"`
	URI string `json:"uri"`
}

Link - Link Structure

type Links struct {
	Report Link `json:"report"`
	Status Link `json:"status"`
}

Links - Links Structure

type Preset

type Preset struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	OwnerName string `json:"ownerName"`
	Link      Link   `json:"link"`
}

Preset - Project's Preset

type Project

type Project struct {
	ID                 int                `json:"id"`
	TeamID             string             `json:"teamId"`
	Name               string             `json:"name"`
	IsPublic           bool               `json:"isPublic"`
	SourceSettingsLink SourceSettingsLink `json:"sourceSettingsLink"`
	Link               Link               `json:"link"`
}

Project - Project Structure

type ProjectCreateResult

type ProjectCreateResult struct {
	ID   int  `json:"id"`
	Link Link `json:"link"`
}

ProjectCreateResult - ProjectCreateResult Structure

type Query

type Query struct {
	XMLName xml.Name `xml:"Query"`
	Results []Result `xml:"Result"`
}

Query - Query Structure

type Report

type Report struct {
	ReportID int   `json:"reportId"`
	Links    Links `json:"links"`
}

Report - Report Structure

type ReportStatus

type ReportStatus struct {
	ID    int    `json:"id"`
	Value string `json:"value"`
}

ReportStatus - ReportStatus Structure

type ReportStatusResponse

type ReportStatusResponse struct {
	Location    string       `json:"location"`
	ContentType string       `json:"contentType"`
	Status      ReportStatus `json:"status"`
}

ReportStatusResponse - ReportStatusResponse Structure

type Result

type Result struct {
	XMLName       xml.Name `xml:"Result"`
	State         string   `xml:"state,attr"`
	Severity      string   `xml:"Severity,attr"`
	FalsePositive string   `xml:"FalsePositive,attr"`
}

Result - Result Structure

type ResultsStatistics

type ResultsStatistics struct {
	High   int `json:"highSeverity"`
	Medium int `json:"mediumSeverity"`
	Low    int `json:"lowSeverity"`
	Info   int `json:"infoSeverity"`
}

ResultsStatistics - ResultsStatistics Structure

type Scan

type Scan struct {
	ID   int  `json:"id"`
	Link Link `json:"link"`
}

Scan - Scan Structure

type ScanStatus

type ScanStatus struct {
	ID            int    `json:"id"`
	Link          Link   `json:"link"`
	Status        Status `json:"status"`
	ScanType      string `json:"scanType"`
	Comment       string `json:"comment"`
	IsIncremental bool   `json:"isIncremental"`
}

ScanStatus - ScanStatus Structure

type ScanStatusDetail

type ScanStatusDetail struct {
	Stage string `json:"stage"`
	Step  string `json:"step"`
}

ScanStatusDetail - ScanStatusDetail Structure

type SourceSettingsLink struct {
	Type string `json:"type"`
	Rel  string `json:"rel"`
	URI  string `json:"uri"`
}

SourceSettingsLink - SourceSettingsLink Structure

type Status

type Status struct {
	ID      int              `json:"id"`
	Name    string           `json:"name"`
	Details ScanStatusDetail `json:"details"`
}

Status - Status Structure

type System

type System interface {
	FilterPresetByName(presets []Preset, presetName string) Preset
	FilterPresetByID(presets []Preset, presetID int) Preset
	FilterProjectByName(projects []Project, projectName string) Project
	FilterTeamByName(teams []Team, teamName string) Team
	FilterTeamByID(teams []Team, teamID string) Team
	DownloadReport(reportID int) (bool, []byte)
	GetReportStatus(reportID int) ReportStatusResponse
	RequestNewReport(scanID int, reportType string) (bool, Report)
	GetResults(scanID int) ResultsStatistics
	GetScanStatusAndDetail(scanID int) (string, ScanStatusDetail)
	GetScans(projectID int) (bool, []ScanStatus)
	ScanProject(projectID int, isIncremental, isPublic, forceScan bool) (bool, Scan)
	UpdateProjectConfiguration(projectID int, presetID int, engineConfigurationID string) bool
	UpdateProjectExcludeSettings(projectID int, excludeFolders string, excludeFiles string) bool
	UploadProjectSourceCode(projectID int, zipFile string) bool
	CreateProject(projectName string, teamID string) (bool, ProjectCreateResult)
	CreateBranch(projectID int, branchName string) int
	GetPresets() []Preset
	GetProjectByID(projectID int) (bool, Project)
	GetProjectsByNameAndTeam(projectName, teamID string) []Project
	GetProjects() []Project
	GetTeams() []Team
}

System is the interface abstraction of a specific SystemIns

type SystemInstance

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

SystemInstance is the client communicating with the Checkmarx backend

func NewSystemInstance

func NewSystemInstance(client piperHttp.Uploader, serverURL, username, password string) (*SystemInstance, error)

NewSystemInstance returns a new Checkmarx client for communicating with the backend

func (*SystemInstance) CreateBranch

func (sys *SystemInstance) CreateBranch(projectID int, branchName string) int

CreateBranch creates a branch of an existing project in the Checkmarx backend

func (*SystemInstance) CreateProject

func (sys *SystemInstance) CreateProject(projectName string, teamID string) (bool, ProjectCreateResult)

CreateProject creates a new project in the Checkmarx backend

func (*SystemInstance) DownloadReport

func (sys *SystemInstance) DownloadReport(reportID int) (bool, []byte)

DownloadReport downloads the report addressed by reportID and returns the XML contents

func (*SystemInstance) FilterPresetByID

func (sys *SystemInstance) FilterPresetByID(presets []Preset, presetID int) Preset

FilterPresetByID filters a preset by its name

func (*SystemInstance) FilterPresetByName

func (sys *SystemInstance) FilterPresetByName(presets []Preset, presetName string) Preset

FilterPresetByName filters a preset by its name

func (*SystemInstance) FilterProjectByName

func (sys *SystemInstance) FilterProjectByName(projects []Project, projectName string) Project

FilterProjectByName filters a project by its name

func (*SystemInstance) FilterTeamByID

func (sys *SystemInstance) FilterTeamByID(teams []Team, teamID string) Team

FilterTeamByID filters a team by its ID

func (*SystemInstance) FilterTeamByName

func (sys *SystemInstance) FilterTeamByName(teams []Team, teamName string) Team

FilterTeamByName filters a team by its name

func (*SystemInstance) GetPresets

func (sys *SystemInstance) GetPresets() []Preset

GetPresets loads the preset values defined in the Checkmarx backend

func (*SystemInstance) GetProjectByID

func (sys *SystemInstance) GetProjectByID(projectID int) (bool, Project)

GetProjectByID returns the project addressed by projectID from the Checkmarx backend which the user has access to

func (*SystemInstance) GetProjects

func (sys *SystemInstance) GetProjects() []Project

GetProjects returns the projects defined in the Checkmarx backend which the user has access to

func (*SystemInstance) GetProjectsByNameAndTeam

func (sys *SystemInstance) GetProjectsByNameAndTeam(projectName, teamID string) []Project

GetProjectsByNameAndTeam returns the project addressed by projectID from the Checkmarx backend which the user has access to

func (*SystemInstance) GetReportStatus

func (sys *SystemInstance) GetReportStatus(reportID int) ReportStatusResponse

GetReportStatus returns the status of the report generation process

func (*SystemInstance) GetResults

func (sys *SystemInstance) GetResults(scanID int) ResultsStatistics

GetResults returns the results of the scan addressed by scanID

func (*SystemInstance) GetScanStatusAndDetail

func (sys *SystemInstance) GetScanStatusAndDetail(scanID int) (string, ScanStatusDetail)

GetScanStatusAndDetail returns the status of the scan addressed by scanID

func (*SystemInstance) GetScans

func (sys *SystemInstance) GetScans(projectID int) (bool, []ScanStatus)

GetScans returns all scan status on the project addressed by projectID

func (*SystemInstance) GetTeams

func (sys *SystemInstance) GetTeams() []Team

GetTeams returns the teams the user is assigned to

func (*SystemInstance) RequestNewReport

func (sys *SystemInstance) RequestNewReport(scanID int, reportType string) (bool, Report)

RequestNewReport triggers the generation of a report for a specific scan addressed by scanID

func (*SystemInstance) ScanProject

func (sys *SystemInstance) ScanProject(projectID int, isIncremental, isPublic, forceScan bool) (bool, Scan)

ScanProject triggers a scan on the project addressed by projectID

func (*SystemInstance) UpdateProjectConfiguration

func (sys *SystemInstance) UpdateProjectConfiguration(projectID int, presetID int, engineConfigurationID string) bool

UpdateProjectConfiguration updates the configuration of the project addressed by projectID

func (*SystemInstance) UpdateProjectExcludeSettings

func (sys *SystemInstance) UpdateProjectExcludeSettings(projectID int, excludeFolders string, excludeFiles string) bool

UpdateProjectExcludeSettings updates the exclude configuration of the project

func (*SystemInstance) UploadProjectSourceCode

func (sys *SystemInstance) UploadProjectSourceCode(projectID int, zipFile string) bool

UploadProjectSourceCode zips and uploads the project sources for scanning

type Team

type Team struct {
	ID       string `json:"id"`
	FullName string `json:"fullName"`
}

Team - Team Structure

Jump to

Keyboard shortcuts

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