Mondoo:Cloud-Native安全和漏洞風險管理系統

  • 2019 年 10 月 6 日
  • 筆記

Mondoo是一個Cloud-Native安全和漏洞風險管理系統且開箱即用。Mondoo集成了主要的雲環境,CI/CD環境和構建工具(如packer)以及資源調配工具Terraform,Ansible和Chef等。

Mondoo支援以下作業系統的漏洞掃描:

Amazon Linux 1 & 2 RedHat 6,7,8 CentOS 6,7 Oracle Linux 6,7,8 Ubuntu 14.04, 16.04, 18.04 Suse 12 openSUSE leap

Mondoo的報告可以直接列印在終端:

在你的Mondoo儀錶板中:

或在你的CI/CD環境中:

快速入門

使用Mondoo的最簡單方法是在你的工作站本地安裝agent,或使用我們的Docker容器mondoolabs/mondoo。

安裝

Windows workstation

iex (new-object net.webclient).downloadstring('https://mondoo.io/download.ps1')

有關詳細資訊,請參閱在Windows工作站安裝 Mondoo Agent部分。

macOS Workstation

brew tap mondoolabs/mondoo  brew install mondoo

有關詳細資訊,請參閱在MacOS工作站安裝Mondoo Agent部分。

Linux Workstation

curl -sSL https://mondoo.io/download.sh | bash

