Table 已對齊(欄位名 + 必填 + 新表規劃)。本文件分析現有資料填入流程與模式,把每個新表/欄位對應到「資料來源 + 該接進哪條流程」,作為資料補齊規劃的依據。本階段只分析,範圍尚未拍板。
先看資料現在怎麼進表——這決定新表要接哪裡。
SspVersioningService.clone_to_new_version 加深拷貝(含 id remap)從既有欄位 / FK / 已捕捉資料推出來。import_*、別名欄、poam title/desc、finding.title 設 NN。
詞彙值域對應、nullable→NN、欄位拆分。資料多半已在,改值或改約束。
需要新 UI / 匯入 / parser 去捕捉,SSP 類還要接進 3 路徑。是否做取決於產品要不要這功能。
| 新欄位 | 資料來源 | 怎麼填 |
|---|---|---|
ssps.import_profile | 既有 profile_id → profiles.uid | 一次性 backfill UPDATE + 寫入時 mapper 帶 |
assessment_plans.import_ssp | 既有 ssp_id → ssps.uid | backfill + mapper(注意 ssp_id 是 stringified int) |
assessment_results.import_ap | 既有 assessment_plan_id → assessment_plans.uid | backfill + mapper |
poams.import_ssp | AP → SSP 推導 | backfill + confirm_audit 生成時帶 |
ssp_control_implementations.control_id | = 既有 control_identifier | backfill copy + 寫入時雙寫 |
ssp_control_implementation_objectives.statement_id | = 既有 statement_identifier | backfill copy + 雙寫 |
poams.title 衍生 | finding.title | confirm_audit 批次生成時帶入 |
poams.description 衍生 | finding.description | 同上(與既有 remediation_plan 並存) |
assessment_result_findings.title → NN | 稽核員已填(create_finding) | 資料已在,直接設 NOT NULL(先驗無 NULL) |
| 對象 | 原 → 新 | 做法 |
|---|---|---|
ssp_system_characteristics.status | active/archived → operational / under-development / under-major-modification / disposition / other | 值對應 migration + 改編輯 UI 下拉選項;確認既有資料對映規則 |
assessment_plan_tasks.task_type | manual/automated/hybrid → OSCAL milestone/action | manual/automated/hybrid 移到 props;新 OSCAL 欄給預設值(多數任務屬 action) |
ssp_components.status / .description | nullable → NOT NULL | 先驗既有資料是否有 NULL → 回填 default → 收緊;編輯/匯入確保必填 |
ssp_leveraged_authorizations.party_uuid / .date_authorized | nullable → NOT NULL | 同上(注意既有資料可能有空值需補) |
assessment_result_datas.title / .started_at | nullable → NOT NULL | launch_audit 已寫入(title='稽核執行'/started_at=now)→ 收緊低風險 |
assessment_result_evidences.description | nullable → NOT NULL | 驗既有資料 + 收緊 |
catalog_control_parts.prose | NOT NULL → 可為 NULL(放寬) | 直接 ALTER(解除過嚴,無資料風險) |
這才是真正要規劃「誰填、從哪來、怎麼接」的部分。編輯clone匯入 = SSP 三路徑需接點。
| 新表/結構 | 該由哪條流程捕捉 | 需要做什麼 |
|---|---|---|
ssp_system_information_types + C/I/A impact(FIPS 199) | system-characteristics 編輯 編輯clone匯入 | 新「資訊類型 + 衝擊」UI 區塊;docx/excel parser 抽取;接 3 路徑 |
| security-impact-level(3 欄) | 同 system-characteristics 編輯 | 編輯 UI 3 個 C/I/A 下拉;clone/import 帶 |
ssp_system_users + ssp_authorized_privileges | 新「使用者授權」編輯區 編輯clone | 新表 + UI(user/role/privilege 矩陣)+ 3 路徑 |
ssp_by_components(+ export/inherited/satisfied) | 控制項實作編輯(元件層)編輯clone匯入 | 新表 + 元件層實作 UI;leveraged auth 繼承鏈;接 3 路徑 |
ssp_set_parameters | 控制項實作編輯 / 從 catalog param 帶 | 新表 + UI(參數值);可預載 catalog 參數;接 3 路徑 |
ssp_diagrams | SSP 編輯 圖檔上傳 編輯clone | 新表 + 檔案上傳 UI;接 clone |
| 新表/結構 | 該由哪條流程捕捉 | 需要做什麼 |
|---|---|---|
assessment_result_finding_targets | 稽核員建 finding 時 稽核 | 擴充 create_finding:指定 target type + status(satisfied/not-satisfied) + implementation-status |
assessment_result_observations | 稽核階段(稽核員填觀察) | 新表 + 稽核 UI(methods/collected/subjects) |
assessment_result_risks | 稽核階段 / 接既有風險評鑑模組 | 新表 + 稽核 UI(或與風險模組連動);最大工程 |
assessment_result_datas.description | launch_audit 時填 / 從 title 衍生 | 小 UI 欄位 或 衍生 default |
| 新表/結構 | 該由哪條流程捕捉 | 需要做什麼 |
|---|---|---|
| catalog props/links/子控制項/param constraints | 框架匯入 parser 匯入 | parser 增強(目前丟棄這些);影響各框架 adapter |
profile_imports / merge / modify | profile 建立/編輯流程 | 新表 + profile 編輯 UI;目前壓成單一 catalog_id |
back-matter oscal_resources(+ hashes/document_ids/revisions) | 匯入時保存原始 resource + 附件 匯入 | 新表 + 匯入保存;程序書池可部分映射 |
| 1 | 範圍:只做 A+B(衍生/回填+轉換,機械式、無 UX),還是含 C-SSP(與 FR-036 SSP 表族同期),或全做含 AR observation/risk + back-matter? |
| 2 | C 類取決於產品要不要該功能:information-type/FIPS199、system-user、by-component、risk 等是 OSCAL 完整 round-trip 才需要的捕捉點——做不做看 conformance 目標。 |
| 3 | 接線成本集中在 SSP 3 路徑:每個 SSP 新表 = 新 model + 編輯 write-strategy + clone 深拷貝 + 匯入 strategy。建議與 FR-036 動 SSP 表時一起接。 |