gosec analyzer cannot run due to GOPATH issue |
||||
Issue descriptionExample run: https://tricium-dev.appspot.com/run/5187624759197696 https://chromium-swarm.appspot.com/task?id=417961de3501a810 Log excerpt: Executing command: /b/s/w/ir/bin/gosec [-fmt json go/example.go] Error decoding gosec json output: EOF Worker quitting Local test run: $ gosec go/example.go [gosec] 2018/11/29 10:13:30 including rules: default [gosec] 2018/11/29 10:13:30 excluding rules: default 2018/11/29 10:13:30 go/example.go is not within the $GOPATH and cannot be processed I also tried `GOPATH="$GOPATH:$(pwd)" gosec imported.go` with the same result. This may be related to https://github.com/securego/gosec/issues/234.
,
Nov 29
,
Nov 29
The following revision refers to this bug: https://chromium.googlesource.com/infra/infra/+/e9ee079a575c303281a50c1d1bc5fa8e484ce725 commit e9ee079a575c303281a50c1d1bc5fa8e484ce725 Author: Felix Matenaar <fmatenaar@chromium.org> Date: Thu Nov 29 19:22:16 2018 [tricium] Setting GOPATH when running gosec analyzer. Gosec requires the target files to be within GOPATH. This change sets GOPATH to the target root directory. R=qyearsley@chromium.org BUG= 910231 Change-Id: Iaa5097c52a50bc7b360dea1758928e5441e505b3 Reviewed-on: https://chromium-review.googlesource.com/c/1354188 Reviewed-by: Quinten Yearsley <qyearsley@chromium.org> Commit-Queue: Felix Matenaar <fmatenaar@chromium.org> Cr-Commit-Position: refs/heads/master@{#19242} [rename] https://crrev.com/e9ee079a575c303281a50c1d1bc5fa8e484ce725/go/src/infra/tricium/functions/gosec/test/src/example/example.go [rename] https://crrev.com/e9ee079a575c303281a50c1d1bc5fa8e484ce725/go/src/infra/tricium/functions/gosec/test/src/example/example3.go [rename] https://crrev.com/e9ee079a575c303281a50c1d1bc5fa8e484ce725/go/src/infra/tricium/functions/gosec/test/src/example/example2.go [modify] https://crrev.com/e9ee079a575c303281a50c1d1bc5fa8e484ce725/go/src/infra/tricium/functions/gosec/gosec_wrapper.go [modify] https://crrev.com/e9ee079a575c303281a50c1d1bc5fa8e484ce725/go/src/infra/tricium/functions/gosec/test/tricium/data/files.json
,
Nov 29
The following revision refers to this bug: https://chromium.googlesource.com/infra/infra/+/3762984f7b38fe0f7295b23306ea6114baec3198 commit 3762984f7b38fe0f7295b23306ea6114baec3198 Author: Felix Matenaar <fmatenaar@chromium.org> Date: Thu Nov 29 22:55:06 2018 [tricium] Gosec tricium analyzer change to produce relative file paths Tricium expects the analysis output to contain relative file paths instead of absolute ones. This CL changes the behavior to comply with tricium's relative file paths. TBR=qyearsley Bug: 910231 Change-Id: Ied9c799f9103e4e3060776ee39bf42e69e18597a Reviewed-on: https://chromium-review.googlesource.com/c/1356061 Commit-Queue: Felix Matenaar <fmatenaar@chromium.org> Reviewed-by: Felix Matenaar <fmatenaar@chromium.org> Cr-Commit-Position: refs/heads/master@{#19258} [modify] https://crrev.com/3762984f7b38fe0f7295b23306ea6114baec3198/go/src/infra/tricium/functions/gosec/gosec_wrapper.go
,
Nov 29
,
Nov 29
,
Dec 3
The following revision refers to this bug: https://chromium.googlesource.com/infra/infra/+/07fed1ce300438d7c81c83092543816503d749f4 commit 07fed1ce300438d7c81c83092543816503d749f4 Author: Felix Matenaar <fmatenaar@chromium.org> Date: Mon Dec 03 21:12:15 2018 Setting GOPATH when running gosec [Tricium] Gosec wrapper GOPATH emulation Gosec requires src/packages/... directory structure compliant with the Go package convention. This CL is a workaround creating the required directory structure and symlinking to the target files within that structure such that Gosec executes properly. R=qyearsley@google.com BUG= 910231 Change-Id: I36061bd321067e66e68407e7c8d0e94b7317a8ca Reviewed-on: https://chromium-review.googlesource.com/c/1356851 Reviewed-by: Felix Matenaar <fmatenaar@chromium.org> Reviewed-by: Quinten Yearsley <qyearsley@chromium.org> Commit-Queue: Felix Matenaar <fmatenaar@chromium.org> Cr-Commit-Position: refs/heads/master@{#19297} [modify] https://crrev.com/07fed1ce300438d7c81c83092543816503d749f4/go/src/infra/tricium/functions/gosec/gosec_wrapper.go [modify] https://crrev.com/07fed1ce300438d7c81c83092543816503d749f4/go/src/infra/tricium/functions/gosec/gosec_wrapper_test.go |
||||
►
Sign in to add a comment |
||||
Comment 1 by fmatenaar@chromium.org
, Nov 29