注意:Mondoo支援廣泛的[Linux作業系統(../agent)。我們建議你為伺服器環境安裝軟體包,以確保始終檢索最近更新。對於工作站,我們還提供了一個與mondoo二進位文件一起發布的腳本。

註冊

mondoo register --token 'ey...FlP'    ✔  agent //agents.api.mondoo.app/spaces/dazzling-hermann-857694/agents/1NmZG4Mt2fKXRrYGvUPiyLG7JyQ registered successfully

掃描你的第一個目標

mondoo scan -t ssh://[email protected]  Start vulnerability scan:    →  verify platform access to ssh://[email protected]    →  gather platform details    →  detected amzn 2    →  gather platform packages for vulnerability scan    →  found 435 packages    →  analyse packages for vulnerabilities  Advisory Report:    ■   SCORE  PACKAGE       INSTALLED               VULNERABLE (<)          **AILABLE               ADVISORY    ■   7.8    curl          7.61.1-9.amzn2.0.1      7.61.1-11.amzn2.0.2     7.61.1-11.amzn2.0.2     https://mondoo.app/vuln/ALAS2-2019-1233    ■   7.8    libcurl       7.61.1-9.amzn2.0.1      7.61.1-11.amzn2.0.2     7.61.1-11.amzn2.0.2     https://mondoo.app/vuln/ALAS2-2019-1233    ■   6.9    kernel        4.14.123-111.109.amzn2  4.14.133-113.112.amzn2  4.14.133-113.112.amzn2  https://mondoo.app/vuln/ALAS2-2019-1253    ╰─  6.5    kernel        4.14.123-111.109.amzn2  4.14.133-113.105.amzn2  4.14.133-113.112.amzn2  https://mondoo.app/vuln/ALAS2-2019-1232    ■   6.9    kernel-tools  4.14.133-113.105.amzn2  4.14.133-113.112.amzn2  4.14.133-113.112.amzn2  https://mondoo.app/vuln/ALAS2-2019-1253    →  ■ found 3 advisories: ■ 0 critical, ■ 1 high, ■ 2 medium, ■ 0 low, ■ 0 none, ■ 0 unknown    →  report is available at https://mondoo.app/v/tender-elbakyan-495615/gallant-kilby-587371/reports/1P4JUZrB1n6rkKU5J5JthPtP42Q

嘗試使用 Docker

1.啟動mondoo容器

在容器中啟動mondoo非常簡單:

$ docker run -it --entrypoint /bin/sh mondoolabs/mondoo  / $ mondoo    _____ ______   ________  ________   ________  ________  ________  |   _   _   |   __  |   ___  |   ___ |   __  |   __       \__      |     \      _|    |     |        \|__|      \     \       \    \     \                   \     \      _\    \     \        __     __ _______ __\ __ _______ _______ _______      |__|     |__||_______||__| |__||_______||_______||_______|    Mondoo scans operating systems for known vulnerabilities    Usage:    mondoo [command]    Available Commands:    help        Help about any command    register    Registers Mondoo agent with Mondoo Cloud    scan        Scans an asset for known vulnerabilities    status      Verifies the access to Mondoo Cloud    unregister  Unregister Mondoo agent from Mondoo Cloud    version     Displays the Mondoo agent version    Flags:        --config string   config file (default is $HOME/.mondoo.yaml)    -h, --help            help for mondoo    Use "mondoo [command] --help" for more information about a command.

2. 註冊代理

/ $ mondoo register --token 'ey...FlP'    ✔  agent //agents.api.mondoo.app/spaces/dazzling-hermann-857694/agents/1NmZG4Mt2fKXRrYGvUPiyLG7JyQ registered successfully

1.掃描本地容器

/ $ mondoo scan  Start vulnerability scan:    →  verify platform access to local://    →  gather platform details    →  detected alpine 3.10.0    →  gather platform packages for vulnerability scan    →  found 38 packages    →  analyse packages for vulnerabilities  Advisory Report:    →  ■ found no advisories    →  report is available at https://mondoo.app/v/tender-elbakyan-495615/dazzling-hermann-857694/reports/1NmZH5j4FEusxhzN6QsPeniuJJB

2.從容器內掃描遠程容器鏡像:

/ $ mondoo scan -t docker://centos:7  Start vulnerability scan:    →  verify platform access to docker://centos:7    →  gather platform details    →  detected centos 7.6.1810    →  gather platform packages for vulnerability scan    →  found 146 packages    →  analyse packages for vulnerabilities  Advisory Report:    ■        PACKAGE       INSTALLED          VULNERABLE (<)       ADVISORY    ■   9.8  python        2.7.5-76.el7       0:2.7.5-77.el7_6     https://mondoo.app/advisories/RHSA-2019%3A0710    ╰─  9.8  python        2.7.5-76.el7       0:2.7.5-80.el7_6     https://mondoo.app/advisories/RHSA-2019%3A1587    ■   9.8  python-libs   2.7.5-76.el7       0:2.7.5-77.el7_6     https://mondoo.app/advisories/RHSA-2019%3A0710    ╰─  9.8  python-libs   2.7.5-76.el7       0:2.7.5-80.el7_6     https://mondoo.app/advisories/RHSA-2019%3A1587    ■   8.8  libssh2       1.4.3-12.el7       0:1.4.3-12.el7_6.2   https://mondoo.app/advisories/RHSA-2019%3A0679    ■   8.6  bind-license  32:9.9.4-73.el7_6  32:9.9.4-74.el7_6.1  https://mondoo.app/advisories/RHSA-2019%3A1294    ■   4.7  openssl-libs  1:1.0.2k-16.el7    1:1.0.2k-16.el7_6.1  https://mondoo.app/advisories/RHSA-2019%3A0483    →  ■ found 5 advisories: 2 critical, 2 high, 1 medium, 0 low, 0 none, 0 unknown    →  report is available at https://mondoo.app/v/tender-elbakyan-495615/dazzling-hermann-857694/reports/1NmZUg5URmOErNRqjxmLiOJsip1

從你的工作站掃描目標

雖然Mondoo agent被設計為在你的伺服器基礎架構上連續運行,但使用CLI進行快速漏洞掃描也很容易。這允許任何人收集特定資產的快速風險評估。通過使用Mondoo的代理,你可以掃描:

Ssh 目標 Docker images Running Docker containers Stopped Docker containers Local system(代理運行的位置)

以下示例假定你已在工作站上安裝了Mondoo。

SSH 目標

mondoo代理具有完整的ssh支援,並會自動從ssh配置和ssh-agent的憑據中獲取配置。因此,你不需要將密碼作為明文傳遞,以避免在shell歷史記錄中存儲憑據。另外,它更方便:-)

