CIS Distribution Independent Linux Benchmark - InSpec Profile 使用教程

CIS Distribution Independent Linux Benchmark - InSpec Profile 使用教程

cis-dil-benchmarkCIS Distribution Independent Linux Benchmark - InSpec Profile项目地址:https://gitcode.com/gh_mirrors/ci/cis-dil-benchmark

1. 项目的目录结构及介绍

cis-dil-benchmark/
├── controls/
│   ├── cis-dil-1.1.0.rb
│   ├── cis-dil-1.1.1.rb
│   ├── ...
├── libraries/
│   ├── cis_dil.rb
│   ├── ...
├── README.md
├── inspec.yml
├── Gemfile
└── ...

目录结构介绍

  • controls/: 包含所有InSpec控制文件,每个文件对应CIS Benchmark中的一个或多个配置项。
  • libraries/: 包含自定义的InSpec库文件,用于扩展InSpec的功能。
  • README.md: 项目的基本介绍和使用说明。
  • inspec.yml: InSpec配置文件,定义了项目的元数据和依赖关系。
  • Gemfile: Ruby项目的依赖管理文件,定义了项目所需的Gem包。

2. 项目的启动文件介绍

项目的启动文件主要是inspec.yml,它定义了InSpec项目的配置信息。以下是inspec.yml的内容示例:

name: cis-dil-benchmark
title: CIS Distribution Independent Linux Benchmark
maintainer: DevSec Hardening Framework Team
copyright: DevSec Hardening Framework Team
copyright_email: hello@dev-sec.io
license: Apache-2.0
summary: An InSpec Compliance Profile for CIS Distribution Independent Linux Benchmark
version: 2.0.0
supports:
  platform: linux
depends:
  - name: linux-baseline
    url: https://github.com/dev-sec/linux-baseline/archive/master.tar.gz

启动文件介绍

  • name: 项目的名称。
  • title: 项目的标题。
  • maintainer: 项目的维护者。
  • copyright: 版权信息。
  • license: 项目的开源许可证。
  • summary: 项目的简要描述。
  • version: 项目的版本号。
  • supports: 项目支持的平台。
  • depends: 项目依赖的其他InSpec Profile。

3. 项目的配置文件介绍

项目的配置文件主要是controls/目录下的InSpec控制文件,每个文件对应CIS Benchmark中的一个或多个配置项。以下是controls/cis-dil-1.1.0.rb的内容示例:

control 'cis-dil-1.1.0' do
  impact 1.0
  title 'Ensure mounting of cramfs filesystems is disabled'
  desc 'The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image.'
  tag 'cis-dil-1.1.0'
  tag 'level:1'
  ref 'CIS Distribution Independent Linux Benchmark v2.0.0 - 1.1.1'

  describe kernel_module('cramfs') do
    it { should be_disabled }
  end
end

配置文件介绍

  • control: 定义一个InSpec控制项。
  • impact: 控制项的影响级别。
  • title: 控制项的标题。
  • desc: 控制项的描述。
  • tag: 控制项的标签,用于分类和过滤。
  • ref: 控制项的参考文档。
  • describe: 定义一个测试块,用于检查系统的配置是否符合要求。
  • it: 定义一个测试用例,检查内核模块是否被禁用。

通过以上内容,您可以了解如何使用和配置cis-dil-benchmark项目。

cis-dil-benchmarkCIS Distribution Independent Linux Benchmark - InSpec Profile项目地址:https://gitcode.com/gh_mirrors/ci/cis-dil-benchmark

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云含荟Gilbert

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值