Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.11
3.13.2
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python 3.13.2
poetry 2.2.1
jq 1.6
nodejs 20.2.0
nodejs 22.22.3
143 changes: 1 addition & 142 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint-plugin-unicorn": "^56.0.1",
"eslint-plugin-workspaces": "^0.11.0",
"eslint-plugin-yml": "^1.2.0",
"hbs-cli": "^1.4.1",
"handlebars": "^4.7.9",
"license-checker": "^25.0.1",
"minimist": "^1.2.2",
"newman": "^6.2.2",
Expand All @@ -57,6 +57,9 @@
"flatted": "^3.4.2",
"postcss": "^8.5.12",
"lodash": "^4.18.1",
"underscore": "^1.13.8"
"underscore": "^1.13.8",
"glob-promise": {
"glob": "^7.2.3"
}
}
}
2 changes: 1 addition & 1 deletion scripts/config/sonar-scanner.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sonar.qualitygate.wait=true
sonar.sources=.
sonar.tests=tests/, sandbox/__test__
sonar.test.inclusions=tests/**.py, sandbox/__test__/**
sonar.exclusions=.venv/**,proxies/utils/performance/*
sonar.exclusions=.venv/**,proxies/utils/performance/*,scripts/render_hbs.js

sonar.python.version=3.10.8

Expand Down
20 changes: 20 additions & 0 deletions scripts/render_hbs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node
'use strict';

const fs = require('fs');
const Handlebars = require('handlebars');

const [,, dataFile, templateFile] = process.argv;

if (!dataFile || !templateFile) {
console.error('Usage: node scripts/render_hbs.js <data.json> <template.hbs>');
process.exit(1);
}

const data = JSON.parse(fs.readFileSync(dataFile, 'utf8'));
const templateSource = fs.readFileSync(templateFile, 'utf8');
const template = Handlebars.compile(templateSource);

// @generated is a data-frame variable used in the nunit template
const output = template(data, { data: { generated: new Date().toISOString() } });
process.stdout.write(output);
17 changes: 10 additions & 7 deletions scripts/run_zap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ export INTEGRATION_PRIVATE_KEY_CONTENTS=$(cat $INTEGRATION_PRIVATE_KEY)

docker build -t zap -f ./zap/Dockerfile .

echo "running zap"
# run zap in a container
docker container run \
--env INTEGRATION_PRIVATE_KEY_CONTENTS="$INTEGRATION_PRIVATE_KEY_CONTENTS" \
--env INTEGRATION_API_KEY="$INTEGRATION_API_KEY" \
-v $(pwd):/zap/wrk/:rw \
-v $TEMP_DIR:/zap/tmp/:rw \
-v $(pwd)/zap/comms-manager-json/:/home/zap/.ZAP/reports/comms-manager-json/:rw \
-t zap \
bash -c "./zap.sh -cmd -autorun /zap/wrk/zap/zap.yaml"
--env INTEGRATION_API_KEY="$INTEGRATION_API_KEY" \
-v $(pwd):/zap/wrk/:rw \
-v $TEMP_DIR:/zap/tmp/:rw \
-v $(pwd)/zap/comms-manager-json/:/home/zap/.ZAP/reports/comms-manager-json/:rw \
-t zap \
bash -c "./zap.sh -cmd -autorun /zap/wrk/zap/zap.yaml"

echo "ended running zap"

# generate our nunit report from the zap JSON report
./node_modules/.bin/hbs --data $TEMP_DIR/zap-report.json zap/nunit-template.hbs -s > zap-report.xml
node scripts/render_hbs.js $TEMP_DIR/zap-report.json zap/nunit-template.hbs > zap-report.xml

# delete our zap compatible report
rm build/communications-manager-zap.json
2 changes: 1 addition & 1 deletion zap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM zaproxy/zap-stable:2.16.1
FROM zaproxy/zap-stable:2.17.0

COPY ./zap/policies/ /home/zap/.ZAP/policies/

Expand Down
Loading