# scan ssh target with default port 22  $ mondoo scan -t ssh://[email protected]  # scan ssh target on a custom port  $ mondoo scan -t ssh://[email protected]:2222

mondoo代理使用~/.ssh/config中的定義。以下定義了ssh的host shorty:

Host shorty    HostName 54.205.49.51    User ec2-user

你可以使用shorty作為monndoo的主機標識符:

# use hosts defined in ~/.ssh/config  $ mondoo scan -t ssh://shorty

身份驗證

你可以通過-i選項傳遞未加密的密鑰:

mondoo scan -t ssh://[email protected] -i /path/to/private_key

注意:我們建議使用ssh-agent作為身份密鑰,因為mondoo無法自行解密密鑰

Agent 驗證

由於mondoo與ssh-agent集成,因此你無需提供身份密鑰。這也是加密身份密鑰的推薦解決方案:

ssh-add /path/to/private_key  mondoo scan -t ssh://[email protected]

密碼驗證

注意:我們不建議將此方法用於任何生產工作負載,因為它可能會在日誌中將密碼公開為明文

mondoo scan -t ssh://vagrant:[email protected]

Docker Images

Mondoo可以通過其註冊表名稱直接掃描Docker容器鏡像:

$ mondoo scan -t docker://ubuntu:latest  $ mondoo scan -t docker://elastic/elasticsearch:7.2.0  $ mondoo scan -t docker://gcr.io/google-containers/ubuntu:14.04  $ mondoo scan -t docker://registry.access.redhat.com/ubi8/ubi

如果安裝了Docker代理,你可以按其id掃描鏡像:

$ mondoo scan -t docker://docker-image-id

Docker Container

你可以通過id輕鬆掃描正在運行的容器:

$ mondoo scan -t docker://docker-container-id

掃描也可用於已停止的容器。

注意:只有安裝了Docker引擎才能掃描Docker容器

本地系統

基於Linux的系統也可以在本地掃描:

$ mondoo scan

Mondoo Agent

Mondoo agent是一個小型的跨平台二進位文件,可輕鬆評估系統漏洞。其主要職責是確定已安裝的軟體包,並將包括其版本的軟體包列表發送到Mondoo的漏洞資料庫進行進一步分析。

在 Windows 工作站安裝 Mondoo Agent

Powershell

運行此powershell腳本將Mondoo安裝到C:Users\mondoo中的默認位置。

iex (new-object net.webclient).downloadstring('https://mondoo.io/download.ps1')

安裝代理後,你可以註冊代理

$MONDOO_REGISTRATION_TOKEN="pastetokenhere"  mondoo register --token $MONDOO_REGISTRATION_TOKEN    ✔  agent //agents.api.mondoo.app/spaces/peaceful-burnell-555533/agents/1ON7UPoNpkKxkMncKTFUcwZLVrt registered successfully

Binary 下載

Mondoo為Windows分發二進位文件。要安裝代理,請下載相應的軟體包。Windows系統的存檔文件使用.zip。下載完成後提取內容。Mondoo代理是一個名為mondoo的二進位程式碼。最後一步是將mondoo二進位文件添加到路徑中。你可以通過控制面板配置路徑:

轉到控制面板 – >系統 – >系統設置 – >環境變數 在系統變數部分向下滾動,找到Path。 單擊編輯並添加新路徑,確保以分號分隔路徑,即C:path1;C:path2 啟動新控制台以使更改生效

WSL

如果你使用的是WSL,則可以使用我們的Linux Bash安裝程式:

MONDOO_REGISTRATION_TOKEN='ey...ax'  curl -sSL https://mondoo.io/install.sh | bash

在 macOS 工作站安裝 Mondoo Agent

首先,添加mondoo brew tap:

brew tap mondoolabs/mondoo

