Skip to content

Commit 7cbd430

Browse files
committed
Reregister apk analyzer
1 parent b2d681d commit 7cbd430

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# image-analyzer
22
OCI images analyzer
33

4-
This repository exists for 2 reasons:
4+
This repository exists for 3 reasons:
55
- `github.com/castai/image-analyzer/image/daemon.Image` interface.
6-
- Having various analyzers bundled in a single module.
6+
- Having various analyzers bundled in a single module. [This didn't exist at the time of the fork](https://github.com/aquasecurity/trivy/blob/v0.50.1/pkg/fanal/analyzer/all/import.go)
7+
- `https://github.com/aquasecurity/trivy/tree/v0.50.1/pkg/fanal/analyzer/pkg/apk` analyzer not scanning installed binaries.

apk/apk.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ import (
99
"sort"
1010
"strings"
1111

12-
"github.com/castai/image-analyzer/pathutil"
13-
apkVersion "github.com/knqyf263/go-apk-version"
14-
"github.com/samber/lo"
15-
"golang.org/x/exp/slices"
16-
1712
"github.com/aquasecurity/trivy/pkg/fanal/analyzer"
1813
"github.com/aquasecurity/trivy/pkg/fanal/types"
1914
"github.com/aquasecurity/trivy/pkg/licensing"
2015
"github.com/aquasecurity/trivy/pkg/log"
16+
apkVersion "github.com/knqyf263/go-apk-version"
17+
"github.com/samber/lo"
18+
"golang.org/x/exp/slices"
19+
20+
"github.com/castai/image-analyzer/pathutil"
2121
)
2222

23+
// https://github.com/aquasecurity/trivy/blob/v0.50.1/pkg/fanal/analyzer/all/import.go
2324
func init() {
25+
analyzer.DeregisterAnalyzer(analyzer.TypeApk) // prevents registering analyzer twice
2426
analyzer.RegisterAnalyzer(&alpinePkgAnalyzer{})
2527
}
2628

0 commit comments

Comments
 (0)