--- tags: Software Development,Security --- # 軟體開發安全 現在要講SSDF才潮! **Key Words** * National Institute of Standards and Technology(NIST) 美國國家標準與技術研究所 * NIST網路安全框架(Cybersecurity Framework,CSF) * 2017年美國第13800號行政命令「強化聯邦網路與關鍵基礎設施之資訊安全」,要求所有聯邦機構須採用CSF # NIST 800-218 2022/02 NIST發表了Secure Software Development Framework (SSDF) Version 1.1: *Recommendations for Mitigating the Risk of Software Vulnerabilities* [連結](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-218.pdf) 該文件於 2021 年 9 月首次發布,但 SSDF計劃於 2021 年 5 月在第 14028 號行政命令之後首次啟動.該行政命令在第4條(e)節下要求發布指南,以加強軟體供應鏈安全. # Abstract 由於軟體開發生命週期(SDLC)Model很少明確的處理軟體安全問題,所以安全的軟體開發實踐,需要添加於每個SDLC模型中,以確保開發時已經是well-secured. # SSDF如何實踐? 首先框架分成4個群組 1. Prepare the Organization (PO) 組織的前置作業 2. Protect the Software (PS) 保護軟體 3. Produce Well-Secured Software (PW)製作安全可靠的軟體 4. Respond to Vulnerabilities (RV)弱點的應對 ![](https://i.imgur.com/sVYqEyE.png) https://blog.chainguard.dev/i-read-nist-800-218-so-you-dont-have-to-heres-what-to-watch-out-for/ ## 1. Prepare the Organization (PO) **重點:** * 確保組織在人員、流程、技術上都準備好了 * 保護和強化開發端點(即軟體設計人員、開發人員、測試人員、構建人員等) **5 Practice:** * PO1:Define Security Requirements for Software Development: 識別並記錄組織軟體開發 *基礎設施* 和*流程* 的所有安全要求,並隨著時間的推移,維護這些要求。 * PO2:Implement Roles and Responsibilities 確保參與 SDLC 組織的每個人都準備好在整個 SDLC 中履行相關的角色和職責。 * PO3:Implement Supporting Toolchains 使用自動化來減少人力並提高整個 SDLC 安全實踐的準確性、可重複性、可用性和全面性 * PO4:Define and Use Criteria for Software Security Checks 在開發過程中定義和使用檢查軟體安全性的標準 * PO5:Implement and Maintain Secure Environments for Software Development 確保軟體開發環境的所有組件都受到保護,免受內部和外部威脅,以防止環境或正在開發/維護的軟體受到損害。 軟體開發環境的包括development、build、test和distribution。 ## 2. Protect the Software (PS) **重點:** * 組織需保護軟體的所有components,避免遭竄改或未經授權的訪問(Code Signing) * 所有形式的code 都要存放repository * 收集、保護、維護和共享每個軟體版本的所有components(軟體組成清單SBOM) **3 Practice:** * PS1:Protect All Forms of Code from Unauthorized Access and Tampering 防止對code進行未經授權的更改,無論是有意/無意(For版本控制&資料完整性) * PS2:Provide a Mechanism for Verifying Software Release Integrity 確保軟體取得者獲取的軟體是合法的且未被篡改。 * PS3:Archive and Protect Each Software Release 保留軟體版本號,以幫助識別、分析和排除軟體中發現的漏洞。 ## 3. Produce Well-Secured Software (PW) **重點:** * Code review, Design review, and Component Selection * 讓一個(或以上)未參與設計的合格人員參與Toolchain review * 設計Default的config即為安全的設定 **9 Practice:** * PW1:Design Software to Meet Security Requirements and Mitigate Security Risks 確定軟體在運作過程中可能面臨哪些安全風險,以及軟體的設計和架構應如何降低這些風險;並證明基於風險的分析表明應該放寬或放棄安全要求的任何情況 * PW2:Review the Software Design to Verify Compliance with Security Requirements and Risk Information 確保軟體滿足安全要求並可處理已識別的風險 * PW3:Verify Third-Party Software Complies with Security Requirements * PW4:Reuse Existing, Well-Secured Software When Feasible Instead of Duplicating Functionality 降低軟體開發成本,加快軟體開發,並通過reusing software modules and services,降低將額外安全漏洞引入軟體的可能 * PW5:Create Source Code by Adhering to Secure Coding Practices 原始碼在編寫的時候,就盡可能的最小化的引入有弱點的functions/calls * PW6:Configure the Compilation, Interpreter, and Build Processes to Improve Executable Security 在測試發生之前消除漏洞來降低成本 * PW7:Review and/or Analyze Human-Readable Code to Identify Vulnerabilities and Verify Compliance with Security Requirements 幫助識別漏洞,以便在軟體發布之前對其進行修正。 * PW8:Test Executable Code to Identify Vulnerabilities and Verify Compliance with Security Requirements 自動化方法可以降低檢測漏洞所需的工作量和資源,並提高可追溯性和可重複性(repeatability)。 可執行代碼包括 binaries,directly executed bytecode and source code等 * PW9:Configure Software to Have Secure Settings by Default 初始設定就預設為較高的安全性,以降低軟體部署時安全設置較弱的可能 ## 4. Respond to Vulnerabilities (RV) **重點** * code ages like milk, not wine! (Code需要常常檢視) * 建立一個機制可以monitoring vulnerability databases(但通常不容易) * 制定解決漏披露和補救的政策,並實施支持該政策所需的角色、職責和流程 **3 Practice:** * RV1:Identify and Confirm Vulnerabilities on an Ongoing Basis 更快的識別弱點-從軟體收購方、用戶和公共來源收集有關軟體和軟體使用的第三方組件的潛在漏洞的資訊,並調查所有可信的報告 * RV2:Assess, Prioritize, and Remediate Vulnerabilities 分析每個漏洞以收集有關風險的足夠資訊,以計劃其補救措施或其他風險響應。 * RV3:Analyze Vulnerabilities to Identify Their Root Causes 分析已識別的漏洞以確定其根本原因。並審查軟體是否存在類似漏洞,主動修復它們,而不是等待外部報告 --- 參考資料: 1. https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-218.pdf 2. [Goodbye SDLC, Hello SSDF! What is the Secure Software Development Framework?](https://blog.chainguard.dev/goodbye-sdlc-hello-ssdf-what-is-the-secure-software-development-framework/)