然後,安裝mondoo代理:

brew install mondoo

向你的mondoo雲組織註冊代理

mondoo register --token 'TOKEN'

在 RedHat & CentOS 安裝 Mondoo Agent

首先,添加mondoo簽名的apt存儲庫:

curl --silent --location https://releases.mondoo.io/rpm/mondoo.repo | tee /etc/yum.repos.d/mondoo.repo

然後,安裝mondoo代理:

yum install -y mondoo

向你的mondoo雲組織註冊代理

mondoo register --config /etc/opt/mondoo/mondoo.yml --token 'TOKEN'

啟動代理:

systemctl enable mondoo.timer && systemctl start mondoo.timer  systemctl daemon-reload

代理狀態可以通過以下方式顯示:

systemctl list-timers  systemctl status mondoo.timer

更新

mondoo代理可以通過以下方式輕鬆更新:

yum clean expire-cache && yum update mondoo

在 Amazon Linux 安裝 Mondoo Agent

首先,添加mondoo簽名的apt存儲庫:

curl --silent --location https://releases.mondoo.io/rpm/mondoo.repo | tee /etc/yum.repos.d/mondoo.repo

然後,安裝mondoo代理:

yum install -y mondoo

向你的mondoo雲組織註冊代理

mondoo register --config /etc/opt/mondoo/mondoo.yml --token 'TOKEN'

啟動代理:

systemctl enable mondoo.timer && systemctl start mondoo.timer  systemctl daemon-reload

代理狀態可以通過以下方式顯示:

systemctl list-timers  systemctl status mondoo.timer

更新

mondoo代理可以通過以下方式輕鬆更新:

yum clean expire-cache && yum update mondoo

在 Ubuntu & Debian 安裝 Mondoo Agent

首先,添加mondoo簽名的apt存儲庫:

curl -sS https://releases.mondoo.io/debian/pubkey.gpg | apt-key add -  echo "deb https://releases.mondoo.io/debian/ stable main" | tee /etc/apt/sources.list.d/mondoo.list

然後,安裝mondoo代理:

apt-get update && apt-get install mondoo

向你的mondoo雲組織註冊代理

mondoo register --config /etc/opt/mondoo/mondoo.yml --token 'TOKEN'

啟動代理:

systemctl enable mondoo.timer && systemctl start mondoo.timer  systemctl daemon-reload

代理狀態可以通過以下方式顯示:

systemctl list-timers  systemctl status mondoo.timer

更新

mondoo代理可以通過以下方式輕鬆更新:

apt-get update && apt-get install -y mondoo

在 RedHat & CentOS 安裝 Mondoo Agent

首先,添加mondoo簽名的apt存儲庫:

curl --silent --location https://releases.mondoo.io/rpm/mondoo.repo | tee /etc/yum.repos.d/mondoo.repo

然後,安裝mondoo代理:

yum install -y mondoo

向你的mondoo雲組織註冊代理

mondoo register --config /etc/opt/mondoo/mondoo.yml --token 'TOKEN'

啟動代理:

systemctl enable mondoo.timer && systemctl start mondoo.timer  systemctl daemon-reload

代理狀態可以通過以下方式顯示:

systemctl list-timers  systemctl status mondoo.timer

更新

mondoo代理可以通過以下方式輕鬆更新:

yum clean expire-cache && yum update mondoo

在 Ubuntu & Debian 安裝 Mondoo Agent

首先,添加mondoo簽名的apt存儲庫:

curl -sS https://releases.mondoo.io/debian/pubkey.gpg | apt-key add -  echo "deb https://releases.mondoo.io/debian/ stable main" | tee /etc/apt/sources.list.d/mondoo.list

然後,安裝mondoo代理:

apt-get update && apt-get install mondoo

向你的mondoo雲組織註冊代理

mondoo register --config /etc/opt/mondoo/mondoo.yml --token 'TOKEN'

啟動代理:

systemctl enable mondoo.timer && systemctl start mondoo.timer  systemctl daemon-reload

