feat(bench): seed 起始清空全部拦截规则,放开 CTF 渗透操作防误拦

This commit is contained in:
Autumn-27 committed 2026-08-13 12:29:01 -04:00
1 parent 4c42c70a84
commit aafab015e7
2 files changed
+32

No files matched your search

+16
View File
@@ -19,6 +19,22 @@ AUTH="Authorization: Bearer $TOKEN"
CT="Content-Type: application/json"
post() { curl -s -o /dev/null -w " $2 %{http_code}\n" -X "${3:-POST}" "$API$1" -H "$AUTH" -H "$CT" --data-binary @-; }
# ---------- 0) 删除全部拦截规则 ----------
# benchmark/CTF 解题会大量用到 DELETE 请求、清空类接口等操作,破坏性拦截规则会误拦
# 这些正常渗透动作。这里逐条删除所有拦截规则(含内置),放开防护,避免 worker 被 deny 卡住。
# 无 bulk delete 接口,故先 list 再逐个 DELETE。
del_all_intercept_rules() {
local rules ids id n=0
rules="$(curl -s "$API/api/intercept/rules" -H "$AUTH")"
ids="$(echo "$rules" | jq -r '(.rules // [])[] | .id')"
for id in $ids; do
curl -s -o /dev/null -X DELETE "$API/api/intercept/rules/$id" -H "$AUTH"
n=$((n+1))
done
log "已删除 $n 条拦截规则"
}
del_all_intercept_rules
# ---------- 1) 自定义 agent(先建,后续绑定/提示词依赖它) ----------
log "创建自定义 agent ..."
echo '{"key":"tec_benchmark","name":"腾讯BENCHMARK自动化编排","description":"benchmark 自动化编排:拉题/建任务/推进/提交"}' | post /api/agents "agent tec_benchmark"
+16
View File
@@ -28,6 +28,22 @@ AUTH="Authorization: Bearer $TOKEN"
CT="Content-Type: application/json"
post() { curl -s -o /dev/null -w " $2 %{http_code}\n" -X "${3:-POST}" "$API$1" -H "$AUTH" -H "$CT" --data-binary @-; }
# ---------- 0) 删除全部拦截规则 ----------
# benchmark/CTF 解题会大量用到 DELETE 请求、清空类接口等操作,破坏性拦截规则会误拦
# 这些正常渗透动作。这里逐条删除所有拦截规则(含内置),放开防护,避免 worker 被 deny 卡住。
# 无 bulk delete 接口,故先 list 再逐个 DELETE。
del_all_intercept_rules() {
local rules ids id n=0
rules="$(curl -s "$API/api/intercept/rules" -H "$AUTH")"
ids="$(echo "$rules" | jq -r '(.rules // [])[] | .id')"
for id in $ids; do
curl -s -o /dev/null -X DELETE "$API/api/intercept/rules/$id" -H "$AUTH"
n=$((n+1))
done
log "已删除 $n 条拦截规则"
}
del_all_intercept_rules
# ---------- 1) 自定义 agent(仅 challenge_review;编排交给 scheduler.py) ----------
log "创建自定义 agent(仅 challenge_review)..."
echo '{"key":"challenge_review","name":"题目REVIEW","description":"重复题目经验总结:查历史、复用经验、注入 hint"}' | post /api/agents "agent challenge_review"