scan

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 27 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"
)

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
}

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