代理狀態可以通過以下方式顯示:

systemctl list-timers  systemctl status mondoo.timer

更新

mondoo代理可以通過以下方式輕鬆更新:

apt-get update && apt-get install -y mondoo

在 Suse & openSUSE 安裝 Mondoo Agent

首先,添加mondoo簽名的apt存儲庫:

curl --silent --location https://releases.mondoo.io/rpm/mondoo.repo | tee /etc/zypp/repos.d/mondoo.repo

然後,安裝mondoo代理:

zypper -n --gpg-auto-import-keys install mondoo

向你的mondoo雲組織註冊代理

mondoo register --config /etc/opt/mondoo/mondoo.yml --token 'TOKEN'

啟動代理:

systemctl enable mondoo.timer && systemctl start mondoo.timer  systemctl daemon-reload

代理狀態可以通過以下方式顯示:

systemctl list-timers  systemctl status mondoo.timer

更新

mondoo代理可以通過以下方式輕鬆更新:

zypper update mondoo

通過 Ansible 安裝

我們發布了官方Mondoo role。

示例:將Ansible Playbook應用於Amazon EC2實例

此playbook演示了如何使用Mondoo role在許多實例上安裝代理:

1. 創建新的主機清單。將你的主機添加到該組。

[mondoo-agents]  54.172.7.243  ansible_user=ec2-user

2. 創建一個playbook.yml並更改mondoo_registration_token:

---  - hosts: mondoo-agents    become: yes    roles:      - role: mondoolabs.mondoo        vars:          mondoo_registration_token: "changeme"

3. 使用本地hosts文件運行playbook

# download mondoo role  ansible-galaxy install mondoolabs.mondoo  # apply the playbook  ansible-playbook -i hosts playbook.yml

所有實例都報告了其漏洞狀態

通過 Chef 安裝

我們在Chef Supermarket上發布了官方mondoo cookbook。你可以在自己的wrapper cookbooks 或 Chef Roles中使用此cookbook

應用cookbook,請通過以下方式設置Mondoo註冊令牌:

default['mondoo']['registration_token'] = "changeme"

示例:將Cookbook應用於Amazon EC2實例

1.在AWS上啟動新的Linux機器

2.如我們的示例中所述,創建運行wrapper cookbook

3.運行chef-run ssh://user@host ./run

4.所有實例都報告了其漏洞狀態

它是如何工作的?

代理通過持續評估已安裝的軟體包,並通過HTTPS將包元數據提交到Mondoo API來工作。在你的Mondoo Space註冊後,代理已準備好進行漏洞評估。

CLI專為兩種用例而設計:

作為持續漏洞評估的服務運行 在工作站上運行以評估遠程系統或docker鏡像的漏洞 將docker鏡像掃描作為CI/CD的一部分運行

使用案例:服務

你希望持續查看伺服器的漏洞評估。代理程式在後台運行並提交已安裝軟體包的更改以進行漏洞分析。通過使用此方法,你始終可以獲得基礎架構的最新視圖。

使用案例:工作站或CI/CD

你想評估可通過SSH訪問的系統的漏洞。

mondoo scan -t ssh://[email protected]  Start vulnerability scan:    →  verify platform access to ssh://[email protected]    →  gather platform details    →  detected amzn 2    →  gather platform packages for vulnerability scan    →  found 433 packages    →  analyse packages for vulnerabilities  Advisory Report:    →  ■ found no advisories    →  report is available at https://mondoo.app/v/goofy-hofstadter-187738/gallant-payne-155889/reports/1NmpiPcVfQZLT2GDylRjOc1wSMh

另一種選擇是快速掃描存儲在docker註冊表中的docker鏡像:

