Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkg/cli/poutine.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func runPoutineOnDirectory(workflowDir string, verbose bool, strict bool) error
}

// Build the Docker command with JSON output for easier parsing
// docker run --rm -v "$(pwd)":/workdir -w /workdir ghcr.io/boostsecurityio/poutine:latest analyze_local . --format json
// docker run --rm -v "$(pwd)":/workdir -w /workdir <PoutineImage> analyze_local . --format json
// #nosec G204 -- gitRoot comes from git rev-parse (trusted source) and is validated as absolute path
// exec.Command with separate args (not shell execution) prevents command injection
volumeMount, err := buildDockerVolumeMount(gitRoot, "/workdir")
Expand All @@ -112,7 +112,7 @@ func runPoutineOnDirectory(workflowDir string, verbose bool, strict bool) error
"--rm",
"-v", volumeMount,
"-w", "/workdir",
"ghcr.io/boostsecurityio/poutine:latest",
PoutineImage,
"analyze_local",
".",
"--format", "json",
Expand All @@ -130,7 +130,7 @@ func runPoutineOnDirectory(workflowDir string, verbose bool, strict bool) error
"--rm",
"-v", volumeMount,
"-w", "/workdir",
"ghcr.io/boostsecurityio/poutine:latest",
PoutineImage,
"analyze_local",
".",
"--format", "json",
Expand Down Expand Up @@ -215,7 +215,7 @@ func runPoutineOnFile(lockFile string, verbose bool, strict bool) error {
}

// Build the Docker command with JSON output for easier parsing
// docker run --rm -v "$(pwd)":/workdir -w /workdir ghcr.io/boostsecurityio/poutine:latest analyze_local . --format json
// docker run --rm -v "$(pwd)":/workdir -w /workdir <PoutineImage> analyze_local . --format json
// #nosec G204 -- gitRoot comes from git rev-parse (trusted source) and is validated as absolute path
// exec.Command with separate args (not shell execution) prevents command injection
volumeMount, err := buildDockerVolumeMount(gitRoot, "/workdir")
Expand All @@ -232,7 +232,7 @@ func runPoutineOnFile(lockFile string, verbose bool, strict bool) error {
"--rm",
"-v", volumeMount,
"-w", "/workdir",
"ghcr.io/boostsecurityio/poutine:latest",
PoutineImage,
"analyze_local",
".",
"--format", "json",
Expand All @@ -250,7 +250,7 @@ func runPoutineOnFile(lockFile string, verbose bool, strict bool) error {
"--rm",
"-v", volumeMount,
"-w", "/workdir",
"ghcr.io/boostsecurityio/poutine:latest",
PoutineImage,
"analyze_local",
".",
"--format", "json",
Expand Down
9 changes: 9 additions & 0 deletions pkg/cli/poutine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,12 @@ func TestEnsurePoutineConfig(t *testing.T) {
}
})
}

func TestPoutineImageIsPinnedByDigest(t *testing.T) {
if _, err := validateDockerImageRef(PoutineImage); err != nil {
t.Fatalf("PoutineImage %q failed docker image reference validation: %v", PoutineImage, err)
}
if !strings.Contains(PoutineImage, "@sha256:") {
Comment on lines +364 to +368
t.Errorf("PoutineImage must be pinned by digest, got %q", PoutineImage)
}
}
Loading