Skip to content

Commit 63e24b9

Browse files
authored
Merge pull request #77 from psiinon/master
Use default user instead of root
2 parents b7a326e + 216bdd8 commit 63e24b9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
### Changed
88
- Update dependencies.
99

10+
### Fixed
11+
- Use default zap user rather than root to allow the Ajax Spider to run.
12+
1013
## [0.6.1] - 2021-10-08
1114
### Changed
1215
- Revert previous change (not into effect), no longer needed.

dist/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3859,8 +3859,12 @@ async function run() {
38593859
plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`);
38603860
}
38613861

3862+
// Create the files so we can change the perms and allow the docker non root user to update them
3863+
await exec.exec(`touch ${jsonReportName} ${mdReportName} ${htmlReportName}`);
3864+
await exec.exec(`chmod a+w ${jsonReportName} ${mdReportName} ${htmlReportName}`);
3865+
38623866
await exec.exec(`docker pull ${docker_name} -q`);
3863-
let command = (`docker run --user root -v ${workspace}:/zap/wrk/:rw --network="host" ` +
3867+
let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" ` +
38643868
`-t ${docker_name} zap-baseline.py -t ${target} -J ${jsonReportName} -w ${mdReportName} -r ${htmlReportName} ${cmdOptions}`);
38653869

38663870
if (plugins.length !== 0) {

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ async function run() {
4040
plugins = await common.helper.processLineByLine(`${workspace}/${rulesFileLocation}`);
4141
}
4242

43+
// Create the files so we can change the perms and allow the docker non root user to update them
44+
await exec.exec(`touch ${jsonReportName} ${mdReportName} ${htmlReportName}`);
45+
await exec.exec(`chmod a+w ${jsonReportName} ${mdReportName} ${htmlReportName}`);
46+
4347
await exec.exec(`docker pull ${docker_name} -q`);
44-
let command = (`docker run --user root -v ${workspace}:/zap/wrk/:rw --network="host" ` +
48+
let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" ` +
4549
`-t ${docker_name} zap-baseline.py -t ${target} -J ${jsonReportName} -w ${mdReportName} -r ${htmlReportName} ${cmdOptions}`);
4650

4751
if (plugins.length !== 0) {

0 commit comments

Comments
 (0)