mondoo scan -t docker://centos:7  Start vulnerability scan:    →  verify platform access to docker://centos:7    →  gather platform details    →  detected centos 7.6.1810    →  gather platform packages for vulnerability scan    →  found 146 packages    →  analyse packages for vulnerabilities  Advisory Report:    ■        PACKAGE       INSTALLED          VULNERABLE (<)       ADVISORY    ■   9.8  python        2.7.5-76.el7       0:2.7.5-77.el7_6     https://mondoo.app/advisories/RHSA-2019%3A0710    ╰─  9.8  python        2.7.5-76.el7       0:2.7.5-80.el7_6     https://mondoo.app/advisories/RHSA-2019%3A1587    ■   9.8  python-libs   2.7.5-76.el7       0:2.7.5-77.el7_6     https://mondoo.app/advisories/RHSA-2019%3A0710    ╰─  9.8  python-libs   2.7.5-76.el7       0:2.7.5-80.el7_6     https://mondoo.app/advisories/RHSA-2019%3A1587    ■   8.8  libssh2       1.4.3-12.el7       0:1.4.3-12.el7_6.2   https://mondoo.app/advisories/RHSA-2019%3A0679    ■   8.6  bind-license  32:9.9.4-73.el7_6  32:9.9.4-74.el7_6.1  https://mondoo.app/advisories/RHSA-2019%3A1294    ■   4.7  openssl-libs  1:1.0.2k-16.el7    1:1.0.2k-16.el7_6.1  https://mondoo.app/advisories/RHSA-2019%3A0483    →  ■ found 5 advisories: 2 critical, 2 high, 1 medium, 0 low, 0 none, 0 unknown    →  report is available at https://mondoo.app/v/goofy-hofstadter-187738/gallant-payne-155889/reports/1NmZsWAQUmlXGtf5dqt083hfRJx  exit status 104

代理可以掃描以下資產:

本地作業系統 通過SSH遠程作業系統 Docker鏡像(本地或遠程) Docker容器(運行或停止)

使用

mondoo help    _____ ______   ________  ________   ________  ________  ________  |   _   _   |   __  |   ___  |   ___ |   __  |   __       \__      |     \      _|    |     |        \|__|      \     \       \    \     \                   \     \      _\    \     \        __     __ _______ __\ __ _______ _______ _______      |__|     |__||_______||__| |__||_______||_______||_______|    Mondoo scans operating systems for known vulnerabilities    Usage:    mondoo [command]    Available Commands:    help        Help about any command    register    Registers Mondoo agent with Mondoo Cloud    status      Verifies the access to Mondoo Cloud    unregister  Unregister Mondoo agent from Mondoo Cloud    version     Displays the Mondoo agent version    vuln        Scans an asset for known vulnerabilities    Flags:        --config string   config file (default is $HOME/.mondoo.yaml)    -h, --help            help for mondoo    Use "mondoo [command] --help" for more information about a command.

請參閱Mondoo CLI使用說明。

配置

代理使用yaml配置文件。有關詳細資訊,請參閱配置文檔。

幫助

有關安裝的幫助,請訪問診斷文檔或聯繫Mondoo支援。

自動化安裝

通過 Bash 腳本安裝 Mondoo 代理

此單行腳本安裝正在為伺服器安裝和配置Mondoo代理。其執行以下操作:

檢測作業系統 安裝Mondoo包 如果提供了MONDOO_REGISTRATION_TOKEN,則註冊代理 如果代理已註冊,則配置服務

注意:我們建議你在使用之前熟悉我們的腳本。源程式碼可以在我們的公共github存儲庫中找到

它沒有下載最新的二進位文件,而是配置gpg簽名的Mondoo軟體包存儲庫。這樣可以方便地安裝/更新/刪除Mondoo代理。

注意:如果你正在尋找binary下載(例如,我們建議將其用於工作站設置),請按照我們的binary安裝說明進行操作

示例

安裝包和註冊代理

安裝包後,安裝腳本將查找MONDOO_REGISTRATION_TOKEN環境變數。如果設置了,則啟動註冊過程。

export MONDOO_REGISTRATION_TOKEN='ey...ax'  curl -sSL https://mondoo.io/install.sh | bash

