Documentation
¶
Overview ¶
Package tunnel provides primitives for working with Tunnel.
Index ¶
- Constants
- func CheckAwsEcrPrivateRegistry(ImageUrl string) string
- func ConfigWorkloadAnnotationEnvVars(workload client.Object, annotation string, envVarName string, ...) corev1.EnvVar
- func GetCvssV3(findingCvss types.VendorCVSS) map[string]*CVSS
- func GetMirroredImage(image string, mirrors map[string]string) (string, error)
- func GetScoreFromCVSS(CVSSs map[string]*CVSS) *float64
- func MultiSecretSupport(c Config) bool
- func NewPlugin(clock ext.Clock, idGenerator ext.IDGenerator, ...) vulnerabilityreport.Plugin
- func NewTunnelConfigAuditPlugin(clock ext.Clock, idGenerator ext.IDGenerator, ...) configauditreport.PluginInMemory
- func Scanners(c Config) string
- func SkipDBUpdate(c Config) string
- func SkipJavaDBUpdate(c Config) string
- func Slow(c Config) string
- type AdditionalFields
- type CVSS
- type Command
- type Config
- func (c Config) FindIgnorePolicyKey(workload client.Object) string
- func (c Config) GenerateIgnoreFileVolumeIfAvailable(tunnelConfigName string) (*corev1.Volume, *corev1.VolumeMount)
- func (c Config) GenerateIgnorePolicyVolumeIfAvailable(tunnelConfigName string, workload client.Object) (*corev1.Volume, *corev1.VolumeMount)
- func (c Config) GenerateSslCertDirVolumeIfAvailable(tunnelConfigName string) (*corev1.Volume, *corev1.VolumeMount)
- func (c Config) GetAdditionalVulnerabilityReportFields() AdditionalFields
- func (c Config) GetClientServerSkipUpdate() bool
- func (c Config) GetCommand() (Command, error)
- func (c Config) GetDBRepository() (string, error)
- func (c Config) GetDBRepositoryInsecure() bool
- func (c Config) GetImagePullSecret() []corev1.LocalObjectReference
- func (c Config) GetImageRef() (string, error)
- func (c Config) GetImageTag() (string, error)
- func (c Config) GetInsecureRegistries() map[string]bool
- func (c Config) GetMirrors() map[string]string
- func (c Config) GetMode() (Mode, error)
- func (c Config) GetNonSSLRegistries() map[string]bool
- func (c Config) GetResourceRequirements() (corev1.ResourceRequirements, error)
- func (c Config) GetServerInsecure() bool
- func (c Config) GetServerURL() (string, error)
- func (c Config) GetSeverity() string
- func (c Config) GetSkipJavaDBUpdate() bool
- func (c Config) GetSlow() bool
- func (c Config) GetSslCertDir() string
- func (c Config) GetSupportedConfigAuditKinds() []string
- func (c Config) GetUseBuiltinRegoPolicies() bool
- func (c Config) GetVulnType() string
- func (c Config) IgnoreFileExists() bool
- func (c Config) IgnoreUnfixed() bool
- func (c Config) OfflineScan() bool
- type Mode
Constants ¶
const ( AWSECR_Image_Regex = "^\\d+\\.dkr\\.ecr\\.(\\w+-\\w+-\\d+)\\.amazonaws\\.com\\/" SupportedConfigAuditKinds = "Workload,Service,Role,ClusterRole,NetworkPolicy,Ingress,LimitRange,ResourceQuota" // SkipDirsAnnotation annotation example: tunnel-operator.khulnasoft.github.io/skip-dirs: "/tmp,/home" SkipDirsAnnotation = "tunnel-operator.khulnasoft.github.io/skip-dirs" // SkipFilesAnnotation example: tunnel-operator.khulnasoft.github.io/skip-files: "/src/Gemfile.lock,/examplebinary" SkipFilesAnnotation = "tunnel-operator.khulnasoft.github.io/skip-files" )
const ( DefaultImageRepository = "ghcr.io/aquasecurity/trivy" DefaultDBRepository = "ghcr.io/khulnasoft-lab/tunnel-db" DefaultJavaDBRepository = "ghcr.io/aquasecurity/trivy-java-db" DefaultSeverity = "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL" )
const ( SslCertDir = "/var/ssl-cert" )
const (
KeyTunnelSeverity = "tunnel.severity"
)
const (
// Plugin the name of this plugin.
Plugin = "Tunnel"
)
Variables ¶
This section is empty.
Functions ¶
func GetMirroredImage ¶
func GetScoreFromCVSS ¶
func MultiSecretSupport ¶
MultiSecretSupport validate if tunnel multi secret support
func NewPlugin ¶
func NewPlugin(clock ext.Clock, idGenerator ext.IDGenerator, objectResolver *kube.ObjectResolver) vulnerabilityreport.Plugin
NewPlugin constructs a new vulnerabilityreport.Plugin, which is using an upstream Tunnel container image to scan Kubernetes workloads.
The plugin supports Image and Filesystem commands. The Filesystem command may be used to scan workload images cached on cluster nodes by scheduling scan jobs on a particular node.
The Image command supports both Standalone and ClientServer modes depending on the settings returned by Config.GetMode. The ClientServer mode is usually more performant, however it requires a Tunnel server accessible at the configurable Config.GetServerURL.
func NewTunnelConfigAuditPlugin ¶
func NewTunnelConfigAuditPlugin(clock ext.Clock, idGenerator ext.IDGenerator, objectResolver *kube.ObjectResolver) configauditreport.PluginInMemory
NewTunnelConfigAuditPlugin constructs a new configAudit.Plugin, which is using an upstream Tunnel config audit scanner lib.
Types ¶
type AdditionalFields ¶
type Config ¶
type Config struct {
tunneloperator.PluginConfig
}
Config defines configuration params for this plugin.
func (Config) FindIgnorePolicyKey ¶
func (Config) GenerateIgnoreFileVolumeIfAvailable ¶
func (Config) GenerateIgnorePolicyVolumeIfAvailable ¶
func (Config) GenerateSslCertDirVolumeIfAvailable ¶
func (Config) GetAdditionalVulnerabilityReportFields ¶
func (c Config) GetAdditionalVulnerabilityReportFields() AdditionalFields
func (Config) GetClientServerSkipUpdate ¶
func (Config) GetCommand ¶
func (Config) GetDBRepository ¶
func (Config) GetDBRepositoryInsecure ¶
func (Config) GetImagePullSecret ¶
func (c Config) GetImagePullSecret() []corev1.LocalObjectReference
func (Config) GetImageRef ¶
GetImageRef returns upstream Tunnel container image reference.
func (Config) GetImageTag ¶
GetImageTag returns upstream Tunnel container image tag.
func (Config) GetInsecureRegistries ¶
func (Config) GetMirrors ¶
func (Config) GetNonSSLRegistries ¶
func (Config) GetResourceRequirements ¶
func (c Config) GetResourceRequirements() (corev1.ResourceRequirements, error)
GetResourceRequirements creates ResourceRequirements from the Config.