Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy all ZAP logs in export_session.py scan hook #414

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Rename AWS signing script.
- Update descriptions/comments in scripts.
- standalone/Open Fortune 500 websites in a browser.zst - Fix typo in `http://www,pbfenergy.com`
- Update export_session script to copy multiple zap files created during log file rotation
thc202 marked this conversation as resolved.
Show resolved Hide resolved

## [17] - 2023-06-28
### Added
Expand Down
4 changes: 3 additions & 1 deletion other/scan-hooks/export_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from shutil import copy2, copytree
import os.path
import glob

# This assumes that you are running as zap - if you run as root change to use /root/.ZAP(_D)
dev_path = '/home/zap/.ZAP_D'
Expand All @@ -14,4 +15,5 @@ def pre_exit(fail_count, warn_count, pass_count):
if os.path.exists(dev_path + '/session'):
dir = dev_path
copytree(dir + '/session', '/zap/wrk/session')
copy2(dir + '/zap.log', '/zap/wrk')
for zap_file in glob.iglob(dir + '/zap.log*'):
copy2(zap_file, '/zap/wrk')