Skip to content

Commit 5051652

Browse files
authored
Merge pull request #7 from psiinon/main
Use default user instead of root
2 parents f1aabeb + 6479134 commit 5051652

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ All notable changes to this GitHub action will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## [Unreleased]
7+
## [0.1.1] - 2022-05-23
8+
9+
### Fixed
10+
- Use default zap user rather than root.
811

912
## [0.1.0] - 2021-09-14
1013

1114
First release to Marketplace.
1215

13-
[Unreleased]: https://github.com/zaproxy/action-api-scan/compare/v0.1.0...HEAD
16+
[0.1.1]: https://github.com/zaproxy/action-api-scan/compare/v0.1.0...v0.1.1
1417
[0.1.0]: https://github.com/zaproxy/action-api-scan/compare/12a34c296c603f7505336a7fc750363fa978d93e...v0.1.0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if it identifies any alerts. Set this option to `true` if you want to fail the s
6464
```
6565
steps:
6666
- name: ZAP Scan
67-
uses: zaproxy/[email protected].0
67+
uses: zaproxy/[email protected].1
6868
with:
6969
target: 'https://www.zaproxy.org/'
7070
```
@@ -85,7 +85,7 @@ jobs:
8585
ref: master
8686
8787
- name: ZAP Scan
88-
uses: zaproxy/[email protected].0
88+
uses: zaproxy/[email protected].1
8989
with:
9090
token: ${{ secrets.GITHUB_TOKEN }}
9191
docker_name: 'owasp/zap2docker-stable'

dist/index.js

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

3830+
// Create the files so we can change the perms and allow the docker non root user to update them
3831+
await exec.exec(`touch ${jsonReportName} ${mdReportName} ${htmlReportName}`);
3832+
await exec.exec(`chmod a+w ${jsonReportName} ${mdReportName} ${htmlReportName}`);
3833+
38303834
await exec.exec(`docker pull ${docker_name} -q`);
3831-
let command = (`docker run --user root -v ${workspace}:/zap/wrk/:rw --network="host" ` +
3835+
let command = (`docker run -v ${workspace}:/zap/wrk/:rw --network="host" ` +
38323836
`-t ${docker_name} zap-api-scan.py -t ${target} -f ${format} -J ${jsonReportName} -w ${mdReportName} -r ${htmlReportName} ${cmdOptions}`);
38333837

38343838
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-api-scan.py -t ${target} -f ${format} -J ${jsonReportName} -w ${mdReportName} -r ${htmlReportName} ${cmdOptions}`);
4650

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

0 commit comments

Comments
 (0)