安裝包並手動註冊

如果未設置環境變數,則可以輕鬆地執行註冊作為第二步:

curl -sSL https://mondoo.io/install.sh | bash  MONDOO_REGISTRATION_TOKEN='ey...ax'  mondoo register --config /etc/opt/mondoo/mondoo.yml --token 'MONDOO_REGISTRATION_TOKEN'

systemd 配置

mondoo包附帶了systemd配置。默認情況下,不啟用mondoo服務。你可以通過以下方式啟用和啟動服務:

$ systemctl enable mondoo.timer  $ systemctl start mondoo.timer  $ systemctl daemon-reload

通過 cloud-init 安裝 Mondoo 代理

大多數雲環境都支援在啟動期間配置作業系統。在大多數情況下都使用cloud-init。對於Linux系統,cloud-init支援bash腳本。

我們只是將Mondoo Bash installer腳本用於cloud-init。要使用cloud-init部署代理,請通過Mondoo Dashboard -> Select Space -> Agents -> New Agent獲取註冊令牌,並將其粘貼到以下程式碼片段中:

#!/bin/bash  export MONDOO_REGISTRATION_TOKEN='ey..gg'  curl -sSL https://mondoo.io/install.sh | bash

一旦機器準備就緒,第一次掃描將在機器啟動後約30秒執行。

示例

AWS EC2 實例用戶數據

1. 將上面顯示的程式碼片段保存到mondoo-cloudinit.sh,並粘貼到你的註冊令牌中:

cat > mondoo-cloudinit.sh << EOF  #!/bin/bash  export MONDOO_REGISTRATION_TOKEN='eyJhbG..bn'  curl -sSL https://mondoo.io/install.sh | bash  EOF

2. 啟動一個新實例

# Note: you need to adapt the image-id, security-group-ids, key-name to your region and account  aws ec2 run-instances --region us-east-1 --image-id  ami-0ad82a384c06c911e --security-group-ids sg-903004f8 --count 1 --instance-type t2.micro --key-name chris-rock --user-data file://mondoo-cloudinit.sh

安裝完成後,你可以在Mondoo儀錶板中查看漏洞掃描的結果:

一旦機器啟動並運行,它將自動向Mondoo報告漏洞。有關AWS CLI的更多文檔,請參閱啟動,列出和終止Amazon EC2實例以及啟動時在Linux實例上運行命令

如要進行故障排除,請查看/var/log/cloud-init-output.log中的cloudinit運行輸出。

CLI 相關

mondoo

Mondoo CLI

Synopsis

_____ ______   ________  ________   ________  ________  ________  |   _   _   |   __  |   ___  |   ___ |   __  |   __       \__      |     \      _|    |     |        \|__|      \     \       \    \     \                   \     \      _\    \     \        __     __ _______ __\ __ _______ _______ _______      |__|     |__||_______||__| |__||_______||_______||_______|

Mondoo掃描作業系統是否存在已知漏洞

選項

 --config string   config file (default is $HOME/.mondoo.yaml)  -h, --help            help for mondoo

mondoo 註冊

使用Mondoo Cloud註冊Mondoo代理

Synopsis

此命令使用Mondoo Cloud註冊mondoo代理。它需要』—token』參數。

你可以通過 Mondoo Dashboard https://mondoo.app -> Space -> Agents -> New生成新的註冊令牌。複製令牌並將其作為』—token』參數傳遞:

mondoo register [flags]

選項

 --api-endpoint string   mondoo api url  -h, --help                  help for register  -t, --token string          agent registration token

從父命令繼承的選項

--config string   config file (default is $HOME/.mondoo.yaml)

mondoo 狀態

驗證對Mondoo Cloud的訪問

Synopsis

Status向Mondoo Cloud發送ping以驗證憑據。

mondoo status [flags]

選項

-h, --help   help for status

從父命令繼承的選項

--config string   config file (default is $HOME/.mondoo.yaml)

mondoo 掃描

掃描資產查找已知漏洞

