/install cis-rhel-openeuler-coverage
CIS RHEL Benchmark → OpenEuler 安全基线覆盖分析
对 CIS Red Hat Enterprise Linux Benchmark PDF 中的每一条安全规则,与 OpenEuler 安全配置基线 Markdown 文档进行逐项对比,输出覆盖分析报告。
使用方式
用户提供两个文件路径即可触发完整分析流程:
老大,分析 CIS 覆盖情况
CIS PDF: /path/to/CIS_Red_Hat_Enterprise_Linux_9_Benchmark.pdf
OpenEuler 基线: /path/to/openeuler-security-baseline.md
工作流
步骤 1:确认输入
确认用户同时提供了以下两个文件路径:
- CIS RHEL Benchmark PDF — CIS 官方发布的 PDF 格式 Benchmark 文档
- OpenEuler 安全配置基线 — Markdown 格式的 OpenEuler 基线文档
步骤 2:解析 CIS PDF
运行 scripts/parse_cis_pdf.py 提取 CIS 规则清单:
python scripts/parse_cis_pdf.py "\x3Ccis-pdf-path>" -o "\x3Coutput-dir>/cis_rules.json"
输出 JSON 结构:
[
{
"rule_id": "1.1.1.1",
"title": "Ensure mounting of cramfs filesystems is disabled",
"config_path": "/etc/modprobe.d/CIS.conf",
"config_param": "install cramfs /bin/false",
"expected_value": "install cramfs /bin/false",
"level": "Level 1",
"scoring": "Scored"
}
]
关键提取字段:规则编号、标题、配置项路径、参数名、期望值、级别、评分状态。
步骤 3:解析 OpenEuler 基线 MD
运行 scripts/parse_openeuler_md.py 提取基线条目:
python scripts/parse_openeuler_md.py "\x3Copeneuler-md-path>" -o "\x3Coutput-dir>/openeuler_items.json"
输出 JSON 结构:
[
{
"item_id": "2.1",
"config_path": "/etc/ssh/sshd_config",
"config_param": "MaxAuthTries",
"expected_value": "3",
"description": "SSH 最大认证尝试次数设置为 3"
}
]
关键提取字段:条目编号、配置项路径、参数名、期望值、描述。
步骤 4:覆盖分析
运行 scripts/coverage_analyzer.py 执行匹配和判定:
python scripts/coverage_analyzer.py \
--cis "\x3Coutput-dir>/cis_rules.json" \
--openeuler "\x3Coutput-dir>/openeuler_items.json" \
-o "\x3Coutput-dir>/analysis_result.json"
匹配策略
- 精确匹配 — 配置项路径+参数名完全一致
- 模糊匹配(精确匹配失败后)— 使用 thefuzz 计算路径相似度,阈值 ≥ 85%
- 人工标记— 对于模糊匹配结果,标记需人工确认
覆盖判定标准
| 状态 | 判定条件 |
|---|---|
| ✅ 完全覆盖 (Fully Covered) | 路径匹配 + OpenEuler 要求值在安全严格度上 ≥ CIS 要求(同等或更安全) |
| ⚠️ 部分覆盖 (Partially Covered) | 路径匹配但要求值无法自动判定安全严格度、或存在差异但无法确认更安全 |
| ❌ 未覆盖 (Not Covered) | 配置项在 OpenEuler 基线中不存在(精确 + 模糊均未匹配) |
数值安全性比较规则
- 数字比较:对于 "最大尝试次数"、"超时秒数" 等数值,CIS 要求 ≤ 3,OpenEuler 为 3 或更小 → 完全覆盖;若为 4 → 部分覆盖
- 布尔/状态值:
yes/no、true/false、enabled/disabled— 优先级认定一致则为覆盖 - 路径/Permissions:权限值
600比644更严格,700比755更严格 - 未知模式:无法自动判断的,归类为部分覆盖,标注"需人工确认"
步骤 5:生成报告
运行 scripts/report_generator.py 输出中英文 CSV:
python scripts/report_generator.py \
--analysis "\x3Coutput-dir>/analysis_result.json" \
-o "\x3Copeneuler基线所在目录>"
生成文件:
\x3Copeneuler基线所在目录>/coverage_report_zh.csv— 中文报告\x3Copeneuler基线所在目录>/coverage_report_en.csv— 英文报告
报告列定义
| 中文报告 | 英文报告 | 说明 |
|---|---|---|
| CIS 规则编号 | CIS Rule ID | CIS 基准规则编号 |
| CIS 规则标题 | CIS Rule Title | CIS 规则标题 |
| 配置项路径 | Config Path | 受影响的配置文件或路径 |
| 配置参数 | Config Parameter | 具体的配置项 |
| CIS 期望值 | CIS Expected Value | CIS 要求的值 |
| OpenEuler 要求值 | OpenEuler Value | OpenEuler 基线定义的值 |
| 覆盖状态 | Coverage Status | 完全覆盖/部分覆盖/未覆盖 |
| 备注 | Remarks | 差异说明或人工确认提示 |
文件结构
cis-rhel-openeuler-coverage/
├── SKILL.md # 本文件
├── requirements.txt # Python 依赖
└── scripts/
├── parse_cis_pdf.py # CIS PDF 规则提取
├── parse_openeuler_md.py # OpenEuler MD 基线解析
├── coverage_analyzer.py # 匹配与覆盖分析
└── report_generator.py # 中英文 CSV 报告输出
依赖安装
首次使用前运行:
pip install -r "\x3Cskills-dir>/cis-rhel-openeuler-coverage/requirements.txt"
安全注意事项
- 本技能仅处理文档级分析,不修改任何系统配置
- CIS Benchmark PDF 和 OpenEuler 基线仅用于只读分析
- 生成的报告不包含凭据等敏感信息
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install cis-rhel-openeuler-coverage - After installation, invoke the skill by name or use
/cis-rhel-openeuler-coverage - Provide required inputs per the skill's parameter spec and get structured output
What is Cis Rhel Openeuler Coverage?
分析 CIS Red Hat Enterprise Linux Benchmark 中的安全规则在 OpenEuler 安全配置基线中的覆盖情况,输出完全覆盖、部分覆盖、未覆盖的规则清单。适用于:用户提供 CIS RHEL Benchmark PDF 文件路径和 OpenEuler 安全基线 MD 文件路径,要求... It is an AI Agent Skill for Claude Code / OpenClaw, with 15 downloads so far.
How do I install Cis Rhel Openeuler Coverage?
Run "/install cis-rhel-openeuler-coverage" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Cis Rhel Openeuler Coverage free?
Yes, Cis Rhel Openeuler Coverage is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Cis Rhel Openeuler Coverage support?
Cis Rhel Openeuler Coverage is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Cis Rhel Openeuler Coverage?
It is built and maintained by 0X008 (@0x008); the current version is v1.0.0.