使用 Oval 安全漏洞動態饋給掃描 COS 映像檔
COS 提供開放式安全漏洞和評估語言 (OVAL) 漏洞動態饋給,這是所有支援的 COS 版本的結構化、機器可讀資料集。您可以使用這項動態饋給,評估 COS 系統上安裝的套件是否有安全性問題。
您可以前往 gs://cos-oval-vulnerability-feed
存取 OVAL 動態饋給。動態饋給會依附於 cos-package-info.json
檔案,後者會列出映像檔上已安裝的套件。這個檔案位於 VM 執行個體的 /etc
目錄中。
使用 Oval 動態饋給掃描 COS VM 執行個體
您可以使用 OVAL 動態饋給掃描任何 COS 執行個體。舉例來說,假設您要掃描執行 COS-109
映像檔的執行個體:
下載執行個體的 Oval 動態饋給。請確認您選擇的里程碑正確無誤。在本例中,這項值為 109:
gcloud storage cp gs://cos-oval-vulnerability-feed/cos-109.oval.xml.tar.gz .
將下載的 Oval 動態饋給解壓縮:
tar xf cos-109.oval.xml.tar.gz
從 VM 執行個體複製 cos-package-info.json
,在本例中為 my-cos-instance
:
gcloud compute scp my-cos-instance:/etc/cos-package-info.json .
使用您偏好的安全內容自動化通訊協定 (SCAP) 相容工具,處理 Oval 動態饋給。在本例中,我們使用 OpenSCAP
:
oscap oval eval --report report.html cos-109.oval.xml
請注意,cos-package-info.json
檔案和 COS Oval 動態饋給必須位於相同目錄。如果不是,請更新 COS Oval 動態饋給檔案中的 cos-package-info.json
路徑。
如何修正掃描工具回報的安全漏洞
動態饋給會列出最新 COS 映像檔中修正的所有安全漏洞。因此,您可以更新至該特定里程碑的最新 COS 映像檔,修正系統上掃描器回報的所有公開漏洞。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-08 (世界標準時間)。"],[[["COS provides an Open Vulnerability and Assessment Language (OVAL) feed, a structured dataset for identifying security vulnerabilities in supported COS releases."],["The OVAL feed, accessible at `gs://cos-oval-vulnerability-feed`, relies on the `cos-package-info.json` file, which lists installed packages on an image and is located in the `/etc` directory."],["Scanning a COS instance involves downloading and extracting the OVAL feed for the specific milestone, copying the `cos-package-info.json` file from the VM, and using an SCAP-compliant tool like OpenSCAP."],["Vulnerabilities reported by the scanner can be resolved by updating to the latest COS image for the applicable milestone, as the feed lists vulnerabilities fixed in these images."]]],[]]