GoKart - Go Security Static Analysis

GoKart - Go Security Static Analysis

CI Release

GoKart is a static analysis tool for Go that finds vulnerabilities using the SSA (single static assignment) form of Go source code. It is capable of tracing the source of variables and function arguments to determine whether input sources are safe, which reduces the number of false positives compared to other Go security scanners. For instance, a SQL query that is concatenated with a variable might traditionally be flagged as SQL injection; however, GoKart can figure out if the variable is actually a constant or constant equivalent, in which case there is no vulnerability.

Why We Built GoKart

Static analysis is a powerful technique for finding vulnerabilities in source code. However, the approach has suffered from being noisy - that is, many static analysis tools find quite a few "vulnerabilities" that are not actually real. This has led to developer friction as users get tired of the tools "crying wolf" one time too many.

The motivation for GoKart was to address this: could we create a scanner with significantly lower false positive rates than existing tools? Based on our experimentation the answer is yes. By leveraging source-to-sink tracing and SSA, GoKart is capable of tracking variable taint between variable assignments, significantly improving the accuracy of findings. Our focus is on usability: pragmatically, that means we have optimized our approaches to reduce false alarms.

For more information, please read our blog post.

Install

You can install GoKart locally by using any one of the options listed below.

Install with go install

$ go install github.com/praetorian-inc/gokart@latest

Install a release binary

  1. Download the binary for your OS from the releases page.

  2. (OPTIONAL) Download the checksums.txt file to verify the integrity of the archive

# Check the checksum of the downloaded archive
$ shasum -a 256 gokart_${VERSION}_${ARCH}.tar.gz
b05c4d7895be260aa16336f29249c50b84897dab90e1221c9e96af9233751f22  gokart_${VERSION}_${ARCH}.tar.gz

$ cat gokart_${VERSION}_${ARCH}_checksums.txt | grep gokart_${VERSION}_${ARCH}.tar.gz
b05c4d7895be260aa16336f29249c50b84897dab90e1221c9e96af9233751f22  gokart_${VERSION}_${ARCH}.tar.gz
  1. Extract the downloaded archive
$ tar -xvf gokart_${VERSION}_${ARCH}.tar.gz
  1. Move the gokart binary into your path:
$ mv ./gokart /usr/local/bin/

Clone and build yourself

# clone the GoKart repo
$ git clone https://github.com/praetorian-inc/gokart.git

# navigate into the repo directory and build
$ cd gokart
$ go build

# Move the gokart binary into your path
$ mv ./gokart /usr/local/bin

Usage

Run GoKart on a Go module in the current directory

# running without a directory specified defaults to '.'
gokart scan <flags>

Scan a Go module in a different directory

gokart scan <directory> <flags> 

Get Help

gokart help

Getting Started - Scanning an Example App

You can follow the steps below to run GoKart on Go Test Bench, an intentionally vulnerable Go application from the Contrast Security team.

# Clone sample vulnerable application
git clone https://github.com/Contrast-Security-OSS/go-test-bench.git
gokart scan go-test-bench/

Output should show some identified vulnerabilities, each with a Vulnerable Function and Source of User Input identified.

To test some additional GoKart features, you can scan with the CLI flags suggested below.

# Use verbose flag to show full traces of these vulnerabilities
gokart scan go-test-bench/ -v

# Use globalsTainted flag to ignore whitelisted Sources
# may increase false positive results
gokart scan go-test-bench/ -v -g

# Use debug flag to display internal analysis information
# which is useful for development and debugging
gokart scan go-test-bench/ -d

# Output results in sarif format
gokart scan go-test-bench/ -s

To test out the extensibility of GoKart, you can modify the configuration file that GoKart uses to introduce a new vulnerable sink into analysis. There is a Test Sink analyzer defined in the included default config file at util/analyzers.yml. Modify util/analyzers.yml to remove the comments on the Test Sink analyzer and then direct GoKart to use the modified config file with the -i flag.

