diff --git a/CHANGELOG.md b/CHANGELOG.md index 939fef7..e9b9441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Update dependencies. +### Fixed +- Allow to write any file from the Docker container. + ## [0.10.0] - 2024-04-02 ### Changed - Update dependencies. diff --git a/dist/index.js b/dist/index.js index c17f57d..f2f8fc2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -59636,9 +59636,8 @@ async function run() { plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`); } - // Create the files so we can change the perms and allow the docker non root user to update them - await exec.exec(`touch ${jsonReportName} ${mdReportName} ${htmlReportName}`); - await exec.exec(`chmod a+w ${jsonReportName} ${mdReportName} ${htmlReportName}`); + // Allow writing files from the Docker container. + await exec.exec(`chmod a+w ${workspace}`); await exec.exec(`docker pull ${docker_name} -q`); let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" -e ZAP_AUTH_HEADER -e ZAP_AUTH_HEADER_VALUE -e ZAP_AUTH_HEADER_SITE ` + diff --git a/index.js b/index.js index 7318873..167f6ed 100644 --- a/index.js +++ b/index.js @@ -45,9 +45,8 @@ async function run() { plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`); } - // Create the files so we can change the perms and allow the docker non root user to update them - await exec.exec(`touch ${jsonReportName} ${mdReportName} ${htmlReportName}`); - await exec.exec(`chmod a+w ${jsonReportName} ${mdReportName} ${htmlReportName}`); + // Allow writing files from the Docker container. + await exec.exec(`chmod a+w ${workspace}`); await exec.exec(`docker pull ${docker_name} -q`); let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" -e ZAP_AUTH_HEADER -e ZAP_AUTH_HEADER_VALUE -e ZAP_AUTH_HEADER_SITE ` +