github.com/aquasecurity/fanal v0.0.0-20220404155252-996e81f58b02
legitimate security tool test data
100+ functions have 50+ basic blocksBacktick shell command-substitution syntax
SHA-25644bf7b766a05a3dda3a336e0270147f526f1856c9a2ce8b07917a0d30efdc4ae
Evidence
1[
2 {
3 "apiVersion": "apps/v1",
4 "kind": "Deployment",
5 "metadata": {
⋯17 lines
1package packaging
2
3import (
4 "archive/zip"
5 "context"
6 "io"
7 "os"
8 "path/filepath"
9 "strings"
10
11 "golang.org/x/xerrors"
12
13 "github.com/aquasecurity/fanal/analyzer"
14 "github.com/aquasecurity/fanal/types"
15 "github.com/aquasecurity/go-dep-parser/pkg/python/packaging"
16)
17
⋯7 lines
1package rpm
2
3import (
4 "context"
5 "io"
6 "os"
7 "path/filepath"
8 "strings"
9
10 "github.com/aquasecurity/fanal/log"
11 rpmdb "github.com/knqyf263/go-rpmdb/pkg"
12 "golang.org/x/xerrors"
13
14 "github.com/aquasecurity/fanal/analyzer"
15 "github.com/aquasecurity/fanal/types"
16 "github.com/aquasecurity/fanal/utils"
17)
18
⋯8 lines
77:41… io.Reader) ([]types.Package, []string, error) {
78 tmpDir, err := os.MkdirTemp("", "rpm")
79 if err != nil {
80 return nil, nil, xerrors.Errorf("failed to create a temp dir: %w", err)
81 }
82 defer os.RemoveAll(tmpDir)
83
84 filename := filepath.Join(tmpDir, "Packages")
85 f, err := os.Create(filename)
86 if err != nil {
87 return nil, nil, xerrors.Errorf("failed to create a package file: %w", err)
88 }
89
90 if _, err = io.Copy(f, rc); err != nil {
91 return nil, nil, xerrors.Errorf("failed to copy a package file: %w", err)
92 }
93
94 // The temp file must be closed before being opened as Berkeley DB.
95 if err = f.Close(); err != nil {
1package remote
2
3import (
4 "context"
5 "io/ioutil"
6 "net/url"
7 "os"
8
9 git "github.com/go-git/go-git/v5"
10 "github.com/go-git/go-git/v5/plumbing/transport/http"
11 "golang.org/x/xerrors"
12
13 "github.com/aquasecurity/fanal/analyzer/config"
14 "github.com/aquasecurity/fanal/artifact"
15 "github.com/aquasecurity/fanal/artifact/local"
16 "github.com/aquasecurity/fanal/cache"
17 "github.com/aquasecurity/fanal/types"
18)
19
⋯6 lines
Showing the top 5 files — 1 more file (110 regions) not shown.