diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 706d10b..9e7ec92 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -23,6 +23,8 @@ jobs: uses: actions/checkout@v2 - name: Run Go Security uses: securego/gosec@master + with: + args: ./... malware_security_scan: name: Malware Scanner runs-on: ubuntu-latest diff --git a/inttests/common.go b/inttests/common.go index a18475d..785ee8a 100644 --- a/inttests/common.go +++ b/inttests/common.go @@ -19,9 +19,9 @@ package inttests import ( - "math/rand" + "crypto/rand" + "math/big" "testing" - "time" ) func checkAPIErr(t *testing.T, err error) { @@ -40,10 +40,14 @@ func skipTestOnError(t *testing.T, err error) { const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" func randString(n int) string { - rand.Seed(time.Now().UnixNano()) b := make([]byte, n) for i := range b { - b[i] = letters[rand.Intn(len(letters))] + if len(letters) > 0 { + n, err := rand.Int(rand.Reader, big.NewInt(int64(len(letters)))) + if err == nil { + b[i] = letters[n.Int64()] + } + } } return string(b) }