Documentation ¶
Index ¶
- func BuildSchemaSetFromPolicies(policies map[string]*ast.Module, paths []string, fsys fs.FS) (*ast.SchemaSet, bool, error)
- func GetInputsContents(inputs []Input) []any
- func IsDotFile(name string) bool
- func IsJSONFile(name string) bool
- func IsRegoFile(name string) bool
- func LoadEmbeddedLibraries() (map[string]*ast.Module, error)
- func LoadEmbeddedPolicies() (map[string]*ast.Module, error)
- func LoadPoliciesFromDirs(target fs.FS, paths ...string) (map[string]*ast.Module, error)
- func NewEngineMetadata(schema string, meta map[string]interface{}) (*scan.EngineMetadata, error)
- func RegisterRegoRules(modules map[string]*ast.Module)
- type DynamicMetadata
- type Input
- type InputOptions
- type MetadataRetriever
- type Scanner
- func (s *Scanner) LoadPolicies(enableEmbeddedLibraries, enableEmbeddedPolicies bool, srcFS fs.FS, ...) 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) SetRegoErrorLimit(limit int)
- 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) SetUseEmbeddedLibraries(b bool)
- func (s *Scanner) SetUseEmbeddedPolicies(b bool)
- type Selector
- type StaticMetadata
- type SubType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSchemaSetFromPolicies ¶ added in v0.82.8
func GetInputsContents ¶ added in v0.94.0
func IsJSONFile ¶ added in v0.94.0
func IsRegoFile ¶ added in v0.94.0
func LoadEmbeddedLibraries ¶ added in v0.94.0
func LoadEmbeddedPolicies ¶ added in v0.94.0
func LoadPoliciesFromDirs ¶ added in v0.94.0
func NewEngineMetadata ¶ added in v0.94.0
func NewEngineMetadata(schema string, meta map[string]interface{}) (*scan.EngineMetadata, error)
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, contents ...any) (*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) 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) SetRegoErrorLimit ¶ added in v0.89.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) SetUseEmbeddedLibraries ¶ added in v0.87.0
func (*Scanner) SetUseEmbeddedPolicies ¶ added in v0.54.0
type StaticMetadata ¶
type StaticMetadata struct { ID string AVDID string Title string ShortCode string Aliases []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 NewStaticMetadata ¶ added in v0.94.0
func NewStaticMetadata(pkgPath string, inputOpt InputOptions) *StaticMetadata
func (*StaticMetadata) FromAnnotations ¶ added in v0.94.0
func (sm *StaticMetadata) FromAnnotations(annotations *ast.Annotations) error
func (StaticMetadata) ToRule ¶
func (m StaticMetadata) ToRule() scan.Rule
Source Files ¶
Click to show internal directories.
Click to hide internal directories.