crawlers

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerHubOrgsParam         = "DOCKERHUB_ORGS"
	DockerHubTokenSecretEnvVar = "DOCKERHUB_TOKEN"
)
View Source
const (
	GitHubTokenSecretEnvVar = "GITHUB_TOKEN"
	GitHubAppID             = "GITHUB_APP_ID"
	GitHubAppPrivateKey     = "GITHUB_APP_PRIVATE_KEY"
)
View Source
const (
	GitHubOrgsParamName      = "GITHUB_ORGS"
	GitHubSkipForksParamName = "SKIP_FORKS"
)
View Source
const (
	GitLabGroupsParamName          = "GITLAB_GROUPS"
	GitlabInstanceURLParamName     = "GITLAB_INSTANCE_URL"
	GitlabIncludeSubgroupParamName = "INCLUDE_SUBGROUPS"
)
View Source
const (
	GitlabTokenSecretEnvVar = "GITLAB_TOKEN"
)
View Source
const (
	RecentTagLimitParam = "RECENT_TAG_LIMIT"
)
View Source
const (
	StaticTargetIdentifierList = "TARGET_IDENTIFIERS"
)

Variables

View Source
var All = make(all)
View Source
var Dockerhub = Crawler{
	Name: "dockerhub",
	Parameters: []v1beta1.ParameterDefinition{
		{
			Name:        DockerHubOrgsParam,
			Description: "Comma-separated list of Docker Hub organizations to crawl.",
		},
		{
			Name: RecentTagLimitParam,
			Description: "Maximum number of tags (versions) to retrieve per image. " +
				"Will retrieve the latest N tags for each docker hub image and start a new pipeline for each. " +
				"Set to 0 to retrieve all versions. Defaults to 1.",
			Default: ptr.To("1"),
		},
	},
	EnvironmentSecrets: []definitions.EnvironmentSecret{
		{
			SecretKey:  "dockerhub-token",
			EnvVarName: DockerHubTokenSecretEnvVar,
		},
	},
	Crawl: crawlDockerhub,
}
View Source
var ECR = Crawler{
	Name:        "ecr",
	FileSecrets: aws.FileSecrets,
	Parameters: append(aws.Parameters, v1beta1.ParameterDefinition{
		Name: RecentTagLimitParam,
		Description: "Maximum number of tags (versions) to retrieve per image. " +
			"Will retrieve the latest N tags for each ECR image and start a new pipeline for each. " +
			"Set to 0 to retrieve all versions. Defaults to 1.",
		Default: ptr.To("1"),
	}),
	Crawl: crawlECR,
}
View Source
var GHCR = Crawler{
	Name: "ghcr",
	Parameters: []v1beta1.ParameterDefinition{
		{
			Name:        GitHubOrgsParamName,
			Description: "Comma-separated list of Docker Hub organizations to crawl.",
		},
		{
			Name: RecentTagLimitParam,
			Description: "Maximum number of tags (versions) to retrieve per image. " +
				"Will retrieve the latest N tags for each GHCR image and start a new pipeline for each. " +
				"Set to 0 to retrieve all versions. Defaults to 1.",
			Default: ptr.To("1"),
		},
	},
	EnvironmentSecrets: githubAuthenticationEnvironmentSecrets,
	Crawl:              crawlGHCR,
}
View Source
var GitHub = Crawler{
	Name:               "github",
	EnvironmentSecrets: githubAuthenticationEnvironmentSecrets,
	Parameters: []v1beta1.ParameterDefinition{
		{
			Name:        GitHubOrgsParamName,
			Description: "Comma-separated list of GitLab groups to crawl.",
		},
		{
			Name:        GitHubSkipForksParamName,
			Description: "If set to anything but '0' or 'false', forked repositories will be skipped.",
			Default:     ptr.To("false"),
		},
	},
	Crawl: crawlGitHub,
}
View Source
var GitLab = Crawler{
	Name: "gitlab",
	EnvironmentSecrets: []definitions.EnvironmentSecret{
		{
			SecretKey:  "gitlab-token",
			EnvVarName: GitlabTokenSecretEnvVar,
		},
	},
	Parameters: []v1beta1.ParameterDefinition{
		{
			Name:        GitLabGroupsParamName,
			Description: "Comma-separated list of GitLab groups to crawl. If empty, the entire instance will be crawled.",
		},
		{
			Name:        GitlabInstanceURLParamName,
			Description: "The base URL of the GitLab instance to crawl. For GitLab.com, use https://gitlab.com/api/v4",
		},
		{
			Name:        GitlabIncludeSubgroupParamName,
			Description: "If set, include projects from subgroups of the specified groups.",
		},
	},
	Crawl: crawlGitLab,
}
View Source
var StaticList = Crawler{
	Name: "static-list",
	Parameters: []v1beta1.ParameterDefinition{
		{
			Name:        StaticTargetIdentifierList,
			Description: "New line separated list of target identifiers to crawl.",
		},
	},
	Crawl: crawlStaticList,
}

Functions

func GenerateObjects added in v0.1.2

func GenerateObjects(image, secretName string) []*v1beta1.ClusterCrawler

Types

type Crawler

type Crawler struct {
	Name                 string
	Parameters           []v1beta1.ParameterDefinition
	Crawl                func(ctx context.Context, params map[string]string, queue chan v1beta1.Target) error
	EnvironmentSecrets   []definitions.EnvironmentSecret
	FileSecrets          []definitions.FileSecret
	EnviornmentVariables []corev1.EnvVar
}

type GHCRPackageIndexer added in v0.1.7

type GHCRPackageIndexer interface {
	ListPackages(
		context.Context, string, *github.PackageListOptions,
	) ([]*github.Package, *github.Response, error)
	PackageGetAllVersions(
		context.Context, string, string, string, *github.PackageListOptions,
	) ([]*github.PackageVersion, *github.Response, error)
}

Jump to

Keyboard shortcuts

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