安装 mql 和 cnspec 最简单的方法是使用安装脚本。
bash -c "$(curl -sSL https://install.mondoo.com/sh)"
https://install.mondoo.com/ps1
Set-ExecutionPolicy Unrestricted -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://install.mondoo.com/ps1'));
Install-Mondoo;
扫描你的目标平台:
# 使用事件和资产查询包查询系统信息
mql scan aws
# 扫描平台安全漏洞
cnspec scan aws
注册 Mondoo 账户以访问更多策略并存储报告。要了解更多信息,请联系我们。
cnspec login -t 'eyJh...llZ4BW'
mql 和 cnspec 支持本地和远程目标,包括服务器(Linux, Windows, macOS)、云(AWS、Azure、Google、VMware)、Kubernetes(EKS、GKE、AKS、自管理)、容器、容器注册表、SaaS 产品(Google Workspace、M365、GitHub、GitLab)等。
运行扫描:
# 扫描本地主机
cnspec scan local
# 扫描云环境
cnspec scan aws
cnspec scan gcp
cnspec scan azure
# 扫描 kubernetes 集群
cnspec scan k8s
# 扫描远程注册表中的 docker 镜像
cnspec scan docker image debian:12
# 扫描 docker 容器(从 docker ps 获取 ID)
cnspec scan docker container 00fa961d6b6a
# 通过 SSH 扫描系统
cnspec scan ssh [email protected]
https://install.mondoo.com/package/cnspec/{platform}/{arch}/{filetype}/{version}/{method}
参数支持以下值:
# 下载最新版本
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/download
# 获取最新 cnspec 包的文件名
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/filename
# 获取最新 cnspec 包的版本
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/version
# 获取最新 cnspec 客户端的 sha256
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/sha256
# 下载指定版本的 cnspec 客户端
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/5.21.1/download
# 获取指定版本 cnspec 客户端的 sha256
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/5.21.1/sha256
https://install.mondoo.com/k8s/operator
kubectl apply -f https://install.mondoo.com/k8s/operator
https://install.mondoo.com/k8s/auditconfig?nodes=true&kubernetesResources=true
kubectl apply -f https://install.mondoo.com/k8s/auditconfig?nodes=true&kubernetesResources=true
要浏览所有版本发布,请访问 https://releases.mondoo.com
安装脚本来源
mql 和 cnspec Bash 安装程序mql 和 cnspec Bash 二进制下载程序mql 和 cnspec PowerShell 安装程序mql 和 cnspec PowerShell 二进制下载程序配置管理
Docker 容器
版本发布
install.sh 脚本兼容 POSIX sh。所有测试通过 repo 根目录的 make 驱动。
快速 lint(无需 Docker):
# POSIX 合规性:shellcheck -s sh, dash -n, shebang check
make test/posix
# 通用 shellcheck(所有 shell 脚本)
make test/shellcheck
基于 Docker 的集成测试:
这些将本地 install.sh 挂载到容器中,并在发行版的 /bin/sh 下运行它:
# 在 Debian/Ubuntu 发行版上测试(apt)
make test/install_sh/apt
# 在 RHEL/CentOS/Fedora 发行版上测试(yum)
make test/install_sh/yum
# 在 SUSE 上测试(zypper)
make test/install_sh/zypper
# 通过现有的多阶段 Dockerfile 测试(所有发行版)
make test/install_sh
# 运行所有:lint + 所有 Docker 测试
make test/install_sh/all
升级测试(cnquery -> mql 迁移):
make test/install_sh/upgrade-apt
make test/install_sh/upgrade-yum
make test/download_sh
make test/powershell
Mondoo 对 Microsoft Windows 可执行文件、PowerShell 脚本、Linux 包进行签名,并对 Apple macOS 可执行文件进行代码签名。公钥代码签名证书和公钥 GPG 密钥存储在安装器仓库中。
public-code-signing.cerpublic-package-signing.gpg注意: PowerShell Core 中目前没有 Get-AuthenticodeSignature cmdlet,因此你需要 Windows 安装才能运行它。
自 11.66.1 版本发布以来,我们采用了 Azure Trusted Signing,它提供大约每 72 小时轮换一次的短期代码签名证书。这意味着证书指纹在不同版本发布之间会有所不同,不能用作可靠的验证方法。
要验证 mql 或 cnspec 可执行文件的完整性,请使用 Microsoft 的 Get-AuthenticodeSignature PowerShell 命令,验证签名状态是否为 Valid。另外,签名者(Subject) 为:CN=Mondoo, Inc.,颁发者(Issuer) 为:CN=Microsoft ID Verified CS EOC CA 01, O=Microsoft Corporation, C=US
$file = ".\mondoo_11.66.1_windows_amd64.msi"
(Get-AuthenticodeSignature -FilePath $file).SignerCertificate | Format-List
Subject : CN="Mondoo, Inc.", O="Mondoo, Inc.", L=Cary, S=North Carolina, C=US
Issuer : CN=Microsoft ID Verified CS EOC CA 01, O=Microsoft Corporation, C=US
Thumbprint : 6134EB03311452EFFFA36EFC767F4BEBE29A4107
FriendlyName :
NotBefore : 05/08/2025 14:08:51
NotAfter : 08/08/2025 14:08:51
Extensions : {System.Security.Cryptography.Oid, System.Security.Cryptography.Oid,
System.Security.Cryptography.Oid, System.Security.Cryptography.Oid...}
要验证 Mondoo PowerShell install.ps1 脚本的完整性,请使用 Microsoft 的 Get-AuthenticodeSignature PowerShell,验证签名状态是否为 Valid。
Get-AuthenticodeSignature .\install.ps1
SignerCertificate Status
----------------- ------
6134EB03311452EFFFA36EFC767F4BEBE29A4107 Valid
在 11.66.1 版本之前,我们使用 DigiCert 签署我们的 Microsoft 版本发布。这些版本由 CN=DigiCert Global G3 Code Signing ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US 颁发的证书签名,并且具有静态指纹 EE97D1E3C6CD96E06C47B0233DD7C6CE2684FA50。
要验证 mql 或 cnspec 可执行文件的完整性,请使用 Apple 的 codesign 工具,并比较 TeamIdentifier 字段,该字段应与下面的匹配。
codesign --verify -d --verbose=2 /usr/local/bin/cnspec
Executable=/Library/Mondoo/bin/cnspec
Identifier=cnspec
Format=Mach-O universal (x86_64 arm64)
CodeDirectory v=20500 size=2124850 flags=0x10000(runtime) hashes=66396+2 location=embedded
Signature size=9054
Authority=Developer ID Application: Mondoo, Inc. (W2KUBWKG84)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=25. Apr 2023 at 19:47:53
Info.plist=not bound
TeamIdentifier=W2KUBWKG84
Runtime Version=11.0.0
Sealed Resources=none
Internal requirements count=1 size=168
Mondoo 当前的 PGP 公钥具有 ID 00E1C42B / 指纹 4CE909E26AE7439C39CE7647AC69C65100E1C42B,内容如下:
-----BEGIN PGP PUBLIC KEY BLOCK-----
<密钥块>
-----END PGP PUBLIC KEY BLOCK-----
密钥 ID 00E1C42B / 指纹 4CE909E26AE7439C39CE7647AC69C65100E1C42B:
-----BEGIN PGP PUBLIC KEY BLOCK-----
<之前的密钥块>
-----END PGP PUBLIC KEY BLOCK-----
你可以从以下地址下载 Mondoo 的公共 PGP 密钥(两者相同):
| 参数 | 值 |
|---|
platform | linux, windows, darwin |
arch | amd64, arm64, armv7, armv6, 386, ppc64le |
filetype | tar.gz, deb, rpm, zip, pkg, msi |
version | latest 或特定数字 |
method | download, filename, version, sha256 |