Skip to content

Commit

Permalink
snyk: explicitly enable networking for snyk client execution
Browse files Browse the repository at this point in the history
... in the chroot.  Otherwise, it is going to fail.

Related: https://issues.redhat.com/browse/OSH-69
  • Loading branch information
lzaoral committed May 17, 2024
1 parent 7d47a88 commit 6b088e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion py/plugins/snyk.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ def scan_hook(results, mock, props):
# wrap snyk invocation by timeout(1)
cmd = f"/usr/bin/timeout {args.snyk_timeout} {cmd}"

# snyk requires network connection in the chroot
mock_cmd = ["--enable-network", "--chroot", cmd]

# run snyk code
ec = mock.exec_chroot_cmd(cmd)
ec = mock.exec_mock_cmd(mock_cmd)

# remove authentication token from the chroot
mock.exec_chroot_cmd("/bin/rm -fv %s" % auth_token_dst)
Expand Down

0 comments on commit 6b088e3

Please sign in to comment.