<commit_before>#!/usr/bin/env bash

set -euo pipefail

RELEASE_FILENAME="dependency-check-7.1.3-SNAPSHOT-release.zip"
RELEASE_URL="https://github.com/dhalperi/DependencyCheck/releases/download/v7.1.2-SNAPSHOT-maven-install/${RELEASE_FILENAME}"

# Check cache, and and download+cache jar if not present.
CACHE_DIR="${HOME}/.cache/owasp"
RELEASE_FILE="${CACHE_DIR}/${RELEASE_FILENAME}"
if [ ! -f ${RELEASE_FILE} ]; then
  mkdir -p "${CACHE_DIR}"
  wget "${RELEASE_URL}" -O "${RELEASE_FILE}"
  pushd "${CACHE_DIR}" && unzip -o "${RELEASE_FILENAME}" && popd
fi

# Run the check
${CACHE_DIR}/dependency-check/bin/dependency-check.sh \
  --failOnCVSS 4 \
  --enableExperimental \
  --scan maven_install.json \
  --suppression projects/build-tools/src/main/resources/org/batfish/owasp/suppressions.xml<commit_msg>OWASP: allow overriding filename to scan (#8530)<commit_after>#!/usr/bin/env bash

set -euo pipefail

RELEASE_FILENAME="dependency-check-7.1.3-SNAPSHOT-release.zip"
RELEASE_URL="https://github.com/dhalperi/DependencyCheck/releases/download/v7.1.2-SNAPSHOT-maven-install/${RELEASE_FILENAME}"

# Check cache, and and download+cache jar if not present.
CACHE_DIR="${HOME}/.cache/owasp"
RELEASE_FILE="${CACHE_DIR}/${RELEASE_FILENAME}"
if [ ! -f ${RELEASE_FILE} ]; then
  mkdir -p "${CACHE_DIR}"
  wget "${RELEASE_URL}" -O "${RELEASE_FILE}"
  pushd "${CACHE_DIR}" && unzip -o "${RELEASE_FILENAME}" && popd
fi

# Run the check
${CACHE_DIR}/dependency-check/bin/dependency-check.sh \
  --failOnCVSS 4 \
  --enableExperimental \
  --scan ${1:-maven_install.json} \
  --suppression projects/build-tools/src/main/resources/org/batfish/owasp/suppressions.xml
{'fraction_non_alphanumeric': 0.16999395039322443, 'fraction_numerical': 0.011494252873563218, 'mean_word_length': 4.823943661971831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2440864', 'n_tokens_mistral': 635, 'n_tokens_neox': 581, 'n_words': 99}