ci

package
v0.0.0-...-b39e775 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCustomCheckRuleID = "tfsec_custom_check"

Variables

View Source
var ErrExitCode = errors.New("ExitCode is set")

Functions

func ConfigFileAutoDetection

func ConfigFileAutoDetection(basePath string) (*models.Configuration, error)

ConfigFileAutoDetection reads recursively a path looking for kubernetes manifests and helm charts, returns a fairwinds-insights configuration struct or error

func ScanImageFile

func ScanImageFile(imagePath, imageID, tempDir, extraFlags string) (*trivymodels.TrivyResults, error)

ScanImageFile will scan a single file with Trivy and return the results.

Types

type CIScan

type CIScan struct {
	// contains filtered or unexported fields
}

func NewCIScan

func NewCIScan(cloneRepo bool, token string) (*CIScan, error)

Create a new CI instance based on flag cloneRepo

func (*CIScan) Close

func (ci *CIScan) Close()

Close deletes all temporary folders created.

func (*CIScan) CopyYaml

func (ci *CIScan) CopyYaml() error

CopyYaml adds all Yaml found in a given spot into the manifest folder.

func (*CIScan) GetPlutoReport

func (ci *CIScan) GetPlutoReport() (*models.ReportInfo, error)

func (*CIScan) GetPolarisReport

func (ci *CIScan) GetPolarisReport() (*models.ReportInfo, error)

func (*CIScan) GetTrivyReport

func (ci *CIScan) GetTrivyReport(dockerImages []trivymodels.DockerImage, manifestImages []trivymodels.Image) (report *models.ReportInfo, errs error)

func (*CIScan) GetWorkloadReport

func (ci *CIScan) GetWorkloadReport(resources []models.Resource) (*models.ReportInfo, error)

func (*CIScan) JUnitEnabled

func (ci *CIScan) JUnitEnabled() bool

func (*CIScan) OPAEnabled

func (ci *CIScan) OPAEnabled() bool

func (*CIScan) PlutoEnabled

func (ci *CIScan) PlutoEnabled() bool

func (*CIScan) PolarisEnabled

func (ci *CIScan) PolarisEnabled() bool

func (*CIScan) ProcessHelmTemplates

func (ci *CIScan) ProcessHelmTemplates() error

ProcessHelmTemplates turns helm into yaml to be processed by Polaris or the other tools.

func (CIScan) ProcessOPA

func (ci CIScan) ProcessOPA(ctx context.Context) (*models.ReportInfo, error)

ProcessOPA runs all checks against the provided Custom Check

func (*CIScan) ProcessRepository

func (ci *CIScan) ProcessRepository() ([]*models.ReportInfo, error)

func (*CIScan) ProcessTerraformPath

func (ci *CIScan) ProcessTerraformPath(terraformPath string) ([]models.TFSecResult, error)

func (*CIScan) ProcessTerraformPaths

func (ci *CIScan) ProcessTerraformPaths() (report *models.ReportInfo, errs error)

func (*CIScan) SaveJUnitFile

func (ci *CIScan) SaveJUnitFile(results models.ScanResults) error

SaveJUnitFile will save the

func (*CIScan) SendAndPrintResults

func (ci *CIScan) SendAndPrintResults(reports []*models.ReportInfo) error

func (*CIScan) SkipTrivyManifests

func (ci *CIScan) SkipTrivyManifests() bool

func (*CIScan) TerraformEnabled

func (ci *CIScan) TerraformEnabled() bool

func (*CIScan) TrivyEnabled

func (ci *CIScan) TrivyEnabled() bool

type ImageDownloaderFunc

type ImageDownloaderFunc = func(cmdExecutor cmdExecutor, folderPath, imageName string, rc *models.RegistryCredential) (string, error)

ImageDownloaderFunc - downloads an image and returns the output and error

type KubernetesManifest

type KubernetesManifest struct {
	ApiVersion *string `json:"apiVersion"` // Affects YAML field names too.
	Kind       *string `json:"kind"`
}

Jump to

Keyboard shortcuts

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