Skip to content

Commit

Permalink
Add custom resources in fs scanning and add deregister analyzers (aqu…
Browse files Browse the repository at this point in the history
…asecurity#564)

* Add deregister analyzers

* feat(fs): add CustomResources
  • Loading branch information
knqyf263 authored Jun 14, 2022
1 parent 981bf73 commit 29c7165
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 10 additions & 0 deletions analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,20 @@ func RegisterAnalyzer(analyzer analyzer) {
analyzers[analyzer.Type()] = analyzer
}

// DeregisterAnalyzer is mainly for testing
func DeregisterAnalyzer(t Type) {
delete(analyzers, t)
}

func RegisterConfigAnalyzer(analyzer configAnalyzer) {
configAnalyzers[analyzer.Type()] = analyzer
}

// DeregisterConfigAnalyzer is mainly for testing
func DeregisterConfigAnalyzer(t Type) {
delete(configAnalyzers, t)
}

// CustomGroup returns a group name for custom analyzers
// This is mainly intended to be used in Aqua products.
type CustomGroup interface {
Expand Down
13 changes: 7 additions & 6 deletions artifact/local/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ func (a Artifact) Inspect(ctx context.Context) (types.ArtifactReference, error)
result.Sort()

blobInfo := types.BlobInfo{
SchemaVersion: types.BlobJSONSchemaVersion,
OS: result.OS,
Repository: result.Repository,
PackageInfos: result.PackageInfos,
Applications: result.Applications,
Secrets: result.Secrets,
SchemaVersion: types.BlobJSONSchemaVersion,
OS: result.OS,
Repository: result.Repository,
PackageInfos: result.PackageInfos,
Applications: result.Applications,
Secrets: result.Secrets,
CustomResources: result.CustomResources,
}

if err = a.handlerManager.PostHandle(ctx, result, &blobInfo); err != nil {
Expand Down

0 comments on commit 29c7165

Please sign in to comment.