Help us shape the future of Go! Take the 2026 Go Developer Survey

scan

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadEnvArtifact

func DownloadEnvArtifact(cookieVal string, gitlabUrl string, prjectPath string, jobId int) []byte

.env artifacts are not accessible over the API thus we must use session cookie and use the UI path

func GetQueueStatus

func GetQueueStatus() int

func ScanGitLabPipelines

func ScanGitLabPipelines(options *ScanOptions)

Types

type QueueItem

type QueueItem struct {
	Type        QueueItemType `json:"type"`
	ScanOptions *ScanOptions  `json:"scanOptions"`
	Meta        QueueMeta     `json:"meta"`
}

type QueueItemType

type QueueItemType string
const (
	QueueItemJobTrace QueueItemType = "jobTrace"
	QueueItemArtifact QueueItemType = "artifact"
	QueueItemDotenv   QueueItemType = "dotenv"
	QueueItemCICDYaml QueueItemType = "cicdYaml"
)

type QueueMeta

type QueueMeta struct {
	ProjectId                int
	JobId                    int
	JobWebUrl                string
	JobName                  string
	ProjectPathWithNamespace string
	ArtifactSize             int64
}

type ScanOptions

type ScanOptions struct {
	GitlabUrl              string
	GitlabApiToken         string
	GitlabCookie           string
	ProjectSearchQuery     string
	Artifacts              bool
	Owned                  bool
	Member                 bool
	Repository             string
	Namespace              string
	JobLimit               int
	ConfidenceFilter       []string
	MaxArtifactSize        int64
	MaxScanGoRoutines      int
	QueueFolder            string
	TruffleHogVerification bool
	HitTimeout             time.Duration
	// CICDYamlOnly restricts scanning to the project's merged CI/CD YAML, skipping job logs and artifacts.
	CICDYamlOnly bool
}

func InitializeOptions

func InitializeOptions(gitlabUrl, gitlabApiToken, gitlabCookie, projectSearchQuery, repository, namespace, queueFolder, maxArtifactSizeStr string,
	artifacts, owned, member, truffleHogVerification bool,
	jobLimit, maxScanGoRoutines int, confidenceFilter []string, hitTimeout time.Duration) (*ScanOptions, error)

InitializeOptions prepares scan options from CLI parameters.

type Scanner

type Scanner interface {
	scanner.BaseScanner
	GetQueueStatus() int
}

func NewScanner

func NewScanner(opts *ScanOptions) Scanner

Jump to

Keyboard shortcuts

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