هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
ZAP (now under Checkmarx, still open source) crawls a web app (spider, AJAX spider), watches the traffic (passive scan: missing headers, cookies without flags, info leaks) and can attack it (active scan: XSS, SQL injection, path traversal). For CI there are ready scripts in the Docker image: baseline (passive, safe, fast), full (active, long, only on test systems) and api (OpenAPI/GraphQL).
Only scan systems you own or have written permission to test.
طريقة الكتابة
docker run -t zaproxy/zap-stable zap-baseline.py -t URL [OPTIONS]
zap-full-scan.py | zap-api-scan.py -t URL ...الأجزاء الرئيسية
Scan scripts
zap-baseline.py- Spider + passive scan; safe for production.
zap-full-scan.py- Spider + active attacks; test systems only.
zap-api-scan.py-fopenapi|graphql|soap- Scan an API from its definition.
zap.sh-daemon- Run ZAP headless with its API.
الخيارات 8
الأكثر استخدامًا
Script flags
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Baseline scan of a test site
docker run --rm -v "$PWD:/zap/wrk:rw" -t zaproxy/zap-stable zap-baseline.py -t https://staging.example.com -r baseline.html2Read the summary
3Make your own rule config
4Use the rules in CI
docker run --rm -v "$PWD:/zap/wrk:rw" -t zaproxy/zap-stable zap-baseline.py -t https://staging.example.com -c zap-rules.tsv -J zap.json5Scan an API from OpenAPI
docker run --rm -v "$PWD:/zap/wrk:rw" -t zaproxy/zap-stable zap-api-scan.py -t https://staging.example.com/openapi.json -f openapi -r api.html6Full active scan of a test environment
docker run --rm -v "$PWD:/zap/wrk:rw" -t zaproxy/zap-stable zap-full-scan.py -t https://test.lab.local -m 10 -r full.html7Scan with a login token
docker run --rm -t zaproxy/zap-stable zap-api-scan.py -t https://staging.example.com/openapi.json -f openapi -z "-config replacer.full_list(0).matchtype=REQ_HEADER -config replacer.full_list(0).matchstr=Authorization -config replacer.full_list(0).replacement='Bearer TEST_TOKEN'"8GitHub Actions
cat .github/workflows/dast.yml - uses: zaproxy/action-baseline@v0.14.0 with: { target: "https://staging.example.com", rules_file_name: "zap-rules.tsv" }9Count findings by risk from JSON
10Check the headers ZAP complains about
لا يوجد شيء يطابق هذا الفلتر.
انتبه
- Never run the full/active scan against production or third-party sites without written permission.
- Active scans submit forms and can create junk data or send e-mails.
الملفات
/zap/wrk- Mounted folder for reports and configs (Docker).
zap-rules.tsv- Rule config (ID, action, name).
نصائح للحفظ
- Start with the baseline scan in every PR deployment; run the full scan nightly on staging.
رموز الخروج
0 | Success (no FAIL / WARN). |
1 | At least one FAIL. |
2 | At least one WARN (no FAIL). |
3 | Other error. |