Skip to content

Commit

Permalink
Merge pull request #77 from psiinon/master
Browse files Browse the repository at this point in the history
Use default user instead of root
  • Loading branch information
thc202 authored May 23, 2022
2 parents b7a326e + 216bdd8 commit 63e24b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 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
- Use default zap user rather than root to allow the Ajax Spider to run.

## [0.6.1] - 2021-10-08
### Changed
- Revert previous change (not into effect), no longer needed.
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3859,8 +3859,12 @@ 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}`);

await exec.exec(`docker pull ${docker_name} -q`);
let command = (`docker run --user root -v ${workspace}:/zap/wrk/:rw --network="host" ` +
let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" ` +
`-t ${docker_name} zap-baseline.py -t ${target} -J ${jsonReportName} -w ${mdReportName} -r ${htmlReportName} ${cmdOptions}`);

if (plugins.length !== 0) {
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ 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}`);

await exec.exec(`docker pull ${docker_name} -q`);
let command = (`docker run --user root -v ${workspace}:/zap/wrk/:rw --network="host" ` +
let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" ` +
`-t ${docker_name} zap-baseline.py -t ${target} -J ${jsonReportName} -w ${mdReportName} -r ${htmlReportName} ${cmdOptions}`);

if (plugins.length !== 0) {
Expand Down

0 comments on commit 63e24b9

Please sign in to comment.