OpenSCAP 合规扫描:OL10 官方内容、Essential Eight 全量 877 条规则实测
用 Oracle 官方自带的 SCAP 内容给 OL10 做合规扫描:工具与内容的来历、profile 怎么选、一条命令跑全量、分数怎么读。
工具与内容:一条 dnf 的事
Section titled “工具与内容:一条 dnf 的事”dnf group install security-tools # 或单装两个包rpm -q openscap-scanner scap-security-guide# openscap-scanner-1.4.4-1.el10_2.x86_64# scap-security-guide-0.1.82-2.0.1.el10_2.noarchls /usr/share/xml/scap/ssg/content/ | grep ol10# ssg-ol10-ds.xml ← OL10 官方 datastreamdatastream(-ds.xml)= XCCDF 基准 + OVAL 检查的合体包,oscap 直接消费。
profile:先看有什么再选
Section titled “profile:先看有什么再选”oscap info --profiles /usr/share/xml/scap/ssg/content/ssg-ol10-ds.xml实测可用 profile:ANSSI-BP-028(法标,四档)、Essential Eight(澳标)、HIPAA(美医疗)、ISM Official……
全量扫描:一条命令
Section titled “全量扫描:一条命令”oscap xccdf eval \ --profile xccdf_org.ssgproject.content_profile_e8 \ --results /tmp/oscap-results.xml \ --report /tmp/oscap-report.html \ /usr/share/xml/scap/ssg/content/ssg-ol10-ds.xml实测(最小安装 VM,E8 profile):
- 877 条规则全量评估,几分钟跑完;
- 总分 54.33——一半左右不达标,这是「最小安装 ≠ 安全基线」的量化证据;
- 产物:结果 XML + 人读 HTML 报告(1.89MB,逐规则 pass/fail + 修复指引)。
- 整改基线:报告里 fail 的规则按 remediation 字段修(多数是 sysctl/包/服务配置);
- 量化进度:修一批 → 复扫 → 分数上涨。合规工作从此有数字;
- 自动化重扫:把 oscap 命令挂 Ansible/Cron,配置漂移直接暴露。
本页证据与局限
Section titled “本页证据与局限”- 已实测:内容包定位、profile 清单(无 CIS 确认)、E8 全量扫描 877 规则与 54.33 分、报告产物(E3);
- 未实测:remediation 模式的自动修复(—remediate 会改系统配置,留到加固篇专门实测);
- 来源:scap-security-guide 上游、OL10 安全合规文档。