Documentation ¶
Index ¶
- func BuildSchemaSetFromPolicies(policies map[string]*ast.Module, paths []string, fsys fs.FS) (*ast.SchemaSet, bool, error)
- func BuiltinNamespaces() []string
- func GetInputsContents(inputs []Input) []any
- func IsBuiltinNamespace(namespace string) bool
- 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]any) (*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(fsys fs.FS)
- func (s *Scanner) SetDebugWriter(writer io.Writer)
- func (s *Scanner) SetFrameworks(frameworks []framework.Framework)
- func (s *Scanner) SetIncludeDeprecatedChecks(b bool)
- func (s *Scanner) SetParentDebugLogger(l debug.Logger)
- func (s *Scanner) SetPerResultTracingEnabled(b bool)
- func (s *Scanner) SetPolicyDirs(_ ...string)
- func (s *Scanner) SetPolicyFilesystem(fsys 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 BuiltinNamespaces ¶ added in v0.51.0
func BuiltinNamespaces() []string
func GetInputsContents ¶
func IsBuiltinNamespace ¶ added in v0.51.0
func IsJSONFile ¶
func IsRegoFile ¶
func LoadPoliciesFromDirs ¶
func NewEngineMetadata ¶
func RegisterRegoRules ¶
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, opts ...options.ScannerOption) *Scanner
func (*Scanner) LoadPolicies ¶
func (*Scanner) SetDataDirs ¶
func (*Scanner) SetDataFilesystem ¶
func (*Scanner) SetDebugWriter ¶
func (*Scanner) SetFrameworks ¶
func (*Scanner) SetIncludeDeprecatedChecks ¶ added in v0.52.0
func (*Scanner) SetParentDebugLogger ¶
func (*Scanner) SetPerResultTracingEnabled ¶
func (*Scanner) SetPolicyDirs ¶
func (*Scanner) SetPolicyFilesystem ¶
func (*Scanner) SetPolicyNamespaces ¶
func (*Scanner) SetPolicyReaders ¶
func (*Scanner) SetRegoErrorLimit ¶
func (*Scanner) SetRegoOnly ¶
func (*Scanner) SetSkipRequiredCheck ¶
func (*Scanner) SetTraceWriter ¶
func (*Scanner) SetUseEmbeddedLibraries ¶
func (*Scanner) SetUseEmbeddedPolicies ¶
type StaticMetadata ¶
type StaticMetadata struct { Deprecated bool 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 ¶
func NewStaticMetadata(pkgPath string, inputOpt InputOptions) *StaticMetadata
func (*StaticMetadata) FromAnnotations ¶
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.