blackstork-io / fabric

An open-source command-line tool for cybersecurity reporting automation and a configuration language for reusable templates. Reporting-as-Code
https://blackstork.io/fabric/
Apache License 2.0
12 stars 0 forks source link

Upgrade dependencies #197

Closed Andrew-Morozko closed 2 weeks ago

Andrew-Morozko commented 2 weeks ago

Resolves #195

Right now this golangci version reports the following issues:

tools/pluginmeta/main.go:39:2: G104: Errors unhandled. (gosec)
        flags.Parse(os.Args[1:])
        ^
tools/pluginmeta/main.go:63:8: G301: Expect directory permissions to be 0750 or less (gosec)
        err = os.MkdirAll(filepath.Dir(output), 0o755)
              ^
tools/pluginmeta/main.go:96:12: G304: Potential file inclusion via variable (gosec)
        f, err := os.Open(plugin)
                  ^
tools/pluginmeta/main.go:111:12: G304: Potential file inclusion via variable (gosec)
        f, err := os.Open(output)
                  ^
tools/pluginmeta/main.go:125:12: G304: Potential file inclusion via variable (gosec)
        f, err := os.Open(configFile)
                  ^
pkg/circularRefDetector/circularRefs.go:24:15: G103: Use of unsafe calls should be audited (gosec)
        detector.add(unsafe.Pointer(ptr), refRange)
                     ^
pkg/circularRefDetector/circularRefs.go:29:24: G103: Use of unsafe calls should be audited (gosec)
        return detector.check(unsafe.Pointer(ptr))
                              ^
pkg/circularRefDetector/circularRefs.go:36:18: G103: Use of unsafe calls should be audited (gosec)
        detector.remove(unsafe.Pointer(ptr), diags)
                        ^
plugin/resolver/source_remote.go:365:3: G104: Errors unhandled. (gosec)
                os.Remove(binaryPath)
                ^
plugin/resolver/source_remote.go:366:3: G104: Errors unhandled. (gosec)
                os.Remove(checksumPath)
                ^
plugin/resolver/source_remote.go:445:12: G301: Expect directory permissions to be 0750 or less (gosec)
        if err := os.MkdirAll(filepath.Dir(binaryPath), 0o755); err != nil {
                  ^
cmd/internal/telemetry/telemetry.go:92:9: G301: Expect directory permissions to be 0750 or less (gosec)
        err := os.MkdirAll(dir, 0o755)
               ^

We can fix/nolint them, or ignore until some PR would touch those files