1
0
mirror of https://github.com/securego/gosec.git synced 2025-06-16 23:47:51 +02:00

Add sha1 to weak crypto primitives

This commit is contained in:
Cosmin Cojocar
2018-08-08 16:38:57 +02:00
parent 90a1c1d625
commit fb0dc73a96
5 changed files with 56 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/securego/gosec"
"github.com/securego/gosec/rules"
"github.com/securego/gosec/testutils"
@ -110,6 +111,10 @@ var _ = Describe("gosec rules", func() {
runner("G401", testutils.SampleCodeG401)
})
It("should detect weak crypto algorithms", func() {
runner("G401", testutils.SampleCodeG401b)
})
It("should find insecure tls settings", func() {
runner("G402", testutils.SampleCodeG402)
})
@ -137,6 +142,9 @@ var _ = Describe("gosec rules", func() {
It("should detect blacklisted imports - CGI (httpoxy)", func() {
runner("G504", testutils.SampleCodeG504)
})
It("should detect blacklisted imports - SHA1", func() {
runner("G505", testutils.SampleCodeG505)
})
})