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) CreateLabel(label Label) error
- 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 string, issueResponsible IssueResponsible) 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) (*ScannerInfo, bool)
- func (c *Client) ListActiveAgents(params *AgentSearchParams) (*AgentsResponse, error)
- func (c *Client) ListActiveScanners(input *ListActiveScannersInput) (*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, branch string, opts ...ReleaseStatusOpts) (*ReleaseStatus, error)
- func (c *Client) RestartScanByScanID(id string) (string, error)
- func (c *Client) RestartScanWithOption(id string, opt *ScanRestartOptions) (string, error)
- func (c *Client) ScanByImage(pr *ScanByImageInput) (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 Label
- type ListActiveScannersInput
- type PRInfo
- type PathScope
- type PlaybookTypeDetail
- type Product
- type ProductDetail
- type Project
- type ProjectDetail
- type ProjectLabel
- type ProjectSource
- type ProjectTeam
- type ReleaseStatus
- type ReleaseStatusOpts
- type ResultSet
- type Scan
- type ScanByImageInput
- type ScanDetail
- type ScanRestartOptions
- type ScanSearchParams
- type ScannerCustomParams
- type ScannerInfo
- type ScannerParams
- type ScannerType
- 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" )
const ReleaseStatusHistoryInprogress = "in_progress"
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) CreateLabel ¶ added in v1.0.29
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 (c *Client) CreateTeam(teamName string, issueResponsible IssueResponsible) error
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
func (c *Client) IsValidTool(tool string) (*ScannerInfo, bool)
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(input *ListActiveScannersInput) (*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, branch string, opts ...ReleaseStatusOpts) (*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 *ScanRestartOptions) (string, error)
func (*Client) ScanByImage ¶ added in v1.0.22
func (c *Client) ScanByImage(pr *ScanByImageInput) (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 KonduktoError ¶ added in v1.0.22
type KonduktoError struct {
Error string `json:"error"`
}
type ListActiveScannersInput ¶ added in v1.0.33
type ListActiveScannersInput struct { Types []ScannerType Labels string Name string Limit int }
type PRInfo ¶ added in v1.0.22
type PRInfo struct { // OK means that the merge target is a valid branch to merge the source branch changes into. OK bool `json:"ok" json:"ok"` MergeTarget string `json:"target" bson:"target" valid:"Branch"` PRNumber string `json:"pr_number"` NoDecoration bool `json:"no_decoration"` PRDecorationScannerTypes string `json:"pr_decoration_scanner_types"` }
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 // ForkSourceBranch holds the name of the branch to be used as the source for the fork scan. // It is only used for [feature] environment ForkSourceBranch string `json:"fork_source_branch"` // FeatureBranchRetention holds the number of days to delete the feature branch after the latest scan. FeatureBranchRetention uint `json:"feature_branch_retention"` // FeatureBranchInfiniteRetention holds a value that disables the feature branch retention period. FeatureBranchInfiniteRetention bool `json:"feature_branch_no_retention"` DefaultBranch string `json:"default_branch"` CriticalityLevel int `json:"criticality_level"` }
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 { ProgressStatus string `json:"progress_status"` Status string `json:"status"` SAST PlaybookTypeDetail `json:"sast"` DAST PlaybookTypeDetail `json:"dast"` PENTEST PlaybookTypeDetail `json:"pentest"` IAST PlaybookTypeDetail `json:"iast"` SCA PlaybookTypeDetail `json:"sca"` CS PlaybookTypeDetail `json:"cs"` IAC PlaybookTypeDetail `json:"iac"` MAST PlaybookTypeDetail `json:"mast"` INFRA PlaybookTypeDetail `json:"infra"` }
type ReleaseStatusOpts ¶ added in v1.0.35
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"` // MetaData is holding value of scanparam meta-data MetaData string `json:"meta_data"` // ForkScan is holding value of baseline scan ForkScan bool `json:"fork_scan"` // ForkSourceBranch is holding value of baseline scan branch ForkSourceBranch string `json:"fork_source_branch"` // OverrideForkSourceBranch is holding value of baseline scan branch OverrideForkSourceBranch bool `json:"override_fork_source_branch"` // Environment is holding value of application environment Environment string `json:"environment"` }
type ScanByImageInput ¶ added in v1.0.33
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"` InfraSourceProjectID string `json:"infra_source_project_id"` Links struct { HTML string `json:"html"` } `json:"links"` }
type ScanRestartOptions ¶ added in v1.0.38
type ScanRestartOptions struct { // MergeSourceBranch is source branch of the PR. It is required when PR is true MergeSourceBranch string `json:"from"` // MergeTargetBranch is target branch of the PR. It is required when PR is true MergeTargetBranch string `json:"to"` OverrideOldAnalyze bool `json:"override_old_analyze"` PRNumber string `json:"pr_number"` NoDecoration bool `json:"no_decoration"` PRDecorationScannerTypes string `json:"pr_decoration_scanner_types"` Custom Custom `json:"custom"` Environment string `url:"environment"` }
type ScanSearchParams ¶ added in v1.0.9
type ScanSearchParams struct { Branch string `url:"branch,omitempty"` Tool string `url:"tool,omitempty"` MetaData string `url:"meta_data"` PR bool `url:"pr"` Manual bool `url:"manual"` AgentID string `url:"agent_id"` Environment string `url:"environment"` ForkScan bool `url:"fork_scan"` ForkSourceBranch string `url:"fork_source_branch"` Limit int `url:"limit,omitempty"` }
type ScannerCustomParams ¶ added in v1.0.22
type ScannerCustomParams struct { Examples string `json:"examples,omitempty"` Description string `json:"description"` DefaultValue string `json:"default_value"` 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 ScannerType ¶ added in v1.0.33
type ScannerType string
const ( ScannerTypeSAST ScannerType = "sast" ScannerTypeDAST ScannerType = "dast" ScannerTypeSCA ScannerType = "sca" ScannerTypeCS ScannerType = "cs" ScannerTypeIAC ScannerType = "iac" ScannerTypeIAST ScannerType = "iast" ScannerTypeCSPM ScannerType = "cspm" ScannerTypeMAST ScannerType = "mast" ScannerTypeINFRA ScannerType = "infra" )
func ScannerTypes ¶ added in v1.0.33
func ScannerTypes() []ScannerType
func (ScannerType) String ¶ added in v1.0.33
func (s ScannerType) String() string
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 ScanparamSearchParams struct { ToolID string `url:"tool_id"` Branch string `url:"branch"` Limit int `url:"limit"` MetaData string `url:"meta_data"` Target string `url:"target"` Manual bool `url:"manual"` Agent string `url:"agent"` Environment string `url:"environment"` ForkScan bool `url:"fork_scan"` ForkSourceBranch string `url:"fork_source_branch"` PR bool `url:"pr"` }
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"` Environment string `json:"environment"` }
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"` }