
kubeshop/testkube-zap-executor!Testkube Logo
TestKube ZAP执行器是一款测试执行器,用于在TestKube中运行ZED***代理(ZAP)扫描,帮助用户在TestKube环境中便捷地进行Web应用安全测试。
zap/api(API扫描)、zap/baseline(基线扫描)、zap/full(全面扫描)TestKube默认已集成ZAP执行器。如需手动构建和部署,执行以下命令:
bashkubectl apply -f examples/zap-executor.yaml
bash# 创建API扫描测试 kubectl testkube create test --file contrib/executor/zap/examples/zap-tk-api.yaml --type "zap/api" --name api-test --copy-files contrib/executor/zap/examples/zap-tk-api.conf:zap-tk-api.conf # 运行API扫描测试并监控 kubectl testkube run test --watch api-test # 创建基线扫描测试 kubectl testkube create test --file contrib/executor/zap/examples/zap-tk-baseline.yaml --type "zap/baseline" --name baseline-test --copy-files contrib/executor/zap/examples/zap-tk-baseline.conf:zap-tk-baseline.conf # 运行基线扫描测试并监控 kubectl testkube run test --watch baseline-test # 创建全面扫描测试 kubectl testkube create test --file contrib/executor/zap/examples/zap-tk-full.yaml --type "zap/full" --name full-test --copy-files contrib/executor/zap/examples/zap-tk-full.conf:zap-tk-full.conf # 运行全面扫描测试并监控 kubectl testkube run test --watch full-test
bash# 从Git仓库创建API扫描测试 kubectl testkube create test --git-uri [***] --type "zap/api" --name git-api-test --executor-args "zap-api.yaml" --git-branch main --git-path contrib/executor/zap/examples # 运行Git仓库API扫描测试并监控 kubectl testkube run test --watch git-api-test # 从Git仓库创建基线扫描测试 kubectl testkube create test --git-uri [***] --type "zap/baseline" --name git-baseline-test --executor-args "zap-baseline.yaml" --git-branch main --git-path contrib/executor/zap/examples # 运行Git仓库基线扫描测试并监控 kubectl testkube run test --watch git-baseline-test # 从Git仓库创建全面扫描测试 kubectl testkube create test --git-uri [***] --type "zap/full" --name git-full-test --executor-args "zap-full.yaml" --git-branch main --git-path contrib/executor/zap/examples # 运行Git仓库全面扫描测试并监控 kubectl testkube run test --watch full-test-git
ZAP扫描参数通过YAML配置文件定义,示例如下:
yamlapi: # -t 目标API定义地址 target: [***] # -f API格式,支持openapi、soap或graphql format: openapi # -O 覆盖远程OpenAPI规范中的主机名 hostname: [***] # -S 安全模式,跳过主动扫描仅执行基线扫描 safe: true # -c 配置文件路径 config: examples/zap-api.conf # -d 显示调试信息 debug: true # -s 简短输出模式 short: false # -l 显示的最低级别:PASS、IGNORE、INFO、WARN或FAIL level: INFO # -c 上下文文件路径 context: examples/context.config # 用于认证扫描的用户名 user: anonymous # 被动扫描等待延迟(秒) delay: 5 # ZAP启动和被动扫描的最大等待时间(分钟) time: 60 # ZAP命令行选项 zap_options: -config aaa=bbb # -I 是否在警告时使ZAP扫描失败 fail_on_warn: false
请通过GitHub Issues报告所有问题。




manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务