Skip to content

Commit

Permalink
Merge pull request #37 from thc202/write-all-dir
Browse files Browse the repository at this point in the history
Allow to write any file to the workspace
  • Loading branch information
kingthorin authored Jun 6, 2024
2 parents 20577ca + 2a23248 commit f48fba2
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 @@ -8,6 +8,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. [#22](https://github.com/zaproxy/action-api-scan/issues/22)

## [0.7.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 @@ -59638,9 +59638,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 @@ -47,9 +47,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 f48fba2

Please sign in to comment.