gosec: G204 - Subproccess launched as function arg

G204 doesn't necessarily indicate a bad behaviour. But could help
discover potential command injection vector.
This commit is contained in:
Juan Abia 2021-12-01 08:57:36 +01:00 committed by Alexander Todorov
parent 0b9372fe0a
commit eb3fa3e5d4
4 changed files with 12 additions and 1 deletions

View file

@ -270,6 +270,8 @@ func getComposeStatus(t *testing.T, uuid uuid.UUID) string {
}
func getLogs(t *testing.T, uuid uuid.UUID) string {
// There's no potential command injection vector here
/* #nosec G204 */
cmd := exec.Command("composer-cli", "compose", "log", uuid.String())
cmd.Stderr = os.Stderr
stdoutReader, err := cmd.StdoutPipe()

View file

@ -196,6 +196,8 @@ func TestKojiImport(t *testing.T) {
require.NoError(t, err)
// check if the build is really there:
// There's no potential command injection vector here
/* #nosec G204 */
cmd := exec.Command(
"koji",
"--server", server,