本卡屬 FR-120(母卡待填)。這一棒掃主專案自己程式的「雲端硬碟整合:八支檔案搬移處理器」(10 檔/1758 行)。只掃不修。
用資安掃描工具掃 BE repo 自己寫的「雲端硬碟整合:八支檔案搬移處理器」這塊程式(10 檔,約 1758 行),找出權限檢查、資料歸屬判斷上的漏洞並產出報告。只找問題、不修問題。
🔴 優先序第 5:會寫 compliance.job_evidences(沒有客戶隔離、沒開資料庫保護的表),整批零守門字眼。
這些是首腦讀過盤點檔與程式碼後認為最容易出事的地方,是思考起點不是檢查清單:
import/archive/soft_delete/reconcile/process_drive_changes)直接新增或軟刪證據紀錄,寫進 compliance.job_evidences(沒有客戶隔離、資料庫沒開保護)。問:寫入前有沒有確認「這個任務屬於這家公司」——資料庫不會幫忙擋。import_drive_file_handler.py:把雲端硬碟的檔案抓回系統存成證據。問:檔名、大小、類型有沒有限制(資源耗盡、檔案上傳同型問題)。process_drive_changes_handler.py:處理 Google 送來的變更清單。問:變更清單裡的檔案編號如果指到別家公司的資料夾,會不會被照單全收。infra/flow_engine/repository/job_evidence_repo_impl.py/domain/flow_engine/repository/job_evidence.py/domain/flow_engine/service/job_evidence_domain_service.py 三支已掃過但掃後新增了 get_active_by_job_and_file/find_active_by_content_hash 兩個查詢方法(09-17 證據 AI 分類新增),問:這兩個新查詢有沒有限定任務範圍。or 串起來,其中一個條件永遠成立;例外處理把「查不到資料」與「沒有權限」混成同一個回應;背景排程/系統身分執行的程式碼假設「呼叫者一定是自己人」;防重放/計次的邏輯只在單一進程內生效,多台機器或重啟就破功;註解寫「這裡刻意不檢查」但沒人在上一層真的檢查。本範圍從未被任何一棒正式掃過。U4 ↔ U5 ↔ U6 接縫同 U5 卡說明。
第一步:讀完本卡與母卡,再讀盤點檔 docs/features/FR-119-2609-security-scan-closeout/scan-inventory.md 對應本棒段落。
第二步:驗 scope 檔數,在 BE repo 跑下面指令,對上 10 檔/1758 行 才往下;對不上停下回報。
cd /Users/chouraymond/Projects/Billows/Audit-Manager/compliance-manager-be && git ls-files -- \
app/cloud_integration/service/handlers/archive_drive_file_handler.py \
app/cloud_integration/service/handlers/create_folder_handler.py \
app/cloud_integration/service/handlers/import_drive_file_handler.py \
app/cloud_integration/service/handlers/init_project_folders_handler.py \
app/cloud_integration/service/handlers/process_drive_changes_handler.py \
app/cloud_integration/service/handlers/reconcile_task_folder_handler.py \
app/cloud_integration/service/handlers/rename_folder_handler.py \
app/cloud_integration/service/handlers/soft_delete_evidence_handler.py \
domain/cloud_integration/service/drive_folder_mapping_domain_service.py \
infra/cloud_integration/repository/drive_folder_mapping_repo_impl.py | xargs wc -l | tail -1 # 10 檔、1758 行
第三步:把啟動指令交給決策者(你不能自己啟動)。/claude-security 帶 disable-model-invocation: true,模型用 Skill tool 叫會被直接擋掉;也不可以自己叫 Workflow、不可以自己派研究員/verifier 拼報告——三人面板的票數是工具程式碼算出來的,報告的驗證章就蓋在那個數字上。這是刻意設計,撞到不要 debug、不要找繞路。兩行要當同一則訊息送出,第二行不能省(省了會停在成本確認題):