建構 Ubuntu 24.04 CIS Level 1 評估鏡像
本指南產生一個 Ubuntu 24.04 映像,該映像請求 OpenFactory 的固定 CIS 1 級修復路徑並收集來賓證據。它不生產經過認證或自動生產就緒的伺服器。
對於其他發行版,cis-benchmarks 功能目前僅套用有限的可移植基線。請勿透過更改 base_image 和保留 CIS 聲明來調整本指南。
提示
Create an Ubuntu 24.04 headless evaluation image with SSH, firewall,
audit logging, and the cis-benchmarks feature. Use key-only SSH,
disable root login, and add a locked-password operator account in sudo.
Add a scenario that waits for first-boot CIS remediation and runs the
Ubuntu 24.04 Level 1 server benchmark plus service and network smoke tests.
Do not call the result compliant; preserve failed controls and exceptions.查看標準化配方
重要字段應類似於:
{
"name": "ubuntu24-cis-l1-evaluation",
"base_image": "ubuntu-24.04",
"os": {
"features": [
"headless",
"ssh",
"firewall",
"audit-logging",
"cis-benchmarks"
],
"services": [
{
"name": "ssh",
"enabled": true,
"config": {
"port": 22,
"allow_root": false,
"disable_password_auth": true
}
}
],
"users": [
{
"username": "operator",
"groups": ["sudo"],
"shell": "/bin/bash"
}
],
"security": {
"hardening_level": "standard",
"audit_logging": true,
"fail2ban": false
}
},
"scenarios": [
{
"id": "ubuntu24-cis-evidence",
"name": "Ubuntu 24.04 CIS Level 1 evidence",
"enabled": true,
"tests": ["boot", "login", "packages", "services"],
"cis_benchmark": "CIS_Ubuntu_Linux_24.04_LTS_Benchmark_v1.0.0",
"cis_level": "L1"
}
]
}該帳戶沒有配方密碼,因此應保持密碼鎖定狀態,直到提供核准的金鑰或部署時憑證。在停用密碼驗證之前,請確認產生的存取路徑與您的環境相符。
建構路徑的作用
對於 Ubuntu 24.04,此功能會暫存固定 ansible-lockdown/UBUNTU24-CIS 角色的經過摘要驗證的檔案。首次啟動會套用所選的 1 級伺服器設定檔並寫入就緒或故障證據。此版本還包含帳戶控制、警告橫幅、服務狀態、檔案系統設定、來源和選定網路行為的功能斷言。
該角色適用於 OpenFactory 的圖像工作流程。檢查生成的清單和補丁,而不是假設它與預設上游運行相同。
驗收標準
不要停留在“構建完成”。要求:
- 一個可用的神器及其摘要;
- 首次啟動修復準備就緒且無故障標記;
- 考慮所有適用的選定基準檢查;
- 對每個失敗、跳過或不適用的控制進行明確處置;
- 透過核准的金鑰工作流程成功進行 SSH 存取;
- 防火牆、時間同步、日誌記錄、更新、重新啟動和復原測試;
- 硬化後施加煙霧測試;和
- 所有者批准的部署運作手冊。
等級 2 不是目前固定的修復設定文件,並且不能像此路徑提供它一樣請求該等級。如果需要 2 級,請將其視為單獨的工程和驗證項目。
請參閱 CIS 基準證據 以了解結果解釋。