{
 "SSH 金鑰驗證與 known_hosts#1": {"type":"cards","reveal":[0,1,2,3],"cards":[
  {"title":"只用金鑰","points":["不用密碼驗證"]},
  {"title":"驗證主機金鑰","points":["known_hosts 機制","絕不關閉檢查"]},
  {"title":"專用低權限帳號","points":["只操作授權的主機"]}]},
 "SSH 金鑰驗證與 known_hosts#2": {"type":"flow","layout":"row","reveal":[0,1,2,3],"nodes":[
  {"label":"專屬金鑰","sub":"ed25519","color":0},
  {"label":"ssh-keygen","sub":"指定檔名與註解","color":1},
  {"label":"私鑰權限","sub":"600","color":2,"kind":"end"}]},
 "SSH 金鑰驗證與 known_hosts#3": {"type":"flow","layout":"snake","reveal":[0,1,2,3,4,5],"nodes":[
  {"label":"建立 aiops","sub":"無 sudo","color":0},
  {"label":"停用密碼登入","color":1},
  {"label":".ssh 目錄","sub":"權限 700","color":2},
  {"label":"放入公鑰","sub":"authorized_keys","color":3},
  {"label":"restrict","sub":"限制選項","color":4},
  {"label":"from=","sub":"限管理主機 IP","color":5,"kind":"end"}]},
 "SSH 金鑰驗證與 known_hosts#4": {"type":"flow","layout":"row","reveal":[0,1,2,4,4,4],"nodes":[
  {"label":"首次連線","sub":"顯示指紋","color":0},
  {"label":"本機讀指紋","sub":"ssh-keygen -lf","color":1},
  {"label":"比對一致","sub":"帶外確認","color":2},
  {"label":"寫入","sub":"known_hosts","color":3,"kind":"end"}]},
 "SSH 金鑰驗證與 known_hosts#5": {"type":"table","head":["不安全寫法","後果"],"widths":[3,3],"reveal":[0,0,2,3],"rows":[
  ["StrictHostKeyChecking=no","放棄驗證身分"],
  ["AutoAddPolicy","信任任何陌生主機"],
  ["指紋改變","查明原因,ssh-keygen -R"]]},
 "SSH 金鑰驗證與 known_hosts#7": {"type":"table","head":["常見錯誤","說明"],"widths":[3,3],"reveal":[0,1,2,3,4],"rows":[
  ["私鑰權限 644","SSH 直接拒絕"],
  ["金鑰寫進程式碼","或放進 Git 倉庫"],
  ["用 root 遠端管理","應用專用帳號"],
  ["關閉指紋檢查","應先查明原因"]]},
 "主機清單與遠端指令白名單#2": {"type":"cards","reveal":[0,0,1,2,2,2],"cards":[
  {"title":"web01","points":["address 10.0.0.21","port 22","user aiops","tags web, prod"]},
  {"title":"db01","points":["address 10.0.0.31","port 22","user aiops","tags db, prod"]}]},
 "主機清單與遠端指令白名單#5": {"type":"table","head":["操作","固定指令"],"widths":[2,5],"reveal":[0,0,5,5],"rows":[
  ["uptime","uptime"],
  ["disk","df -h --output=..."],
  ["memory","free -m"],
  ["load","cat /proc/loadavg"],
  ["failed_units","systemctl --failed"]]},
 "主機清單與遠端指令白名單#6": {"type":"flow","layout":"snake","reveal":[0,1,2,3,4,5],"nodes":[
  {"label":"助理端被攻破","color":4},
  {"label":"command=","sub":"authorized_keys","color":0},
  {"label":"ai-gate 腳本","sub":"擁有者 root","color":1},
  {"label":"比對白名單","color":2},
  {"label":"放行","sub":"在白名單內","color":3,"kind":"end"}]},
 "主機清單與遠端指令白名單#7": {"type":"table","head":["收到","執行"],"widths":[2,4],"reveal":[0,1,2,3,4,5],"rows":[
  ["uptime","uptime"],
  ["disk","df -h"],
  ["memory","free -m"],
  ["load","cat /proc/loadavg"],
  ["其他","denied,exit 126"]]},
 "Paramiko、asyncssh 與 ssh 子行程的安全用法#5": {"type":"table","head":["路線","適用情況"],"widths":[2,5],"reveal":[0,1,2,3],"rows":[
  ["系統 ssh 指令","少數主機、最少相依"],
  ["Paramiko","多步驟或同步寫法"],
  ["asyncssh","數十台以上並行"]]},
 "並行、逾時與批次操作的 dry-run#2": {"type":"cards","reveal":[0,1,2,3,4],"cards":[
  {"title":"並行上限","points":["例如 8 個","防止 fail2ban 誤判"]},
  {"title":"各自逾時","points":["連線與指令逾時","單台失敗不影響其他"]},
  {"title":"精簡錯誤","points":["只回例外類型"]},
  {"title":"別名索引","points":["方便 LLM 閱讀"]}]},
 "並行、逾時與批次操作的 dry-run#4": {"type":"flow","layout":"row","reveal":[0,1,2,3],"nodes":[
  {"label":"1 計畫","sub":"只列不執行","color":0},
  {"label":"2 預演","sub":"dry run","color":1},
  {"label":"3 人工確認","sub":"輸入主機數量","color":2}]},
 "並行、逾時與批次操作的 dry-run#5": {"type":"flow","layout":"snake","reveal":[3,4,5],"nodes":[
  {"label":"計畫","color":0},
  {"label":"預演","color":1},
  {"label":"人工確認","color":2},
  {"label":"4 分批執行","sub":"先一台,失敗即停","color":3},
  {"label":"5 稽核紀錄","sub":"誰、何時、何事","color":4,"kind":"end"}]}
}
