Skip to content

Commit

Permalink
Allow to write any file to the workspace
Browse files Browse the repository at this point in the history
Support any file not just the default reports (e.g. ZAP plan created by
the baseline scan).

Fix #118.

Signed-off-by: thc202 <[email protected]>
  • Loading branch information
thc202 committed Apr 22, 2024
1 parent f40b787 commit 809942e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. [#118](https://github.com/zaproxy/action-baseline/issues/118)

## [0.12.0] - 2024-04-02
### Changed
- Update dependencies.
Expand Down
5 changes: 2 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59637,9 +59637,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 ` +
Expand Down
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,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 ` +
Expand Down

0 comments on commit 809942e

Please sign in to comment.