forked from securego/gosec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
22 changed files
with
645 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
language: go | ||
before_script: | ||
- go vet $(go list ./... | grep -v /vendor/) | ||
|
||
go: | ||
- 1.5 | ||
- 1.7 | ||
- 1.8 | ||
- 1.9 | ||
- tip | ||
|
||
install: | ||
- go get -u github.com/golang/lint/golint | ||
- go get -v github.com/onsi/ginkgo/ginkgo | ||
- go get -v github.com/onsi/gomega | ||
- go get -v golang.org/x/crypto/ssh | ||
- go get github.com/GoASTScanner/gas/cmd/gas/... | ||
- go get -v -t ./... | ||
- export PATH=$PATH:$HOME/gopath/bin | ||
|
||
before_script: | ||
- test -z "$(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)" | ||
- test -z "$(golint . | tee /dev/stderr)" | ||
- go vet $(go list ./... | grep -v /vendor/) | ||
- gas ./... | ||
|
||
script: ginkgo -r | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"sort" | ||
|
||
"github.com/GoASTScanner/gas" | ||
) | ||
|
||
type sortBySeverity []*gas.Issue | ||
|
||
func (s sortBySeverity) Len() int { return len(s) } | ||
|
||
func (s sortBySeverity) Less(i, j int) bool { return s[i].Severity > s[i].Severity } | ||
|
||
func (s sortBySeverity) Swap(i, j int) { s[i], s[j] = s[j], s[i] } | ||
|
||
// sortIssues sorts the issues by severity in descending order | ||
func sortIssues(issues []*gas.Issue) { | ||
sort.Sort(sortBySeverity(issues)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package main | ||
|
||
import "text/template" | ||
|
||
var generatedHeaderTmpl = template.Must(template.New("generated").Parse(` | ||
package {{.}} | ||
import ( | ||
"go/ast" | ||
"github.com/GoASTScanner/gas" | ||
) | ||
`)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package main | ||
|
||
import "text/template" | ||
|
||
var generatedRuleTmpl = template.Must(template.New("generated").Parse(` | ||
// New{{.Name}}TLSCheck creates a check for {{.Name}} TLS ciphers | ||
// DO NOT EDIT - generated by tlsconfig tool | ||
func New{{.Name}}TLSCheck(conf gas.Config) (gas.Rule, []ast.Node) { | ||
return &insecureConfigTLS{ | ||
requiredType: "crypto/tls.Config", | ||
MinVersion: {{ .MinVersion }}, | ||
MaxVersion: {{ .MaxVersion }}, | ||
goodCiphers: []string{ | ||
{{range $cipherName := .Ciphers }} "{{$cipherName}}", | ||
{{end}} | ||
}, | ||
}, []ast.Node{(*ast.CompositeLit)(nil)} | ||
} | ||
`)) |
Oops, something went wrong.