Documentation
¶
Index ¶
- Constants
- Variables
- func IsRescanOnlyLabel(label string, isForkScan bool) bool
- type ActiveScanners
- type Agent
- type AgentSearchParams
- type Agents
- type AgentsResponse
- type Client
- func (c *Client) CreateNewScan(scan *Scan) (string, error)
- func (c *Client) CreateProduct(pd ProductDetail) (*Product, error)
- func (c *Client) CreateProject(pd ProjectDetail) (*Project, error)
- func (c *Client) CreateScanparams(pID string, sp ScanparamsDetail) (*Scanparams, error)
- func (c *Client) CreateTeam(teamName, responsible string) error
- func (c *Client) FindAgentByLabel(l string) (*Agent, error)
- func (c *Client) FindProductByName(name string) (*Product, error)
- func (c *Client) FindProjectByName(name string) (*Project, error)
- func (c *Client) FindScan(project string, params *ScanSearchParams) (*ScanDetail, error)
- func (c *Client) FindScanByID(id string) (*ScanDetail, error)
- func (c *Client) FindScanparams(project string, params *ScanparamSearchParams) (*Scanparams, error)
- func (c *Client) GetLastResults(id string) (map[string]*ResultSet, error)
- func (c *Client) GetProductDetail(id string) (*ProductDetail, error)
- func (c *Client) GetScanStatus(eventId string) (*Event, error)
- func (c *Client) HealthCheck() error
- func (c *Client) ImportSBOM(file string, repo string, form ImportForm) error
- func (c *Client) ImportScanResult(file string, form ImportForm) (string, error)
- func (c *Client) IsAvailable(project, almTool string) (bool, error)
- func (c *Client) IsValidTool(tool string) bool
- func (c *Client) ListActiveAgents(params *AgentSearchParams) (*AgentsResponse, error)
- func (c *Client) ListActiveScanners(params *ScannersSearchParams) (*ScannersResponse, error)
- func (c *Client) ListProducts(name string) ([]Product, error)
- func (c *Client) ListProjects(name, repo string) ([]Project, error)
- func (c *Client) ListScans(project string, params *ScanSearchParams) ([]ScanDetail, error)
- func (c *Client) Ping() error
- func (c *Client) ReleaseStatus(project string) (*ReleaseStatus, error)
- func (c *Client) RestartScanByScanID(id string) (string, error)
- func (c *Client) RestartScanWithOption(id string, opt *ScanPROptions) (string, error)
- func (c *Client) ScanByImage(pr *ImageScanParams) (string, error)
- func (c *Client) UpdateProduct(id string, pd ProductDetail) (*Product, error)
- type Custom
- type Event
- type ImageScanParams
- type ImportForm
- type IssueResponsible
- type KonduktoError
- type PRInfo
- type PlaybookTypeDetail
- type Product
- type ProductDetail
- type Project
- type ProjectDetail
- type ProjectLabel
- type ProjectSource
- type ProjectTeam
- type ReleaseStatus
- type ResultSet
- type Scan
- type ScanDetail
- type ScanPROptions
- type ScanSearchParams
- type ScannerCustomParams
- type ScannerInfo
- type ScannerParams
- type ScannersResponse
- type ScannersSearchParams
- type ScanparamResponse
- type ScanparamSearchParams
- type Scanparams
- type ScanparamsDetail
- type ScanparamsItem
- type Summary
- type Team
Constants ¶
const ( ScannerLabelKDT = "kdt" ScannerLabelBind = "bind" ScannerLabelAgent = "agent" ScannerLabelDocker = "docker" ScannerLabelImport = "import" ScannerLabelTemplate = "template" ScannerLabelCreatableOnTool = "creatable-on-tool" )
Variables ¶
var ( ProductNotFound = errors.New("product not found") ProjectNotFound = errors.New("project not found") )
Functions ¶
func IsRescanOnlyLabel ¶ added in v1.0.22
IsRescanOnlyLabel returns true if the given label is a rescan only label If fork scan is true, then the ScannerLabelTemplate label is not a rescan only label, it can be used for fork scan
Types ¶
type ActiveScanners ¶ added in v1.0.22
type ActiveScanners []ScannerInfo
func (ActiveScanners) First ¶ added in v1.0.22
func (s ActiveScanners) First() *ScannerInfo
First returns the first element in the list.
type AgentSearchParams ¶ added in v1.0.22
type AgentsResponse ¶ added in v1.0.22
type Client ¶
func (*Client) CreateNewScan ¶ added in v1.0.22
func (*Client) CreateProduct ¶ added in v1.0.22
func (c *Client) CreateProduct(pd ProductDetail) (*Product, error)
func (*Client) CreateProject ¶ added in v1.0.22
func (c *Client) CreateProject(pd ProjectDetail) (*Project, error)
func (*Client) CreateScanparams ¶ added in v1.0.22
func (c *Client) CreateScanparams(pID string, sp ScanparamsDetail) (*Scanparams, error)
func (*Client) CreateTeam ¶ added in v1.0.22
func (*Client) FindAgentByLabel ¶ added in v1.0.22
func (*Client) FindProductByName ¶ added in v1.0.22
func (*Client) FindProjectByName ¶ added in v1.0.22
func (*Client) FindScan ¶ added in v1.0.9
func (c *Client) FindScan(project string, params *ScanSearchParams) (*ScanDetail, error)
func (*Client) FindScanByID ¶ added in v1.0.22
func (c *Client) FindScanByID(id string) (*ScanDetail, error)
func (*Client) FindScanparams ¶ added in v1.0.22
func (c *Client) FindScanparams(project string, params *ScanparamSearchParams) (*Scanparams, error)
func (*Client) GetLastResults ¶ added in v1.0.9
func (*Client) GetProductDetail ¶ added in v1.0.22
func (c *Client) GetProductDetail(id string) (*ProductDetail, error)
func (*Client) HealthCheck ¶ added in v1.0.22
HealthCheck is a healthcheck for Kondukto service Requires a valid API token
func (*Client) ImportSBOM ¶ added in v1.0.22
func (c *Client) ImportSBOM(file string, repo string, form ImportForm) error
func (*Client) ImportScanResult ¶ added in v1.0.9
func (c *Client) ImportScanResult(file string, form ImportForm) (string, error)
func (*Client) IsAvailable ¶ added in v1.0.22
func (*Client) IsValidTool ¶ added in v1.0.22
IsValidTool returns true if the given tool name is a valid tool
func (*Client) ListActiveAgents ¶ added in v1.0.22
func (c *Client) ListActiveAgents(params *AgentSearchParams) (*AgentsResponse, error)
func (*Client) ListActiveScanners ¶ added in v1.0.22
func (c *Client) ListActiveScanners(params *ScannersSearchParams) (*ScannersResponse, error)
ListActiveScanners returns a list of active scanners
func (*Client) ListProducts ¶ added in v1.0.22
func (*Client) ListScans ¶
func (c *Client) ListScans(project string, params *ScanSearchParams) ([]ScanDetail, error)
func (*Client) Ping ¶ added in v1.0.22
Ping is a healthcheck for Kondukto service Does not require a valid API token
func (*Client) ReleaseStatus ¶ added in v1.0.9
func (c *Client) ReleaseStatus(project string) (*ReleaseStatus, error)
func (*Client) RestartScanByScanID ¶ added in v1.0.22
func (*Client) RestartScanWithOption ¶ added in v1.0.22
func (c *Client) RestartScanWithOption(id string, opt *ScanPROptions) (string, error)
func (*Client) ScanByImage ¶ added in v1.0.22
func (c *Client) ScanByImage(pr *ImageScanParams) (string, error)
func (*Client) UpdateProduct ¶ added in v1.0.22
func (c *Client) UpdateProduct(id string, pd ProductDetail) (*Product, error)
type ImageScanParams ¶ added in v1.0.22
type ImportForm ¶ added in v1.0.22
type IssueResponsible ¶ added in v1.0.22
type IssueResponsible struct {
Username string `json:"username"`
}
type KonduktoError ¶ added in v1.0.22
type KonduktoError struct {
Error string `json:"error"`
}
type PlaybookTypeDetail ¶ added in v1.0.22
type Product ¶ added in v1.0.22
type Product struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` ProjectsCount int `json:"projects_count"` Links struct { HTML string `json:"html"` } `json:"links"` }
func (*Product) FieldsAsRow ¶ added in v1.0.22
type ProductDetail ¶ added in v1.0.22
type ProductDetail struct { ID string `json:"id"` Name string `json:"name"` Projects []Project `json:"projects"` BusinessUnitTags []struct { ID string `json:"id"` Name string `json:"name"` Color string `json:"color"` IsActive int `json:"isActive"` Required bool `json:"required"` } `json:"business_unit_tags"` AccessibleFor struct { OwnerIDs []string `json:"owner_ids"` TeamIDs []string `json:"team_ids"` } `json:"accessible_for"` DefaultTeam struct { ID string `json:"id"` } `json:"default_team"` }
type Project ¶
type Project struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` DefaultBranch string `json:"default_branch"` Labels []ProjectLabel `json:"labels"` Team ProjectTeam `json:"team"` Links struct { HTML string `json:"html"` } `json:"links"` }
func (*Project) FieldsAsRow ¶ added in v1.0.22
func (*Project) LabelsAsString ¶ added in v1.0.22
type ProjectDetail ¶ added in v1.0.22
type ProjectDetail struct { Name string `json:"name"` Source ProjectSource `json:"source"` Team ProjectTeam `json:"team"` Labels []ProjectLabel `json:"labels"` Override bool `json:"override"` // That means, if the project already exists, create a new one with suffix "-" Overwrite bool `json:"overwrite"` // That means, if the project already exists, overwrite it }
type ProjectLabel ¶ added in v1.0.22
type ProjectSource ¶ added in v1.0.22
type ProjectTeam ¶ added in v1.0.22
type ReleaseStatus ¶ added in v1.0.9
type ReleaseStatus struct { Status string `json:"status" bson:"status"` SAST PlaybookTypeDetail `json:"sast" bson:"sast"` DAST PlaybookTypeDetail `json:"dast" bson:"dast"` PENTEST PlaybookTypeDetail `json:"pentest" bson:"pentest"` IAST PlaybookTypeDetail `json:"iast" bson:"iast"` SCA PlaybookTypeDetail `json:"sca" bson:"sca"` CS PlaybookTypeDetail `json:"cs" bson:"cs"` IAC PlaybookTypeDetail `json:"iac" bson:"iac"` }
type Scan ¶
type Scan struct { // ScanparamsID is holding identifier of scanparams, when given, it will override other fields ScanparamsID string `json:"scanparams_id,omitempty"` // Branch is holding current branch value of scan Branch string `json:"branch"` // Project is holding ID or Name value of project Project string `json:"project"` // ToolID is holding ID value of selected scanner ToolID string `json:"tool_id,omitempty"` // AgentID is holding ID value of selected agent AgentID string `json:"agent_id,omitempty"` // PR is holding detail of pull requests branches to be scanned PR PRInfo `json:"pr"` // Custom is holding custom type of scanners that specified on the Kondukto side Custom Custom `json:"custom"` // ForkScan is holding value of baseline scan ForkScan bool `json:"fork_scan"` // MetaData is holding value of scanparam meta-data MetaData string `json:"meta_data"` }
type ScanDetail ¶ added in v1.0.22
type ScanDetail struct { ID string `json:"id"` Name string `json:"name"` Branch string `json:"branch"` ScanType string `json:"scan_type"` MetaData string `json:"meta_data"` Tool string `json:"tool"` ScannerType string `json:"scanner_type"` Date *time.Time `json:"date"` Project string `json:"project"` Score int `json:"score"` Summary Summary `json:"summary"` Links struct { HTML string `json:"html"` } `json:"links"` }
type ScanPROptions ¶ added in v1.0.9
type ScanSearchParams ¶ added in v1.0.9
type ScannerCustomParams ¶ added in v1.0.22
type ScannerCustomParams struct { Examples string `json:"examples,omitempty"` Description string `json:"description"` Optional bool `json:"optional"` Type scannerCustomParamsType `json:"type"` }
ScannerCustomParams holds the details of a custom parameter
func (ScannerCustomParams) Parse ¶ added in v1.0.22
func (s ScannerCustomParams) Parse(k string) (interface{}, error)
Parse parses the given string into expected type
type ScannerInfo ¶ added in v1.0.22
type ScannerInfo struct { ID string `json:"id"` Type string `json:"type"` Slug string `json:"slug"` DisplayName string `json:"display_name"` Labels []string `json:"labels"` CustomType int `json:"custom_type"` Disabled bool `json:"disabled"` Params ScannerParams `json:"params"` }
func (ScannerInfo) HasLabel ¶ added in v1.0.22
func (s ScannerInfo) HasLabel(l string) bool
HasLabel returns true if the given label is present in the receiver's labels
type ScannerParams ¶ added in v1.0.22
type ScannerParams map[string]ScannerCustomParams
ScannerParams holds the custom parameters for a scanner
func (ScannerParams) Find ¶ added in v1.0.22
func (s ScannerParams) Find(k string) *ScannerCustomParams
Find returns the given key detail when present, otherwise nil.
func (ScannerParams) RequiredParamsLen ¶ added in v1.0.22
func (s ScannerParams) RequiredParamsLen() int
RequiredParamsLen returns the required params length.
type ScannersResponse ¶ added in v1.0.22
type ScannersResponse struct { ActiveScanners ActiveScanners `json:"active_scanners"` Total int `json:"total"` }
type ScannersSearchParams ¶ added in v1.0.22
type ScanparamResponse ¶ added in v1.0.22
type ScanparamResponse struct { Scanparams []Scanparams `json:"scanparams"` Limit int `json:"limit"` Start int `json:"start"` Total int `json:"total"` }
type ScanparamSearchParams ¶ added in v1.0.22
type Scanparams ¶ added in v1.0.22
type ScanparamsDetail ¶ added in v1.0.22
type ScanparamsDetail struct { Tool *ScanparamsItem `json:"tool"` Project *ScanparamsItem `json:"project"` Agent *ScanparamsItem `json:"agent"` BindName string `json:"bind_name"` Branch string `json:"branch"` ScanType string `json:"scan_type"` MetaData string `json:"meta_data"` ForkScan bool `json:"fork_scan"` PR PRInfo `json:"pr"` Manual bool `json:"manual"` Custom *Custom `json:"custom"` }
type ScanparamsItem ¶ added in v1.0.22
type ScanparamsItem struct {
ID string `json:"id,omitempty"`
}
type Team ¶ added in v1.0.22
type Team struct { Name string `json:"name"` IssueResponsible IssueResponsible `json:"issue_responsible"` }