Documentation ¶
Index ¶
- Variables
- func BuildSchemaSetFromPolicies(policies map[string]*ast.Module, paths []string, srcFS fs.FS) (*ast.SchemaSet, bool, error)
- func RecurseEmbeddedModules(fs embed.FS, dir string) (map[string]*ast.Module, error)
- func RegisterRegoRules(modules map[string]*ast.Module)
- type DynamicMetadata
- type Input
- type InputOptions
- type MetadataRetriever
- type Scanner
- func (s *Scanner) LoadEmbeddedLibraries() error
- func (s *Scanner) LoadPolicies(loadEmbedded bool, srcFS fs.FS, paths []string, readers []io.Reader) error
- func (s *Scanner) ScanInput(ctx context.Context, inputs ...Input) (scan.Results, error)
- func (s *Scanner) SetDataDirs(dirs ...string)
- func (s *Scanner) SetDataFilesystem(fs fs.FS)
- func (s *Scanner) SetDebugWriter(writer io.Writer)
- func (s *Scanner) SetFrameworks(frameworks []framework.Framework)
- func (s *Scanner) SetParentDebugLogger(l debug.Logger)
- func (s *Scanner) SetPerResultTracingEnabled(b bool)
- func (s *Scanner) SetPolicyDirs(_ ...string)
- func (s *Scanner) SetPolicyFilesystem(fs fs.FS)
- func (s *Scanner) SetPolicyNamespaces(namespaces ...string)
- func (s *Scanner) SetPolicyReaders(_ []io.Reader)
- func (s *Scanner) SetRegoOnly(bool)
- func (s *Scanner) SetSkipRequiredCheck(_ bool)
- func (s *Scanner) SetSpec(spec string)
- func (s *Scanner) SetTraceWriter(writer io.Writer)
- func (s *Scanner) SetUseEmbeddedPolicies(b bool)
- type Selector
- type StaticMetadata
- type SubType
Constants ¶
This section is empty.
Variables ¶
View Source
var SchemaMap = map[types.Source]schemas.Schema{ types.SourceDefsec: schemas.Cloud, types.SourceCloud: schemas.Cloud, types.SourceKubernetes: schemas.Kubernetes, types.SourceRbac: schemas.Kubernetes, types.SourceDockerfile: schemas.Dockerfile, types.SourceTOML: schemas.Anything, types.SourceYAML: schemas.Anything, types.SourceJSON: schemas.Anything, }
Functions ¶
func BuildSchemaSetFromPolicies ¶ added in v0.82.8
func RecurseEmbeddedModules ¶ added in v0.82.6
func RegisterRegoRules ¶ added in v0.82.6
Types ¶
type DynamicMetadata ¶
type InputOptions ¶
type MetadataRetriever ¶
type MetadataRetriever struct {
// contains filtered or unexported fields
}
func NewMetadataRetriever ¶
func NewMetadataRetriever(compiler *ast.Compiler) *MetadataRetriever
func (*MetadataRetriever) RetrieveMetadata ¶
func (m *MetadataRetriever) RetrieveMetadata(ctx context.Context, module *ast.Module, inputs ...Input) (*StaticMetadata, error)
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func NewScanner ¶
func NewScanner(source types.Source, options ...options.ScannerOption) *Scanner
func (*Scanner) LoadEmbeddedLibraries ¶ added in v0.45.0
func (*Scanner) LoadPolicies ¶
func (*Scanner) SetDataDirs ¶ added in v0.39.0
func (*Scanner) SetDataFilesystem ¶ added in v0.82.10
func (*Scanner) SetDebugWriter ¶ added in v0.39.0
func (*Scanner) SetFrameworks ¶ added in v0.69.0
func (*Scanner) SetParentDebugLogger ¶ added in v0.68.0
func (*Scanner) SetPerResultTracingEnabled ¶ added in v0.39.0
func (*Scanner) SetPolicyDirs ¶ added in v0.39.0
func (*Scanner) SetPolicyFilesystem ¶ added in v0.46.0
func (*Scanner) SetPolicyNamespaces ¶ added in v0.39.0
func (*Scanner) SetPolicyReaders ¶ added in v0.39.0
func (*Scanner) SetRegoOnly ¶ added in v0.80.1
func (*Scanner) SetSkipRequiredCheck ¶ added in v0.39.0
func (*Scanner) SetTraceWriter ¶ added in v0.39.0
func (*Scanner) SetUseEmbeddedPolicies ¶ added in v0.54.0
type StaticMetadata ¶
type StaticMetadata struct { ID string AVDID string Title string ShortCode string Description string Severity string RecommendedActions string PrimaryURL string References []string InputOptions InputOptions Package string Frameworks map[framework.Framework][]string Provider string Service string Library bool CloudFormation *scan.EngineMetadata Terraform *scan.EngineMetadata }
func (StaticMetadata) ToRule ¶
func (m StaticMetadata) ToRule() scan.Rule
Source Files ¶
Click to show internal directories.
Click to hide internal directories.