Repository navigation
Conversation
Adds a shell script that downloads a ZAP XML report from a remote ZAP instance via its REST API and saves it to the results/ directory. This enables scorecard generation when ZAP and Benchmark run in separate Docker containers without a shared filesystem. Closes #21
- Add mkdir -p results/ before curl writes to it (fixes failure on fresh clone) - Pass API key via X-ZAP-API-Key header instead of URL query param (keeps key out of process list and shell history) - Redirect all error/usage output to stderr - Validate getBenchmarkVersion.sh output is non-empty before building filename
Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson-databind) from 2.22.4 to 2.23.0. - [Commits](FasterXML/jackson-databind@jackson-databind-2.22.4...jackson-databind-2.23.0) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.23.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…t/maven/com.fasterxml.jackson.core-jackson-databind-2.23.0 Bump com.fasterxml.jackson.core:jackson-databind from 2.22.4 to 2.23.0
…-zap-results-from-url-21 Add fetchZAPResults.sh script to download ZAP reports from a URL
Bumps [org.apache.maven.plugins:maven-help-plugin](https://github.com/apache/maven-help-plugin) from 3.5.2 to 3.6.0. - [Release notes](https://github.com/apache/maven-help-plugin/releases) - [Commits](apache/maven-help-plugin@maven-help-plugin-3.5.2...maven-help-plugin-3.6.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-help-plugin dependency-version: 3.6.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…t/maven/org.apache.maven.plugins-maven-help-plugin-3.6.0 Bump org.apache.maven.plugins:maven-help-plugin from 3.5.2 to 3.6.0
Bumps [org.apache.httpcomponents.core5:httpcore5](https://github.com/apache/httpcomponents-core) from 5.4.4 to 5.5. - [Changelog](https://github.com/apache/httpcomponents-core/blob/master/RELEASE_NOTES.txt) - [Commits](apache/httpcomponents-core@rel/v5.4.4...rel/v5.5) --- updated-dependencies: - dependency-name: org.apache.httpcomponents.core5:httpcore5 dependency-version: '5.5' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…t/maven/org.apache.httpcomponents.core5-httpcore5-5.5 Bump org.apache.httpcomponents.core5:httpcore5 from 5.4.4 to 5.5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
Allowing an arbitraryOUTPUT_FILENAMEenables path traversal (e.g.,../../somefile) and can… · Newcurlfailures (DNS, connection refused, timeout, etc.) are not checked via exit status, which can… · New The validation can false-negative if the root element isn’t within the first 2 lines (common if… · New
What changed in this PR
Syncs the fork with upstream master, bringing in upstream dependency bumps and adding a helper script to fetch OWASP ZAP XML reports into results/.
Changes:
- Add
scripts/fetchZAPResults.shfor downloading and validating ZAP XML reports. - Bump several dependency/plugin versions and Tomcat version in
pom.xml.
| File | Description |
|---|---|
| scripts/fetchZAPResults.sh | New script to download ZAP XML reports and store them under results/ |
| pom.xml | Updates library/plugin/Tomcat versions from upstream sync |
Review effort: Lite
Comment on lines
+37
to
+52
| if [ -n "${2:-}" ]; then | ||
| filename="$2" | ||
| else | ||
| benchmark_version=$(scripts/getBenchmarkVersion.sh) | ||
| if [ -z "${benchmark_version}" ]; then | ||
| echo "ERROR: Could not determine Benchmark version from pom.xml." >&2 | ||
| exit 1 | ||
| fi | ||
| date_stamp=$(date +%Y%m%d) | ||
| filename="Benchmark_${benchmark_version}-ZAP-${date_stamp}.xml" | ||
| fi | ||
|
|
||
| api_key="${3:-}" | ||
|
|
||
| mkdir -p results/ | ||
| output="results/${filename}" |
Comment on lines
+54
to
+66
| curl_args=(-sS -o "${output}" -w '%{http_code}' --connect-timeout 10 --max-time 120) | ||
| if [ -n "${api_key}" ]; then | ||
| curl_args+=(-H "X-ZAP-API-Key: ${api_key}") | ||
| fi | ||
|
|
||
| echo "Downloading ZAP report from: ${zap_url}" | ||
| http_code=$(curl "${curl_args[@]}" "${zap_url}") | ||
|
|
||
| if [ "${http_code}" -ne 200 ]; then | ||
| echo "ERROR: Download failed with HTTP status ${http_code}" >&2 | ||
| rm -f "${output}" | ||
| exit 1 | ||
| fi |
Comment on lines
+68
to
+74
| if ! head -2 "${output}" | grep -q "OWASPZAPReport"; then | ||
| echo "ERROR: Downloaded file does not appear to be a ZAP XML report." >&2 | ||
| echo "First 3 lines of downloaded content:" >&2 | ||
| head -3 "${output}" >&2 | ||
| rm -f "${output}" | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
ec48a0e8df5aacc76d49586e855279f9994e8644↓ No CI checks reported; GitHub rejected a CodeQL dispatch saying Actions is disabled, and local Java is unavailable.
↓ Copilot identified issues in the upstream script on the earlier sync PR.
Summary
OWASP-Benchmark/BenchmarkJavamaster through10dfcc54ad02dcfcb358b0ba4a0fef8c919a6d17into the fork.This supersedes earlier sync PRs #23, #24, and #25 if merged.