globocom / huskyCI

Performing security tests inside your CI
https://huskyci.opensource.globo.com
BSD 3-Clause "New" or "Revised" License
572 stars 137 forks source link

Local setup fails starting API due to non-unique hmac #526

Closed darkspirit510 closed 3 years ago

darkspirit510 commented 3 years ago

Hi all, I ran make install, sourced the env file and tried make run-client. This failed with: [HUSKYCI][ERROR] Sending request to huskyCI: Post "http://localhost:8888/analysis": dial tcp [::1]:8888: connect: connection refused. I checked for missing/stopped Docker containers and found a Exited API. The logs of the API contains the following error:

panic: crypto/hmac: hash generation function does not produce unique values

goroutine 1 [running]:
crypto/hmac.New(0xc0005cdbf0, 0xc0004d88d0, 0xf, 0x10, 0x0, 0x10)
    /usr/local/go/src/crypto/hmac/hmac.go:143 +0x370
golang.org/x/crypto/pbkdf2.Key(0xc0004d88d0, 0xf, 0x10, 0xc0003ee4c0, 0x40, 0x40, 0x186a0, 0x200, 0xc0005cdbf0, 0x0, ...)
    /go/pkg/mod/golang.org/x/crypto@v0.0.0-20200510223506-06a226fb4e37/pbkdf2/pbkdf2.go:43 +0x67
github.com/globocom/huskyCI/api/user.InsertDefaultUser(0xa28e60, 0xc00019c000)
    /go/src/github.com/globocom/huskyCI/api/user/user.go:58 +0x333
github.com/globocom/huskyCI/api/util/api.(*CheckUtils).checkDefaultUser(0xce2678, 0xc000022380, 0x98a011, 0x8)
    /go/src/github.com/globocom/huskyCI/api/util/api/api.go:139 +0x158
github.com/globocom/huskyCI/api/util/api.HuskyUtils.CheckHuskyRequirements(0xa33258, 0xce2678, 0xc000022380, 0x6, 0xb)
    /go/src/github.com/globocom/huskyCI/api/util/api/api.go:47 +0x22c
main.main()
    /go/src/github.com/globocom/huskyCI/api/server.go:46 +0x1ff

Is this a known issue or a misconfiguration on my side? (I did not see any required configuration in the quick start guide)

Platform: Docker version 20.10.2, build 2291f61, macOS 11.2.2 (20D80), go version go1.16 darwin/amd64

darkspirit510 commented 3 years ago

Update: Fresh installation of LTS Ubuntu server (20.04), only installed golang via apt install golang (1.13) and followed setup guide - same error/panic.