Documentation
¶
Index ¶
- func ConvertCtyValueToGo(val cty.Value) interface{}
- func InitializeProcessors() []core.FileProcessor
- func ParseReferenceInclude(include string) (string, string)
- type AWSResourceBlockProcessor
- type AzureResourceBlockProcessor
- type CDMImport
- type CDMResource
- type CloudDeploymentManagerProcessor
- type CloudDeploymentManagerTemplate
- type CloudFormationProcessor
- type CloudFormationResource
- type CloudFormationTemplate
- type DockerComposeFile
- type DockerComposeProcessor
- type DockerComposeService
- type DockerInstruction
- type DockerProcessor
- type FilePatternsProcessor
- type FilenameProcessor
- type GCPResourceBlockProcessor
- type LanguageProcessor
- type LibrariesProcessor
- type Library
- type ModuleBlockProcessor
- type Pattern
- type TerraformBlock
- type TerraformBlockProcessor
- type TerraformProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertCtyValueToGo ¶ added in v0.8.0
func InitializeProcessors ¶
func InitializeProcessors() []core.FileProcessor
InitializeProcessors creates and returns a slice of FileProcessor implementations.
func ParseReferenceInclude ¶
Types ¶
type AWSResourceBlockProcessor ¶ added in v0.8.0
type AWSResourceBlockProcessor struct{}
-- New AWS Resource Block Processor --
func (AWSResourceBlockProcessor) Process ¶ added in v0.8.0
func (a AWSResourceBlockProcessor) Process(block *TerraformBlock, path string, repoName string) ([]core.Finding, error)
type AzureResourceBlockProcessor ¶ added in v0.8.0
type AzureResourceBlockProcessor struct{}
-- New Azure Resource Block Processor --
func (AzureResourceBlockProcessor) Process ¶ added in v0.8.0
func (a AzureResourceBlockProcessor) Process(block *TerraformBlock, path string, repoName string) ([]core.Finding, error)
type CDMResource ¶ added in v0.8.0
type CloudDeploymentManagerProcessor ¶ added in v0.8.0
type CloudDeploymentManagerProcessor struct{}
CloudDeploymentManagerProcessor attempts to detect and parse GCP Cloud Deployment Manager templates.
func (CloudDeploymentManagerProcessor) Process ¶ added in v0.8.0
func (p CloudDeploymentManagerProcessor) Process(path string, repoName string, content string) ([]core.Finding, error)
Process tries to parse the file as YAML (common for Deployment Manager). If "resources" is present and non-empty, we produce a Finding for each resource.
func (CloudDeploymentManagerProcessor) Supports ¶ added in v0.8.0
func (p CloudDeploymentManagerProcessor) Supports(filePath string) bool
Supports checks file extensions that are commonly used for Deployment Manager templates.
type CloudDeploymentManagerTemplate ¶ added in v0.8.0
type CloudDeploymentManagerTemplate struct { Imports []CDMImport `yaml:"imports,omitempty"` Resources []CDMResource `yaml:"resources,omitempty"` }
CloudDeploymentManagerTemplate is a simplified representation of a Cloud Deployment Manager template. Typically, you’ll see keys: "imports", "resources", etc.
type CloudFormationProcessor ¶ added in v0.8.0
type CloudFormationProcessor struct { }
CloudFormationProcessor parses files with .yml, .yaml, or .json and checks if they appear to be AWS CloudFormation templates. It then emits a Finding for each resource.
func (CloudFormationProcessor) Supports ¶ added in v0.8.0
func (c CloudFormationProcessor) Supports(filePath string) bool
type CloudFormationResource ¶ added in v0.8.0
type CloudFormationResource struct { Type string `yaml:"Type,omitempty" json:"Type,omitempty"` Properties map[string]interface{} `yaml:"Properties,omitempty" json:"Properties,omitempty"` }
CloudFormationResource is a partial representation of a CloudFormation resource.
type CloudFormationTemplate ¶ added in v0.8.0
type CloudFormationTemplate struct { AWSTemplateFormatVersion string `yaml:"AWSTemplateFormatVersion,omitempty" json:"AWSTemplateFormatVersion,omitempty"` Resources map[string]CloudFormationResource `yaml:"Resources,omitempty" json:"Resources,omitempty"` }
CloudFormationTemplate is a partial representation of a CloudFormation template.
type DockerComposeFile ¶ added in v0.8.0
type DockerComposeFile struct {
Services map[string]DockerComposeService `yaml:"services,omitempty"`
}
DockerComposeFile represents the top-level structure of a docker-compose.yml file.
type DockerComposeProcessor ¶ added in v0.8.0
type DockerComposeProcessor struct { }
DockerComposeProcessor scans Docker Compose files (docker-compose.yml / .yaml) and reports the discovered services/images.
func (DockerComposeProcessor) Supports ¶ added in v0.8.0
func (d DockerComposeProcessor) Supports(filePath string) bool
Supports checks if the file is named (or symlinked) as a docker-compose file.
type DockerComposeService ¶ added in v0.8.0
type DockerComposeService struct {
Image string `yaml:"image,omitempty"`
}
DockerComposeService is a minimal struct to parse just enough from a docker-compose file.
type DockerInstruction ¶
func ParseDockerfile ¶
func ParseDockerfile(reader io.Reader) ([]DockerInstruction, error)
type DockerProcessor ¶
type DockerProcessor struct { }
func (DockerProcessor) Supports ¶
func (d DockerProcessor) Supports(filePath string) bool
type FilePatternsProcessor ¶
type FilePatternsProcessor struct {
Patterns []Pattern
}
func NewFilePatternsProcessor ¶
func NewFilePatternsProcessor(fs fs.FS) *FilePatternsProcessor
func (*FilePatternsProcessor) CompilePatterns ¶
func (s *FilePatternsProcessor) CompilePatterns()
func (*FilePatternsProcessor) Supports ¶
func (s *FilePatternsProcessor) Supports(path string) bool
type FilenameProcessor ¶ added in v0.8.0
type FilenameProcessor struct { }
func (FilenameProcessor) Supports ¶ added in v0.8.0
func (f FilenameProcessor) Supports(filePath string) bool
type GCPResourceBlockProcessor ¶ added in v0.8.0
type GCPResourceBlockProcessor struct{}
-- New GCP Resource Block Processor --
func (GCPResourceBlockProcessor) Process ¶ added in v0.8.0
func (g GCPResourceBlockProcessor) Process(block *TerraformBlock, path string, repoName string) ([]core.Finding, error)
type LanguageProcessor ¶ added in v0.8.0
type LanguageProcessor struct { }
func (LanguageProcessor) Supports ¶ added in v0.8.0
func (l LanguageProcessor) Supports(filePath string) bool
type LibrariesProcessor ¶
type LibrariesProcessor struct {
// contains filtered or unexported fields
}
func NewLibrariesProcessor ¶
func NewLibrariesProcessor() *LibrariesProcessor
func (*LibrariesProcessor) Supports ¶
func (mp *LibrariesProcessor) Supports(filePath string) bool
type ModuleBlockProcessor ¶ added in v0.8.0
type ModuleBlockProcessor struct{}
func (ModuleBlockProcessor) Process ¶ added in v0.8.0
func (m ModuleBlockProcessor) Process(block *TerraformBlock, path string, repoName string) ([]core.Finding, error)
type Pattern ¶
type Pattern struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Category string `json:"category,omitempty"` Filenames []string `json:"file_names,omitempty"` PathPatterns []string `json:"path_patterns,omitempty"` FileExtensions []string `json:"file_extensions,omitempty"` ContentPatterns []string `json:"content_patterns,omitempty"` FilenameRegexs []*regexp.Regexp ContentPatternRegexs []*regexp.Regexp PathPatternGlobs []glob.Glob Properties map[string]interface{} `json:"properties,omitempty"` }
type TerraformBlock ¶ added in v0.8.0
type TerraformBlock struct { Type string Labels []string Attributes map[string]interface{} Blocks []*TerraformBlock }
type TerraformBlockProcessor ¶ added in v0.8.0
type TerraformProcessor ¶ added in v0.8.0
type TerraformProcessor struct {
// contains filtered or unexported fields
}
func NewTerraformProcessor ¶ added in v0.8.0
func NewTerraformProcessor() *TerraformProcessor
func (TerraformProcessor) Supports ¶ added in v0.8.0
func (t TerraformProcessor) Supports(filePath string) bool