# Scan using modified analyzers.yml file and output full traces
gokart scan go-test-bench/ -v -i <path-to-gokart>/util/analyzers.yml

Output should now contain additional vulnerabilities, including new "Test Sink reachable by user input" vulnerabilities.

Run GoKart Tests

You can run the included tests with the following command, invoked from the GoKart root directory.

go test -v ./...
Owner
Praetorian
Praetorian provides a suite of security solutions that enable clients to solve cybersecurity problems across their enterprise and product portfolios.
Praetorian
Comments
  • fix: Update to GO 1.18 so scan works on new projects

    fix: Update to GO 1.18 so scan works on new projects

    If you run gokart scan on go 1.18 projects, you get an error:

    internal error: package "time" without types was imported from "github.com/Omaze/cl-sweeps-api/internal/common"

    We need to have a 1.18 build for gokart for it to work with new go projects

  • panic: index out of range

    panic: index out of range

    OS: macOS Big Sur (11.5.1) GoKart Version: 0.1.0 Config: default Target: github.com/spiffe/spire

    Decided to give this a whirl against github.com/spiffe/spire but unfortunately hit a panic.

    $ go install github.com/praetorian-inc/gokart@latest
    go: downloading github.com/praetorian-inc/gokart v0.1.0
    go: downloading github.com/lithammer/dedent v1.1.0
    go: downloading github.com/owenrumney/go-sarif v1.0.11
    go: downloading github.com/segmentio/fasthash v1.0.3
    go: downloading golang.org/x/tools v0.1.2
    go: downloading github.com/zclconf/go-cty v1.8.4
    $ git clone https://github.com/spiffe/spire
    $ cd spire
    $ gokart scan .
    Using default analyzers config found at "~/.gokart/analyzers.yml".
    No existing analyzers.yml file found - writing default to ~/.gokart/analyzers.yml
    
    Revving engines VRMMM VRMMM
    3...2...1...Go!
    panic: runtime error: index out of range [0] with length 0
    
    goroutine 1 [running]:
    github.com/praetorian-inc/gokart/util.OutputFinding(0xc001acaf60, 0x2f, 0xc005a53e80, 0x7a, 0xc00205b680, 0x4a, 0x48, 0xc001acaf90, 0x28, 0x0, ...)
    	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/util/finding.go:54 +0x116f
    github.com/praetorian-inc/gokart/analyzers.Scan(0xc000074330, 0x1, 0x1)
    	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/analyzers/scan.go:128 +0x5bd
    github.com/praetorian-inc/gokart/cmd.glob..func1(0x16dcd00, 0xc000074330, 0x1, 0x1)
    	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/cmd/scan.go:53 +0x1ca
    github.com/spf13/cobra.(*Command).execute(0x16dcd00, 0xc000074300, 0x1, 0x1, 0x16dcd00, 0xc000074300)
    	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x2c2
    github.com/spf13/cobra.(*Command).ExecuteC(0x16dca80, 0xc000000180, 0xc00016df78, 0x1006a25)
    	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x375
    github.com/spf13/cobra.(*Command).Execute(...)
    	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
    github.com/praetorian-inc/gokart/cmd.Execute(...)
    	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/cmd/root.go:61
    main.main()
    	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/main.go:38 +0x32
    
  • Emit JSON output only once; improve error reporting

    Emit JSON output only once; improve error reporting

    Previously, due to copy-and-paste, GoKart's JSON output would be emitted twice. This pull request fixes that.

    Additionally, this pull request improves the error reporting when an unknown command is given to GoKart.

  • Publish gokart in docker github packages

    Publish gokart in docker github packages

    do you think it makes sense to post a gokart docker image in github packages? I really like the idea of ​​this type of tool that I can use docker run praetorian-inc/gokart scan ...

    I even have something very similar here https://github.com/renanpalmeira/docker-protobufs/pkgs/container/protobuf

    on a daily basis I end up using it like this:

    docker run --rm \
        --name my-protos \
        -u $(id -u):$(id -u) \
        -v `pwd`:/code \
        ghcr.io/renanpalmeira/protobuf:latest \
            --proto_path=/code/protos \
            --go_out=plugins=grpc,paths=source_relative:/code/protos/gen \
            /code/protos/*.proto
    
  • Implement support for non-nil exit code

    Implement support for non-nil exit code

    Hi!

    To ease the use of this tool in automated systems such as CI/CD, and enable an optional failure mode on possible vulnerability findings, I suggest to implement a new boolean argument such as in #9 .

    With a non-nil exit code the CI/CD can stop pipelines and jobs easily when a potential vulnerability is found.

  • panic: err: go command required

    panic: err: go command required

    If go is not installed scan panics. Not a usual scenario.

    alexandre@localhost:~> gokart scan
    Using default analyzers config found at "~/.gokart/analyzers.yml".
    No existing analyzers.yml file found - writing default to ~/.gokart/analyzers.yml
    
    Revving engines VRMMM VRMMM
    3...2...1...Go!
    panic: err: go command required, not found: exec: "go": executable file not found in $PATH: stderr: 
    
    goroutine 1 [running]:
    github.com/praetorian-inc/gokart/analyzers.Scan(0xc000035f80, 0x1, 0x1)
    	/home/abuild/rpmbuild/BUILD/gokart-0.1.0/analyzers/scan.go:97 +0x135f
    github.com/praetorian-inc/gokart/cmd.glob..func1(0x55a77c40cc20, 0xc000035f80, 0x1, 0x1)
    	/home/abuild/rpmbuild/BUILD/gokart-0.1.0/cmd/scan.go:53 +0x1ca
    github.com/spf13/cobra.(*Command).execute(0x55a77c40cc20, 0x55a77c43fa00, 0x0, 0x0, 0x55a77c40cc20, 0x55a77c43fa00)
    	/home/abuild/rpmbuild/BUILD/gokart-0.1.0/vendor/github.com/spf13/cobra/command.go:860 +0x2c2
    github.com/spf13/cobra.(*Command).ExecuteC(0x55a77c40c9a0, 0xc000000180, 0xc00013bf78, 0x55a77bb9efc5)
    	/home/abuild/rpmbuild/BUILD/gokart-0.1.0/vendor/github.com/spf13/cobra/command.go:974 +0x375
    github.com/spf13/cobra.(*Command).Execute(...)
    	/home/abuild/rpmbuild/BUILD/gokart-0.1.0/vendor/github.com/spf13/cobra/command.go:902
    github.com/praetorian-inc/gokart/cmd.Execute(...)
    	/home/abuild/rpmbuild/BUILD/gokart-0.1.0/cmd/root.go:61
    main.main()
    	/home/abuild/rpmbuild/BUILD/gokart-0.1.0/main.go:38 +0x34
    

    Perhaps log.Fatal would make more sense in here as the analysis failed for some reason, I don't think anyone is going to recover from here.

  • Channel incorrectly identified as source of untrusted input

    Channel incorrectly identified as source of untrusted input

    Using v0.1.0 with the following program:

    package main
    
    import (
    	"io/ioutil"
    	"os"
    	"os/signal"
    	"syscall"
    )
    
    func output(filename string) {
    	ioutil.WriteFile(filename, []byte("foo"), 0644)
    }
    
    func main() {
    	filename := "foo" // not attacker controlled
    	sigs := make(chan os.Signal, 1)
    	done := make(chan bool)
    	signal.Notify(sigs, os.Interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
    
    	go func() {
    		<-sigs
    		done <- true
    	}()
    	go func() {
    		<-done
    		output(filename)
    	}()
    	output(filename)
    
    }
    
    
    $ gokart scan
    Using default analyzers config found at "~/.gokart/analyzers.yml".
    
    Revving engines VRMMM VRMMM
    3...2...1...Go!
    
    (Path Traversal) Danger: possible path traversal injection detected
    
    /home/stevie/gokart/foo.go:11
    Vulnerable Function: [ output(...) ]
          10:	func output(filename string) {
        > 11:		ioutil.WriteFile(filename, []byte("foo"), 0644)
          12:	}
    
    /home/stevie/gokart/foo.go:17
    Source of Untrusted Input: [ output(...) ]
          16:		sigs := make(chan os.Signal, 1)
        > 17:		done := make(chan bool)
          18:		signal.Notify(sigs, os.Interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
    ------------------------------------------------------------------------------
    
    Race Complete! Analysis took 177.741198ms and 72 Go files were scanned (including imported packages)
    GoKart found 1 potentially vulnerable functions
    
    

    Note that the channel done is identified as an untrusted input. If I remove the call to output from the goroutine

    @@ -23,7 +23,6 @@
     	}()
     	go func() {
     		<-done
    -		output(filename)
     	}()
     	output(filename)
    

    the scan (correctly) finds no problems:

    $ gokart scan
    Using default analyzers config found at "~/.gokart/analyzers.yml".
    
    Revving engines VRMMM VRMMM
    3...2...1...Go!
    
    Race Complete! Analysis took 203.734926ms and 72 Go files were scanned (including imported packages)
    GoKart found 0 potentially vulnerable functions
    
  • Improved config mgmt and fixed out of bounds panic

    Improved config mgmt and fixed out of bounds panic

    Changed the way the config is loaded to use defined structs instead of nested maps of interface{}. Now, the config is loaded into a struct during initialization and the values are referenced by the struct fields as appropriate. This refrains from reading and parsing the config file twice (once when loading the default sources and again when loading any analyzers.

    Additionally, this change adds a length check to fix the panic shown in https://github.com/praetorian-inc/gokart/issues/2

  • multi analyzers in analyzers.yml cause error

    multi analyzers in analyzers.yml cause error

    first i add some analyzers in yml image then, i add some debug code in generic.go

    func genericFunctionRun(pass *analysis.Pass, vulnPathFuncs map[string][]string,
    	name string, message string) (interface{}, error) {
    	fmt.Println(name, message) <- add debug code
            ...
    

    run gokart to scan a test project, and this project only has two files: go.mod, main.go

    gokart scan -i /foo/bar/analyzers.yml /foo/testproject/
    

    expect output:

    Revving engines VRMMM VRMMM
    3...2...1...Go!
    Test Sink1 test1
    Test Sink2 test2
    

    actual output:

    Revving engines VRMMM VRMMM
    3...2...1...Go!
    Test Sink2 test2
    Test Sink2 test2
    
  • Output clean-ups - Issues are reported multiple times.

    Output clean-ups - Issues are reported multiple times.

    Hi!

    Thanks for developing this awesome project. I was experimenting it today, and found an odd bug. When scanning Golang apps with finding.

    1. Source code line content is not shown on SARIF.

    2. When scanning vulnerable golang apps (https://github.com/0c34/govwa), there are findings on default and JSON format, and one finding on SARIF.

    3. Reporting on JSON is a bit hard to follow; it may need to be standardized into a single-document format instead of the current one. The JSON report has multiple JSON objects, one per each line, and then an invalid text (string). I also find that the findings are repeated. It may need to be reviewed.

    4. Untrusted sources are not shown on SARIF. It can be found on JSON output, but it's not there on SARIF.

  • Editor-friendly output format

    Editor-friendly output format

    This tool currently outputs both verbose and useless information directly into stdout, which makes using this in an automated fashion seem very hard:

    ―❤―▶ gokart scan . 2> /dev/null
    Using default analyzers config found at "~/.gokart/analyzers.yml".
    
    Revving engines VRMMM VRMMM
    3...2...1...Go!
    
    Uh oh, a dashboard light is on! GoKart was unable to load the following packages: 
    - "github.com/diamondburned/gotktrix/internal/app/emojiview"
    - "github.com/diamondburned/gotktrix/cmd/emoji-uploader"
    
    Race Complete! Analysis took 3.254922703s and 1261 Go files were scanned (including imported packages)
    GoKart found 0 potentially vulnerable functions
    

    I think it would be better for there to be a flag that makes gokart output only the information that the user actually cares about, similar to staticcheck:

    ―❤―▶ staticcheck ./...
    internal/gotktrix/internal/db/node.go:74:6: func convertPrefix is unused (U1000)
    internal/gotktrix/internal/db/node.go:78:6: func appendString is unused (U1000)
    internal/secret/secret.go:12:5: var drivers is unused (U1000)
    

    With staticcheck's format, I should be able to trivially add this tool into Vim.

  • GoKart panics in the `TaintAnalyzer`

    GoKart panics in the `TaintAnalyzer`

    When scanning a project, GoKart panics with the following trace when running the TaintAnalyzer:

    gokart scan
    Using config found at /home/smoyer1/.gokart/analyzers.yml
    
    Revving engines VRMMM VRMMM
    3...2...1...Go!
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x9ebf55]
    
    goroutine 1 [running]:
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc00235c210, 0x3?, 0xa, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:175 +0x3f5
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc00646a2e0, 0x0?, 0x9, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:200 +0x267b
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc00235cc10, 0x0?, 0x8, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:171 +0x1105
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc003cd81d0, 0xb70b90?, 0x7, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:163 +0x1816
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc006396d10, 0x0?, 0x6, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:141 +0x1fb2
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc0063b0e58, 0x0?, 0x5, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:232 +0x8b3
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc00235e030, 0x0?, 0x4, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:270 +0x1de9
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc00235e580, 0x3?, 0x3, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:212 +0x4ec
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc00235ea90, 0x4?, 0x2, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:200 +0x267b
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc0063c0460, 0x0?, 0x1, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:200 +0x267b
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaintRecurse(0xc00235f3f8, 0xc0063c4140, 0xc0063c60b0, 0x15?, 0x0, {0xc00235f2d8?, 0x0, 0x0})
            /home/smoyer1/git/gokart/util/taint.go:171 +0x1105
    github.com/praetorian-inc/gokart/util.(*TaintAnalyzer).ContainsTaint(...)
            /home/smoyer1/git/gokart/util/taint.go:62
    github.com/praetorian-inc/gokart/analyzers.ssrfRun(0xc0066043c0)
            /home/smoyer1/git/gokart/analyzers/ssrf.go:157 +0x6d5
    github.com/praetorian-inc/gokart/run.RunAnalyzers({0x1088f00, 0x5, 0xb70eab?}, 0xc000b95c80)
            /home/smoyer1/git/gokart/run/run.go:173 +0x502
    github.com/praetorian-inc/gokart/run.Run({0x1088f00, 0x5, 0x5}, {0xc00019b9c0?, 0x0?, 0x0?})
            /home/smoyer1/git/gokart/run/run.go:42 +0x11e
    github.com/praetorian-inc/gokart/analyzers.Scan({0xc00019b9c0?, 0x1, 0x1})
            /home/smoyer1/git/gokart/analyzers/scan.go:163 +0x5d8
    github.com/praetorian-inc/gokart/cmd.glob..func1(0x1090500?, {0x10c87a8, 0x0, 0x0})
            /home/smoyer1/git/gokart/cmd/scan.go:91 +0x42d
    github.com/spf13/cobra.(*Command).execute(0x1090500, {0x10c87a8, 0x0, 0x0})
            /home/smoyer1/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x663
    github.com/spf13/cobra.(*Command).ExecuteC(0x1090280)
            /home/smoyer1/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bd
    github.com/spf13/cobra.(*Command).Execute(...)
            /home/smoyer1/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
    github.com/praetorian-inc/gokart/cmd.Execute(...)
            /home/smoyer1/git/gokart/cmd/root.go:61
    main.main()
            /home/smoyer1/git/gokart/main.go:38 +0x25
    

    This occurs because the Pkg field of a function might be nil according to the code's comments, but no nil check is included:

    https://github.com/golang/tools/blob/b01e7a4e75d3f07db097384f829839c6628a46c8/go/ssa/ssa.go#L306-L317

    As an aside, the project producing this panic includes generics which might be related or at least sympathetic. If so, it's related to #72. Feel free to assign this to me as I've got both this issue and #72 fixed and running as expected against a project that contains generics.

  • Declare result types for analyzers.

    Declare result types for analyzers.

    This change declares each of the analyzers in the analyzers package to have a result type of []github.com/praetorian-inc/gokart/util.Finding.

    A test has also been included that runs a minimal *analysis.Pass through each analyzer's Run function, reflectively determines the type of the result value, and compares it to the declared result type of the analyzer.

    Resolves #76.

  • Analyzers do not set ResultType

    Analyzers do not set ResultType

    According to https://pkg.go.dev/golang.org/x/tools/go/analysis#Analyzer:

    type Analyzer struct {
    	// ...
    
    	// Run applies the analyzer to a package.
    	// It returns an error if the analyzer failed.
    	//
    	// On success, the Run function may return a result
    	// computed by the Analyzer; its type must match ResultType.
    	// The driver makes this result available as an input to
    	// another Analyzer that depends directly on this one (see
    	// Requires) when it analyzes the same package.
    	//
    	// To pass analysis results between packages (and thus
    	// potentially between address spaces), use Facts, which are
    	// serializable.
    	Run func(*[Pass](https://pkg.go.dev/golang.org/x/tools/go/analysis#Pass)) (interface{}, [error](https://pkg.go.dev/builtin#error))
    
    	// ...
    
    	// ResultType is the type of the optional result of the Run function.
    	ResultType [reflect](https://pkg.go.dev/reflect).[Type](https://pkg.go.dev/reflect#Type)
    
    	// ...
    }
    

    Because of this, the analyzers fail to run:

    analyzer "command_injection" failed: internal error: on package github.com/jcmturner/gokrb5/v8/iana, analyzer command_injection returned a result of type []util.Finding, but declared ResultType <nil>
    
  • Generics support

    Generics support

    When I scan a repo using Go 1.18 generics, gokart panics with the message: zeroConst: unexpected T.

    For reference, the only function in the repo using generics is as follows:

    func mapSlice[T any, M any](a []T, f func(T) M) []M {
    	n := make([]M, len(a))
    	for i, e := range a {
    		n[i] = f(e)
    	}
    	return n
    }
    

    It looks like x/tools/go/ssa is still waiting on generics support. I'm raising this here as a reference and reminder to check that analysis of generics works once that package is fixed.

This static analysis tool works to ensure your program's data flow does not spill beyond its banks.

Go Flow Levee This static analysis tool works to ensure your program's data flow does not spill beyond its banks. An input program's data flow is expl

Dec 1, 2022
A Golang tool that does static analysis, unit testing, code review and generate code quality report.
A Golang tool that does static analysis, unit testing, code review and generate code quality report.

goreporter A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs

Jan 8, 2023
Analyzer: zapvet is static analysis tool for zap

zapvet zapvet is static analysis tool for zap. fieldtype: fieldtype finds confliction type of field Install You can get zapvet by go install command (

Sep 18, 2022
Retnilnil is a static analysis tool to detect `return nil, nil`

retnilnil retnilnil is a static analysis tool for Golang that detects return nil, nil in functions with (*T, error) as the return type. func f() (*T,

Jun 9, 2022
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

reviewdog - A code review dog who keeps your codebase healthy. reviewdog provides a way to post review comments to code hosting service, such as GitHu

Jan 2, 2023
[mirror] Performance measurement, storage, and analysis.

Go performance measurement, storage, and analysis tools This subrepository holds the source for various packages and tools related to performance meas

Dec 24, 2022
a simple golang SSA viewer tool use for code analysis or make a linter
a simple golang SSA viewer tool use for code analysis or make a linter

ssaviewer A simple golang SSA viewer tool use for code analysis or make a linter ssa.html generate code modify from src/cmd/compile/internal/ssa/html.

May 17, 2022
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

reviewdog - A code review dog who keeps your codebase healthy. reviewdog provides a way to post review comments to code hosting service, such as GitHu

Jan 7, 2023
Tool: ptrls prints result of pointer analysis

ptrls Install $ go install github.com/gostaticanalysis/ptrls/cmd/ptrls@latest Usage $ cd testdata/a $ cat a.go package main func main() { f(map[str

Feb 1, 2022
🔒🌍 Security scanner for your Terraform code
🔒🌍 Security scanner for your Terraform code

????tfsec uses static analysis of your terraform templates to spot potential security issues.

Dec 30, 2022
Catalyst is an incident response platform / SOAR (Security Orchestration, Automation and Response) system.
Catalyst is an incident response platform / SOAR (Security Orchestration, Automation and Response) system.

Catalyst Speed up your reactions Website - The Catalyst Handbook (Documentation) - Try online (user: bob, password: bob) Catalyst is an incident respo

Jan 6, 2023
A static code analyzer for annotated TODO comments
A static code analyzer for annotated TODO comments

todocheck todocheck is a static code analyzer for annotated TODO comments. It let's you create actionable TODOs by annotating them with issues from an

Dec 7, 2022
structslop is a static analyzer for Go that recommends struct field rearrangements to provide for maximum space/allocation efficiency.

structslop Package structslop defines an Analyzer that checks struct can be re-arranged fields to get optimal struct size.

Dec 28, 2022
Go-perfguard - A static analyzer with emphasis on performance

perfguard This tool is a work in progress. It's not production-ready yet. perfgu

Dec 28, 2022
mesh-kridik is an open-source security scanner that performs various security checks on a Kubernetes cluster with istio service mesh and is leveraged by OPA (Open Policy Agent) to enforce security rules.
mesh-kridik is an open-source security scanner that performs various security checks on a Kubernetes cluster with istio service mesh and is leveraged by OPA (Open Policy Agent) to enforce security rules.

mesh-kridik Enhance your Kubernetes service mesh security !! mesh-kridik is an open-source security scanner that performs various security checks on a

Dec 14, 2022
Vilicus is an open source tool that orchestrates security scans of container images(docker/oci) and centralizes all results into a database for further analysis and metrics.
Vilicus is an open source tool that orchestrates security scans of container images(docker/oci) and centralizes all results into a database for further analysis and metrics.

Vilicus Table of Contents Overview How does it work? Architecture Development Run deployment manually Usage Example of analysis Overview Vilicus is an

Dec 6, 2022
APKrash is an Android APK security analysis toolkit focused on comparing APKs to detect tampering and repackaging.
 APKrash is an Android APK security analysis toolkit focused on comparing APKs to detect tampering and repackaging.

APKrash APKrash is an Android APK security analysis toolkit focused on comparing APKs to detect tampering and repackaging. Features Able to analyze pu

Nov 8, 2022
Serverless SOAR (Security Orchestration, Automation and Response) framework for automatic inspection and evaluation of security alert
Serverless SOAR (Security Orchestration, Automation and Response) framework for automatic inspection and evaluation of security alert

DeepAlert DeepAlert is a serverless framework for automatic response of security alert. Overview DeepAlert receives a security alert that is event of

Jan 3, 2023