From 6b088e36d38a32b99b264b056c06e53e2fbe15f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Fri, 17 May 2024 08:12:48 +0200 Subject: [PATCH] snyk: explicitly enable networking for snyk client execution ... in the chroot. Otherwise, it is going to fail. Related: https://issues.redhat.com/browse/OSH-69 --- py/plugins/snyk.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py/plugins/snyk.py b/py/plugins/snyk.py index cef38ad..517d6a6 100644 --- a/py/plugins/snyk.py +++ b/py/plugins/snyk.py @@ -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)