Skip to content

Commit 9b2ee6e

Browse files
committed
feat: container scan support for cgo and stripped Go binaries
test: add acceptance test for container cgo/stripped Go binaries
1 parent 343ec4b commit 9b2ee6e

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"semver": "^6.0.0",
118118
"snyk-config": "^5.0.0",
119119
"snyk-cpp-plugin": "2.24.1",
120-
"snyk-docker-plugin": "8.12.2",
120+
"snyk-docker-plugin": "8.13.0",
121121
"snyk-go-plugin": "1.28.0",
122122
"snyk-gradle-plugin": "5.1.1",
123123
"snyk-module": "3.1.0",
Binary file not shown.

test/jest/acceptance/snyk-container/container.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,19 @@ describe('snyk container', () => {
156156
expect(code).toEqual(1);
157157
}, 30000);
158158

159+
it('detects stripped Go binaries and reports fleet-server dependencies', async () => {
160+
const { code, stdout } = await runSnykCLI(
161+
`container test docker-archive:test/fixtures/container-projects/stripped-go-binaries-minimal.tar.gz --json`,
162+
);
163+
const jsonOutput = JSON.parse(stdout);
164+
165+
const goModulesResults = jsonOutput.applications?.find((app) =>
166+
app.targetFile?.includes('fleet-server'),
167+
);
168+
expect(code).toEqual(1);
169+
expect(goModulesResults).toBeDefined();
170+
});
171+
159172
it('npm depGraph is generated in an npm image with lockfiles', async () => {
160173
const { code, stdout, stderr } = await runSnykCLIWithDebug(
161174
`container test docker-archive:test/fixtures/container-projects/npm7-with-package-lock-file.tar --print-deps`,

0 commit comments

Comments
 (0)