Synopsis

此命令會觸發漏洞掃描。

默認情況下,掃描本地系統:

$ mondoo scan

此外,mondoo可以掃描遠程ssh目標。Mondoo使用ssh agent和ssh config作為默認值來檢索目標的憑據。

$ mondoo scan -t ssh://[email protected]  $ mondoo scan -t ssh://[email protected]:2222

你還可以訪問位於docker registries中的docker鏡像:

$ mondoo scan -t docker://ubuntu:latest  $ mondoo scan -t docker://elastic/elasticsearch:7.2.0  $ mondoo scan -t docker://gcr.io/google-containers/ubuntu:14.04  $ mondoo scan -t docker://registry.access.redhat.com/ubi8/ubi

如果在本地安裝docker,也可以通過其id訪問容器和鏡像:

$ mondoo scan -t docker://docker-image-id  $ mondoo scan -t docker://docker-container-id

如果你希望在本地存儲報告,請將輸出通過管道傳輸到文件中:

$ mondoo scan --format yaml > myreport.yaml

scan子命令返回以下退出程式碼:

* 0 - scan completed successfully with no vulnerabilities found  * 1 - error during execution  * 101 - scan completed successfully with low vulnerabilities found  * 102 - scan completed successfully with medium vulnerabilities found  * 103 - scan completed successfully with high vulnerabilities found  * 104 - scan completed successfully with critical vulnerabilities found

有關更多文檔,請訪問https://mondoo.io/docs/

mondoo scan [flags]

選項

--assetmrn string         Optional override of the  asset mrn for the asset      --collector string        The collector reports the packages to Mondoo cloud only and does not print the result on CLI. This is useful for automated environments. Supported values are 'http' and 'awssns'.      --color string            Highlights text and vulnerability output with colors. The possible values of when can be 'never', 'always' or 'auto'. (default "always")  -t, --connection string       The connection is the identifier a way to reach the asset. Supported connections are 'local://', 'docker://' and 'ssh://' (default "local://")      --exit-0-on-success       Returns 0 as exit code of the scan was successful. It ignores the severity of the vulnerability assessment.      --format string           Set the output format for the vulnerability report. Available options are 'cli' and 'yaml'. (default "cli")  -h, --help                    help for scan      --id-detector string      Set the assset id detector (eg. awsec2, hostname)  -i, --identity-file string    Selects a file from which the identity (private key) for public key authentication is read.      --labels stringToString   Additional labels enrich the asset with additional information. Multiple labels can be passed in via --labels key=value). (default [])  -p, --password string         ssh password (not recommended in production)      --referenceid string      Optional override of the reference id for the target

從父命令繼承的選項

--config string   config file (default is $HOME/.mondoo.yaml)

mondoo 取消註冊

從Mondoo Cloud取消註冊Mondoo代理

Synopsis

通過調用mondoo unregister,代理將與Mondoo Cloud分離。此過程還將啟動代理證書的重新確認,以確保以後不再使用代理憑據。

mondoo unregister [flags]

選項

--force   force new registration  -h, --help    help for unregister

從父命令繼承的選項

--config string   config file (default is $HOME/.mondoo.yaml)

Mondoo 集成

Mondoo為主要的CI/CD和雲環境提供了開箱即用的集成。具體請參閱:

https://mondoo.io/docs/integration/aws-ec2 https://mondoo.io/docs/integration/cicd?id=azure-devops https://mondoo.io/docs/integration/cicd?id=circle-ci https://mondoo.io/docs/integration/cicd?id=gcp-cloudbuild https://mondoo.io/docs/integration/cicd?id=gitlab https://mondoo.io/docs/integration/packer https://mondoo.io/docs/integration/terraform

幫助

你可以通過郵件([email protected])與我們取得聯繫。或在我們的社區中提出你的問題。如果你發現了bug,你可以向我們提交issue。

*參考來源:mondoo,FB小編secist編譯,轉載請註明來自FreeBuf.COM