
installer v13.37.0
cnquery と cnspec 向けの Linux、macOS、Windows インストールスクリプト
概要
ステータス
これらは main に対して実行されるため、このリポジトリ内のスクリプトの現状を反映しています。
Docker イメージ、Homebrew、Arch Linux、macOS パッケージは、公開されたすべてのリリースに対して Test Release: ALL によってテストされています。 これらはその実行から呼び出される再利用可能なワークフローであるため、GitHub は各実行を呼び出し元に帰属させ、独自のバッジは表示されません。
インストール
mql と cnspec をインストールする最も簡単な方法は、インストールスクリプトを使用することです。
シェルスクリプト経由 (Linux および macOS)
bash -c "$(curl -sSL https://install.mondoo.com/sh)"
PowerShell 経由 (Windows)
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;
HTTP プロキシの背後で
インストールスクリプトにプロキシを -x (Linux および macOS) または -Proxy
(Windows) で渡します。スクリプトは自身のダウンロード、パッケージのインストール、
cnspec login、および自動アップデーターをこのプロキシ経由でルーティングします。スクリプトの
初回ダウンロードはフラグが読み取られる前に発生するため、そちらもプロキシを指定してください:
export https_proxy='http://proxy.example.com:3128'
curl -sSL --proxy "$https_proxy" https://install.mondoo.com/sh | bash -s -- -x "$https_proxy"
Set-ExecutionPolicy Unrestricted -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
$wc = New-Object System.Net.WebClient;
$wc.Proxy = New-Object System.Net.WebProxy('http://proxy.example.com:3128');
iex ($wc.DownloadString('https://install.mondoo.com/ps1'));
Install-Mondoo -Proxy 'http://proxy.example.com:3128';
Linux と macOS では、-x が指定されていない場合、継承された https_proxy または http_proxy が自動的に採用されます。いずれの場合も両方の形式がエクスポートされるため、ディストリビューション自身のリポジトリ — Debian と Ubuntu ではプレーン HTTP — もプロキシ経由で到達されます。設定済みの no_proxy は変更されずに引き継がれ、sudo をまたいでも維持されます。
プロキシ URL はプレーンな URL である必要があります。認証情報を含む場合は、パーセントエンコードしてください(! を %21 にする、など)。この値は自動アップデーターのスケジュールされたジョブに書き込まれるため、そこでクォートが必要になる文字はエスケープされるのではなく拒否されます。
ターゲットプラットフォームをスキャンする
ターゲットプラットフォームをスキャンします:
# query system information with incident and inventory query pack
mql scan aws
# scan the platform for security vulnerabilities
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)などを含みます。
スキャンを実行します:
# scan your local host
cnspec scan local
# scan a cloud environment
cnspec scan aws
cnspec scan gcp
cnspec scan azure
# scan a kubernetes cluster
cnspec scan k8s
# scan a docker image from a remote registry
cnspec scan docker image debian:12
# scan a docker container (get ids from docker ps)
cnspec scan docker container 00fa961d6b6a
# scan a system over ssh
cnspec scan ssh [email protected]
パッケージ情報
https://install.mondoo.com/package/cnspec/{platform}/{arch}/{filetype}/{version}/{method}
引数は以下の値をサポートします:
| 引数 | 値 |
|---|---|
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 |
# Download the latest version
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/download
# Get the filename for the latest cnspec package
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/filename
# Get the version for the latest cnspec package
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/version
# Get the sha256 for the latest cnspec client
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/latest/sha256
# Download a specific version of cnspec client
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/5.21.1/download
# Get the sha256 for a specific version of cnspec Client
https://install.mondoo.com/package/cnspec/linux/arm64/rpm/5.21.1/sha256
Kubernetes
オペレーターをインストールするための Kubernetes マニフェスト
https://install.mondoo.com/k8s/operator
kubectl apply -f https://install.mondoo.com/k8s/operator
MondooAuditConfig を設定するための Kubernetes マニフェスト
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 にアクセスしてください。
参考情報
インストールスクリプトのソース
- install.sh -
mql&cnspecBash インストーラー - download.sh -
mql&cnspecBash バイナリダウンローダー - install.ps1 -
mql&cnspecPowerShell インストーラー - download.ps1 -
mql&cnspecPowerShell バイナリダウンローダー
構成管理
Docker コンテナ
リリース
テスト
install.sh
install.sh スクリプトは POSIX sh 互換です。すべてのテストはリポジトリのルートから make を介して実行されます。
クイックリント(Docker 不要):
# POSIX compliance: shellcheck -s sh, dash -n, shebang check
make test/posix
# General shellcheck (all shell scripts)
make test/shellcheck
Docker ベースの統合テスト:
これらはローカルの install.sh をコンテナにマウントし、ディストリビューションの /bin/sh の下で実行します:
# Test on Debian/Ubuntu distros (apt)
make test/install_sh/apt
# Test on RHEL/CentOS/Fedora distros (yum)
make test/install_sh/yum